<?xml version="1.0"?>
<project name="NUnit-Console" default="build">

  <patternset id="source-files">
        <include name="AssemblyInfo.cs"/>
        <include name="Class1.cs"/>
  </patternset>

  <target name="build">
    <csc target="exe" 
        output="${current.build.dir}/nunit-console.exe"
        debug="${build.debug}" define="${build.defines}">
      <sources>
        <patternset refid="source-files"/>
	  <include name="../../GeneratedAssemblyInfo.cs"/>
      </sources>
      <references basedir="${current.lib.dir}">
        <include name="nunit.core.dll"/>
        <include name="nunit.util.dll"/>
        <include name="nunit-console-runner.dll"/>
      </references>
    </csc>

    <copy file="App.config" if="${runtime.version >= '2.0'}"
      tofile="${current.build.dir}/nunit-console.exe.config"/>
    <copy file="App.v1.config" unless="${runtime.version >= '2.0'}"
      tofile="${current.build.dir}/nunit-console.exe.config"/>

    <csc target="exe" 
        output="${current.build.dir}/nunit-console-x86.exe"
        debug="${build.debug}" define="${build.defines}"
        platform="x86" if="${runtime.version >= '2.0'}">
      <sources>
        <patternset refid="source-files"/>
        <include name="../../GeneratedAssemblyInfo.cs"/>
      </sources>
      <references basedir="${current.lib.dir}">
        <include name="nunit.core.dll"/>
        <include name="nunit.util.dll"/>
        <include name="nunit-console-runner.dll"/>
      </references>
    </csc>

    <copy file="App.config" if="${runtime.version >= '2.0'}"
      tofile="${current.build.dir}/nunit-console-x86.exe.config"/>
  </target>

  <target name="package">
    <copy todir="${package.src.dir}/ConsoleRunner/nunit-console-exe">
      <fileset>
        <patternset refid="source-files"/>
        <include name="App.config"/>
        <include name="App.v1.config"/>
        <include name="App.ico"/>
        <include name="nunit-console.exe.csproj"/>
        <include name="nunit-console.exe.build"/>
      </fileset>
    </copy>
  </target>

</project>
