Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok I seem to have got it now, this is how my script looks now:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;project name="Calculator" default="execute" basedir="."&gt; &lt;property name="InstallationDir" value="C:\BoolCalc" readonly="false"/&gt; &lt;property name="NUnitLocation" value="${path::combine(directory::get-current-directory(), 'NUnit\bin\net-2.0\nunit-console.exe')}" readonly="false" /&gt; &lt;description&gt;The build scripts for the bool calculator&lt;/description&gt; &lt;target name="clean" description="Remove all previous versions and generated files"&gt;&lt;!--This ensures that old files are deleted if they are there and does nothing if they aren't--&gt; &lt;delete dir="${InstallationDir}" failonerror="false" /&gt;&lt;!-- This deletes the directory on your computer for the previous versions, if there are any --&gt; &lt;delete file="test\Calc.exe" failonerror="false" /&gt; &lt;/target&gt; &lt;target name="build" description="compiles the source code" depends="clean"&gt; &lt;csc target="exe" output="test\Calc.exe" &gt; &lt;sources&gt; &lt;include name="src\*.cs" /&gt; &lt;/sources&gt; &lt;references&gt; &lt;include name="lib\nunit.framework.dll" /&gt; &lt;/references&gt; &lt;/csc&gt; &lt;/target&gt; &lt;target name="testProgram" description="Run unit tests" depends="build"&gt; &lt;exec program="${NUnitLocation}" workingdir="test\" commandline="Calc.exe /xml:TestResults.xml /nologo" /&gt; &lt;/target&gt; &lt;target name="install" depends="testProgram"&gt; &lt;echo message="Installing the boolean calculator to ${InstallationDir}"/&gt; &lt;copy todir="${InstallationDir}" overwrite="true"&gt; &lt;fileset basedir="test\"&gt; &lt;include name="Calc.exe" /&gt; &lt;/fileset&gt; &lt;/copy&gt; &lt;/target&gt; &lt;target name="execute" depends="install"&gt; &lt;echo message="Executing the calculator in ${InstallationDir}"/&gt; &lt;exec program="${InstallationDir}\Calc.exe" commandline="Calc.exe" /&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>I took the advice and stuffed the Nunit file into workingdir and then create a complete path by using the combine and get-current-directory() to get its exact location.</p> <p>If you see anything wrong with this script, or something that could be improved please let me know. And thanks to calavera for explaining what I was confused about (didn't know I could do that) and thanks to Tim Robinson and Mark Simpson for the solution.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload