Hi,
I have starting using Nant for
dauly builds and Unit tesys. My problem is that <target> only seeme sto
execute once in my buildfile. My xml below shows a compile target and a copy
tartget, however only the first one executes even though the second target
depends on the first.
Secondly can someone provide me with the syntax for
writing the Nant output to a log gile...I know it is in the help but it doesn't
appear to work for me.
<?xml version="1.0"?>
<!-- Tony Hamill
June 2003 Nant Build Tool Integration with NUnit Unit
Testing Tool
--> <project name="Audit" default="build" basedir="."> <property name="debug" value="true"/>
<property name="build.dir" value="bin" /> <target name="build" description="Compile
Projects">
<!-- build Exceptions project --> <mkdir dir="Exceptions/${build.dir}"/> <csc target="library" output="Exceptions/${build.dir}/Exceptions.dll" debug="${debug}"> <references basedir="Exceptions/bin"> <includes name="Exceptions/*.dll"/> </references> <sources> <includes name="Exceptions/UserManagerExceptions/*.cs"/> <includes name="Exceptions/WorkflowEngineExceptions/*.cs"/> </sources> </csc> <!-- build Utilities project --> <mkdir dir="Utilities/${build.dir}"/> <csc target="library"
output="Utilities/${build.dir}/Utilities.dll"
debug="${debug}">
<references basedir="Utilities/bin"> <includes name="*.dll"/> </references> <sources> <includes name="Utilities/*.cs"/> </sources> </csc> <!-- build workflow project -->
<mkdir dir="WorkflowEngine/${build.dir}"/> <csc target="library"
output="WorkflowEngine/${build.dir}/WorkflowEngine.dll"
debug="${debug}">
<references basedir="Exceptions/bin"> <includes name="*.dll"/> </references> <sources> <includes name="WorkflowEngine/*.cs"/> <includes name="WorkflowEngine/Factory/*.cs"/> <includes name="WorkflowEngine/Manager/*.cs"/> </sources> </csc> <!-- build Audit project --> <mkdir dir="Audit/${build.dir}"/> <csc target="library"
output="Audit/${build.dir}/Audit.dll"
debug="${debug}">
<references basedir="WorkflowEngine/bin"> <includes name="*.dll"/> </references> <sources> <includes name="Audit/*.cs"/> </sources> </csc> <!-- build ContentManager project -->
<mkdir dir="ContentManager/${build.dir}"/> <csc target="library"
output="ContentManager/${build.dir}/ContentManager.dll"
debug="${debug}">
<references basedir="."> <includes name="Exceptions/bin/*.dll"/> <includes name="Utilities/bin/*.dll"/> <includes name="WorkflowEngine/bin/*.dll"/> </references> <sources> <includes name="ContentManager/*.cs"/> </sources> </csc> <!-- build DLO Layer project -->
<mkdir dir="DataLayer/${build.dir}"/> <csc target="library"
output="DataLayer/${build.dir}/DataLayer.dll"
debug="${debug}">
<references basedir="."> <includes name="ContentManager/bin/*.dll"/> <includes name="..\db4oD\db4o_Test\bin\Debug\db4o.dll"/> <includes name="WorkflowEngine/bin/*.dll"/> </references> <sources> <includes name="DataLayer/*.cs"/> </sources> </csc> <!-- build QueueManager project -->
<mkdir dir="QueueManager/${build.dir}"/> <csc target="library"
output="QueueManager/${build.dir}/QueueManager.dll"
debug="${debug}">
<references basedir="."> <includes name="WorkflowEngine/bin/*.dll"/> </references> <sources> <includes name="QueueManager/*.cs"/> </sources> </csc> <!-- build UserManager project -->
<mkdir dir="UserManager/${build.dir}"/> <csc target="library"
output="UserManager/${build.dir}/UserManager.dll"
debug="${debug}">
<references basedir="."> <includes name="Exceptions/bin/*.dll"/> </references> <sources> <includes name="UserManager/*.cs"/> </sources> </csc> <!-- build Unit Tests prior to execution -->
<mkdir dir="UnitTests/${build.dir}"/> <csc target="library"
output="UnitTests/${build.dir}/UnitTests.dll"
debug="${debug}">
<references basedir="."> <includes name="UserManager/bin/*.dll"/> <includes name="UnitTests/nunit.framework.dll"/> </references> <sources> <includes name="UnitTests/*.cs"/> </sources> </csc> <!-- copy the UserManager dll to the Unit Test Bin Dir to run Unit Tests against --> <copy todir="UnitTests/${build.dir}" file="UserManager/${build.dir}/UserManager.dll"/> <!-- Run the current Unit Tests -->
<exec program="nunit-console" commandline="/fixture:UnitTests.UserTest /assembly:C:\dotNet\Compile\UnitTests\bin\UnitTests.dll /xml:UserTest.xml"/>
</target>
<target name="Archive" depends="build">
<!-- Compress the source file for todays build
-->
<zip zipfile="backup.zip"> <fileset basedir="."> <includes name="Audit/*.cs"/> <includes name="ContentManager/*.cs"/> <includes name="ContentManager/*.cs"/> <includes name="DataLayer/*.cs"/> <includes name="Exceptions/*.cs"/> <includes name="QueueManager/*.cs"/> <includes name="UnitTests/*.cs"/> <includes name="UserManager/*.cs"/> <includes name="Utilities/*.cs"/> <includes name="WorkflowEngine/*.cs"/> </fileset> </zip> </target> </project>
|