<?xml version="1.0"?>
<project name="NUnitFramework" default="build" basedir=".">

  <patternset id="source-files">
        <include name="AsyncSynchronizationContext.cs" if="${runtime.version >= '2.0'}"/>
        <include name="AsyncInvocationRegion.cs" if="${runtime.version >= '2.0'}"/>
        <include name="Attributes/CategoryAttribute.cs"/>
        <include name="Attributes/DatapointAttributes.cs"/>
        <include name="Attributes/DescriptionAttribute.cs"/>
        <include name="Attributes/ExpectedExceptionAttribute.cs"/>
        <include name="Attributes/ExplicitAttribute.cs"/>
        <include name="Attributes/IgnoreAttribute.cs"/>
        <include name="Attributes/IncludeExcludeAttributes.cs"/>
        <include name="Attributes/JoinTypeAttributes.cs"/>
        <include name="Attributes/MaxTimeAttribute.cs"/>
        <include name="Attributes/PropertyAttribute.cs"/>
        <include name="Attributes/RandomAttribute.cs"/>
        <include name="Attributes/RangeAttribute.cs"/>
        <include name="Attributes/RepeatAttribute.cs"/>
        <include name="Attributes/RequiredAddinAttribute.cs"/>
        <include name="Attributes/SetCultureAttribute.cs"/>
        <include name="Attributes/SetUICultureAttribute.cs"/>
        <include name="Attributes/SetUpAttribute.cs"/>
        <include name="Attributes/SetUpFixtureAttribute.cs"/>
        <include name="Attributes/SuiteAttribute.cs"/>
        <include name="Attributes/TearDownAttribute.cs"/>
        <include name="Attributes/TestActionAttribute.cs"/>
        <include name="Attributes/TestAttribute.cs"/>
        <include name="Attributes/TestCaseAttribute.cs"/>
        <include name="Attributes/TestCaseSourceAttribute.cs"/>
        <include name="Attributes/TestFixtureAttribute.cs"/>
        <include name="Attributes/TestFixtureSetUpAttribute.cs"/>
        <include name="Attributes/TestFixtureTearDownAttribute.cs"/>
        <include name="Attributes/TheoryAttribute.cs"/>
        <include name="Attributes/ThreadingAttributes.cs"/>
        <include name="Attributes/ValuesAttribute.cs"/>
        <include name="Attributes/ValueSourceAttribute.cs"/>
        <include name="Constraints/*.cs"/>
        <include name="Constraints/Operators/*.cs"/>
        <include name="Exceptions/AssertionException.cs"/>
        <include name="Exceptions/IgnoreException.cs"/>
        <include name="Exceptions/InconclusiveException.cs"/>
        <include name="Exceptions/SuccessException.cs"/>
        <include name="Interfaces/INUnitEqualityComparer.cs"/>
        <include name="Interfaces/ITestAction.cs" />
        <include name="ActionTargets.cs" />
        <include name="AssemblyInfo.cs"/>
        <include name="Assert.cs"/>
        <include name="AssertionHelper.cs"/>
        <include name="Assume.cs"/>
        <include name="CollectionAssert.cs"/>
        <include name="Contains.cs"/>
        <include name="DirectoryAssert.cs"/>
        <include name="FileAssert.cs"/>
        <include name="GlobalSettings.cs"/>
        <include name="Guard.cs"/>
        <include name="Has.cs"/>
        <include name="IExpectException.cs"/>
        <include name="Is.cs"/>
        <include name="Iz.cs"/>
        <include name="ITestCaseData.cs"/>
        <include name="List.cs"/>
        <include name="ListMapper.cs"/>
        <include name="Randomizer.cs"/>
        <include name="SpecialValue.cs"/>
        <include name="StringAssert.cs"/>
        <include name="TestCaseData.cs"/>
        <include name="TestContext.cs"/>
        <include name="TestDetails.cs"/>
        <include name="TestState.cs"/>
        <include name="TestStatus.cs"/>
        <include name="Text.cs"/>
        <include name="TextMessageWriter.cs"/>
        <include name="Throws.cs"/>
  </patternset>

  <target name="build">

    <csc target="library"
        output="${current.framework.dir}/nunit.framework.dll"
        doc="${current.framework.dir}/nunit.framework.xml"
        debug="${build.debug}" 
        define="${build.defines}">
      <nowarn>
        <warning number="618,672"/>
        <warning number="1699" if="${runtime.version>='2.0'}"/>
      </nowarn>
      <sources basedir=".">
        <patternset refid="source-files"/>
        <include name="../../GeneratedAssemblyInfo.cs" />
      </sources>
    </csc>

    <!-- Needed locally by some NUnit tests -->
    <copy file="${current.framework.dir}/nunit.framework.dll"
      todir="${current.test.dir}"/>

    <!-- Needed in base dir by pnunit tests -->
    <copy file="${current.framework.dir}/nunit.framework.dll"
      todir="${current.build.dir}"/>

  </target>

  <target name="package">
    <copy todir="${package.src.dir}/NUnitFramework/framework">
      <fileset>
        <patternset refid="source-files"/>
        <include name="nunit.framework.build"/>
        <include name="nunit.framework.dll.csproj"/>
        <include name="SyntaxElements.txt"/>
      </fileset>
    </copy>
  </target>

</project>