<?xml version="1.0" encoding="utf-8" ?>
<project name="NAntTest" >
<property name="zac" value="projecttest"/>
<target name="SetUpVB">
<script language="VB">
<code>
<![CDATA[
Public shared sub ScriptMain(project As Project)
Dim path1 As String =
"C:\zDownLoads\Nant\NAntTest\NAntTest\test1.bat"
Dim fi As FileInfo = New FileInfo(path1)
If fi.Exists = False Then
'Create a file to write to.
Dim sw As StreamWriter = fi.CreateText()
console.writeline("File Created")
sw.WriteLine("Hello")
sw.WriteLine("And")
sw.WriteLine("Welcome")
console.writeline("Finished")
sw.Flush()
sw.Close()
else
console.writeline("Else Statement Executing")
End If
end sub
]]>
</code>
</script>
<echo message="Target Completed VB.NET"/>
</target>
<target name="SetUpC">
<script language="C#">
<code>
<![CDATA[
public static void ScriptMain(Project project)
{
//create a batch file
string val = @"C:\zDownLoads\Nant\NAntTest\NAntTest\test.bat";
FileInfo fi = new FileInfo(val);
StreamWriter sw = fi.CreateText();
//The List Of Operations you want to execute.
sw.WriteLine("C:\\Inetpub\\wwwroot\\postinfo.html");
sw.WriteLine("D:\\myfile.xml");
sw.WriteLine("C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regs
ql");
sw.Close();
}
]]>
</code>
</script>
<echo message="Target Completed C#"/>
</target>
</project>
<?xml version="1.0" encoding="utf-8" ?>
<project name="Source" default="getRevision" description="The project file
to get the source code and call other build files" >
<!--
############################################################################
################
Define Properties
############################################################################
################
-->
<property name="tag1.dir" value="C:\svnTag\usac\tags\Astars_0.0_RC0"/>
<property name="tag.dir"
value="https://emmaus.saic.com/svnrepo/usac/tags"/>
<property name="dest.dir" value="C:\svnTag1\usac\tags"/>
<property name="svn.user" value="ZacharyWheeler"/>
<property name="svn.pass" value="zwheeler"/>
<property name="svn.revision" value="0"/>
<property name="buildFile.name" value="astars.build"/>
<!--
############################################################################
################
Get Revision Number
############################################################################
################
-->
<target name="getRevision" description="Call the task to get latest
Revision Number">
<!--Retrieve Subversion revision number-->
<echo message="Retrieving Subversion revision number"/>
<exec
program="svn"
commandline='log "${tag1.dir}" --xml --limit 1'
output="${tag1.dir}\_revision.xml"
failonerror="false"/>
<xmlpeek
file="${tag1.dir}\_revision.xml"
xpath="/log/logentry/@revision"
property="svn.revision"
failonerror="false"/>
<echo message="Using Subversion Revision Number: ${svn.revision}"/>
<!--Call the Next Build File-->t
<call target="checkOutCode" />
</target>
<!--
############################################################################
################
Get the code from the source
############################################################################
################
-->
<target name="checkOutCode" description="Gets the latest Source Code from
the Repository">
<echo message="In checkout target Revision Number: ${svn.revision}"/>
<svn-checkout destination="${dest.dir}"
uri="${tag.dir}"
quiet="true"
username="${svn.user}"
password="${svn.pass}"
recursive="true"
revision="${svn.revision}"
/>
</target>
<!--
############################################################################
################
Call Defined Build File
############################################################################
################
-->
<target name="getBuildFile" description="This target calls another build
file">
<echo message="Call Existing Build File: ${buildFile.name}"/>
<nant
buildfile="${buildFile.name}"
target="init"
inheritall="true"/>
</target>
<target name="help">
<echo message="The help file provides a brief overview of the tasks in
this build file"/>
<echo message="-- checkOutCode - Checks out the latest code from the
source"/>
<echo message="-- getBuildFile - Calls an existing build file"/>
<echo message="-- getRevision - gets the latest revision number in the
source code"/>
</target>
</project>
<!--
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users