<!-- Note: This file was originally generated by Genie
-->
<!--
Agile.Common Build File
Compiles and tests the project in Release mode.
This Project is dependent on:

-->

<project name="Agile.Common" default="go" basedir=".">
<property name="TestsBaseDirectory" value="..\Agile.Common.Tests" />
<property name="TestsAssemblyDirectory" value="${TestsBaseDirectory}\bin\Release" />
<property name="RunDirectory" value="${project::get-base-directory()}\${project::get-name()}" />
<property name="BuildResultsDirectory" value="${directory::get-current-directory()}\Build" />
<property name="nant.onfailure" value="OnFailure" />

<!-- Go
Runs both the build and test targets.
-->
<target name="go" depends="build, buildTest, test, UpdateResults"/>

<!-- Build
Builds the project and test project (if there is one).
-->

<target name="build">
<delete file="buildResults.xml" failonerror="false"/>
<echo message="*** Building Agile.Common.csproj..."/>
<exec
program="msbuild"
commandline="Agile.Common.csproj /verbosity:quiet /nologo /p:Configuration=Release;Platform=AnyCPU /logger:${environment::get-variable('RootDrive')}:\Build\CCLogger\ThoughtWorks.CruiseControl.MSBuild.dll;buildResults.xml"/>"/>
<echo message="*** Build of Agile.Common.csproj Completed Successfully!"/>
</target>


<target name="buildTest">
<delete file="buildResults.xml" failonerror="false"/>
<echo message="*** Building ..\Agile.Common.Tests\Agile.Common.Tests.csproj..."/>
<exec
program="msbuild"
commandline="..\Agile.Common.Tests\Agile.Common.Tests.csproj /verbosity:quiet /nologo /p:Configuration=Release;Platform=AnyCPU /logger:${environment::get-variable('RootDrive')}:\Build\CCLogger\ThoughtWorks.CruiseControl.MSBuild.dll;buildResults.xml"/>"/>
<echo message="*** Build of ..\Agile.Common.Tests\Agile.Common.Tests.csproj Completed Successfully!"/>
</target>


<!-- test
Tests are compulsory - every project must have them. All test results are copied into
C:\build\testresults (or whatever your RootDirectory is)
-->

<target name="test">
<echo message="*******************************************************"/>
<echo message=" RUNNING TEST SUITES *"/>
<echo message=" - ..\Agile.Common.Tests\Agile.Common.Tests.dll"/>
<echo message=" *"/>
<echo message="*******************************************************"/>

<nunit2 verbose="true" failonerror="true">
<formatter type="Plain" />
<formatter type="Xml" usefile="true" extension=".xml" />
<test assemblyname="${TestsAssemblyDirectory}\Agile.Common.Tests.dll"/>
</nunit2>

<call target="CopyResults" />
<echo message=""/>
<echo message="*** ${project::get-name()} SUCCESSFULLY BUILT AND TESTED! *"/>
<echo message=""/>

</target>

<target name="UpdateResults">
<mkdir dir="${BuildResultsDirectory}" failonerror="false"/>
<copy verbose="true" todir="${BuildResultsDirectory}" overwrite="true">
<fileset basedir="${project::get-base-directory()}">
<include name="buildResults.xml"/>
</fileset>
</copy>
</target>

<target name="CopyResults">
<mkdir dir="${BuildResultsDirectory}\TestResults" failonerror="true"/>
<copy verbose="true" todir="${BuildResultsDirectory}\TestResults">
<fileset basedir="${TestsAssemblyDirectory}">
<include name="*results.xml"/>
</fileset>
</copy>
<echo message="copied test results from: ${TestsAssemblyDirectory}...TO --> ${BuildResultsDirectory}"></echo>
</target>


<target name="OnFailure" description="Called when build fails">
<property name="message" value="OnFailure"/>
<call target="CopyResults" />

<call target="UpdateResults" />

</target>

</project>

Last edited Feb 23, 2009 at 6:56 AM by wallism, version 1

Comments

No comments yet.