1 <?xml version="1.0"?> 2 <project name="ANTLR C# Runtime Library" default="build"> 3 <tstamp/> 4 <property name="base.dir" value="${path::get-full-path( project::get-base-directory() )}" /> 5 6 <include buildfile="../../antlr3.runtime.net.common.inc" /> 7 8 <property name="antlr3.runtime.test" value="true" unless="${property::exists('antlr3.runtime.test')}" /> 9 <property name="enabletest" value="ALLOWTEST" unless="${property::exists('enabletest')}" /> 10 11 <property name="name" value="Antlr3.Runtime" /> 12 <property name="test.name" value="${name}.Tests" /> 13 14 <property name="assembly.name" value="${name}.dll" /> 15 <property name="test.assembly.name" value="${test.name}.exe" /> 16 17 <property name="src.dir" value="${base.dir}/" /> 18 <property name="test.src.dir" value="${base.dir}/../Antlr3.Runtime.Tests" /> 19 20 <property name="debug" value="true" unless="${property::exists('debug')}" /> 21 22 <echo message="Building project: '${name}' version ${version} ==> '${assembly.name}'"/> 23 24 <target name="build" depends="init, compile, test" description="compiles the source code"> 25 </target> 26 27 <target name="init" depends="clean, copy_build_dependencies"> 28 <mkdir dir="${build.working.dir}/tests" /> 29 </target> 30 31 <target name="copy_build_dependencies"> 32 <!-- Copy Antlr3.Runtime.Tests dependencies --> 33 <copy todir="${build.working.dir}" overwrite="true"> 34 <fileset basedir="${sharedlibrary.dir}/MbUnit"> 35 <include name="MbUnit.Framework.dll" /> 36 <include name="QuickGraph.Algorithms.dll" /> 37 <include name="QuickGraph.dll" /> 38 </fileset> 39 </copy> 40 <copy todir="${build.working.dir}" overwrite="true"> 41 <fileset basedir="${sharedlibrary.dir}/StringTemplate.NET/${target.clr}"> 42 <include name="StringTemplate.dll" /> 43 <include name="antlr.runtime.dll" /> 44 </fileset> 45 </copy> 46 </target> 47 48 <target name="clean"> 49 </target> 50 51 <target name="clean.vsnet" description="cleans up VS.NET build artifacts and output"> 52 <!-- delete VS.NET project artifacts directory --> 53 <echo message="Deleting VS.NET artifacts directory '${base.dir}/bin'" /> 54 <delete dir="${base.dir}/bin" failonerror="false" /> 55 <echo message="Deleting VS.NET artifacts directory '${base.dir}/obj'" /> 56 <delete dir="${base.dir}/obj" failonerror="false" /> 57 58 <!-- delete VS.NET project artifacts directory for Tests projects--> 59 <echo message="Deleting VS.NET artifacts directory '${base.dir}/../Antlr3.Runtime.Tests/bin'" /> 60 <delete dir="${base.dir}/../Antlr3.Runtime.Tests/bin" failonerror="false" /> 61 <echo message="Deleting VS.NET artifacts directory '${base.dir}/../Antlr3.Runtime.Tests/obj'" /> 62 <delete dir="${base.dir}/../Antlr3.Runtime.Tests/obj" failonerror="false" /> 63 </target> 64 65 <target name="test" depends="tests.run" if="${antlr3.runtime.test}"> 66 </target> 67 68 <target name="tests.run" depends="tests.compile"> 69 <loadtasks assembly="${sharedlibrary.dir}/MbUnit/MbUnit.Tasks.dll" /> 70 <mbunit 71 report-types="Html" 72 report-filename-format="antlr3-runtime-report-{0}-{1}" 73 report-output-directory="${build.working.dir}" 74 halt-on-failure="true" 75 > 76 <assemblies> 77 <include name="${build.working.dir}/${test.assembly.name}" /> 78 </assemblies> 79 </mbunit> 80 </target> 81 82 <target name="compile" depends="init"> 83 <csc 84 define="${strong_name};${dotnet_define}" 85 target="library" 86 debug="${debug}" 87 optimize="${optimize}" 88 output="${build.working.dir}/${assembly.name}" 89 doc="${build.working.dir}/${name}.xml"> 90 91 <nowarn> 92 <warning number="1591" /> 93 <warning number="1572" /> 94 </nowarn> 95 96 <sources basedir="${src.dir}" defaultexcludes="true"> 97 <include name="**/*.cs" /> 98 <exclude name="**/*.Designer.cs" 99 if="${framework::get-target-framework()=='net-1.1' or framework::get-target-framework()=='mono-1.0'}" 100 /> 101 </sources> 102 103 <references> 104 <!-- <include name="${build.working.dir}/antlr.runtime.dll" /> --> 105 </references> 106 </csc> 107 </target> 108 109 <target name="tests.compile" depends="init"> 110 <csc 111 define="${dotnet_define}" 112 target="exe" 113 debug="${debug}" 114 output="${build.working.dir}/${test.assembly.name}"> 115 116 <sources basedir="${test.src.dir}" defaultexcludes="true"> 117 <include name="**/*.cs" /> 118 <exclude name="**/*.Designer.cs" 119 if="${framework::get-target-framework()=='net-1.1' or framework::get-target-framework()=='mono-1.0'}" 120 /> 121 </sources> 122 123 <references> 124 <include name="${build.working.dir}/${assembly.name}" /> 125 <include name="${build.working.dir}/MbUnit.Framework.dll" /> 126 <include name="${build.working.dir}/QuickGraph.Algorithms.dll" /> 127 <include name="${build.working.dir}/QuickGraph.dll" /> 128 </references> 129 </csc> 130 </target> 131 132 </project> 133