2 <project name="Cecil" default="cecil" basedir=".">
4 <property name="debug" value="false" />
5 <property name="optimize" value="true" />
6 <property name="build.dir" value="${path::get-full-path('bin')}" />
7 <property name="keyfile" value="../mono.snk" />
8 <property name="csc.defines" value="NO_DEFINE" />
10 <!-- allow properties to be customized in external file" -->
11 <include buildfile="build.properties" if="${file::exists('build.properties')}" />
13 <fileset id="all-files">
14 <include name="./**/*.cs" />
15 <exclude name="CodeGen/**/*.*" />
19 <delete failonerror="false">
21 <include name="**/bin/**" />
22 <include name="**/obj/**" />
23 <include name="${build.dir}/**" />
29 <mkdir dir="${build.dir}" />
32 <target name="cecil" depends="init">
33 <csc output="${build.dir}/Mono.Cecil.dll"
34 target="library" debug="${debug}"
35 unsafe="false" optimize="${optimize}"
37 define="${csc.defines}">
38 <sources refid="all-files"/>
42 <target name="compactframework" depends="init" description="compiles cecil to run on the CompactFramework 1.0">
43 <property name="compactframework.defines" value="CF_1_0;${csc.defines}" />
44 <property name="compactframework.dir" value="${compactframework.v1.dir}" />
45 <call target="compactframework-compilation" />
48 <target name="compactframework2" depends="init" description="compiles cecil to run on the CompactFramework 2.0">
49 <property name="compactframework.defines" value="CF_2_0;${csc.defines}" />
50 <property name="compactframework.dir" value="${compactframework.v2.dir}" />
51 <call target="compactframework-compilation" />
54 <target name="compactframework-compilation">
55 <property name="temp.dir" value="${path::combine(path::get-temp-path(), 'cecil')}" />
56 <delete dir="${temp.dir}" if="${directory::exists(temp.dir)}" />
57 <mkdir dir="${temp.dir}" />
59 <property name="framework.dir" value="${framework::get-framework-directory(framework::get-target-framework())}" />
60 <property name="csc.exe" value="${path::combine(framework.dir, 'csc.exe')}" />
62 <copy todir="${temp.dir}">
63 <fileset refid="all-files" />
66 <exec program="${csc.exe}" workingdir="${temp.dir}" failonerror="true">
67 <arg value="/optimize" />
68 <arg value="/debug-" />
69 <arg value="/define:${compactframework.defines}" />
70 <arg value="/out:${build.dir}/Mono.Cecil.dll" />
71 <arg value="/target:library" />
72 <arg value="/warn:0" />
73 <arg value="/noconfig" />
74 <arg value="/nostdlib+" />
75 <arg value="/reference:${compactframework.dir}/mscorlib.dll" />
76 <arg value="/reference:${compactframework.dir}/System.dll" />
77 <arg value="/recurse:*.cs" />
81 <target name="codegen">
82 <exec program="ruby" commandline="cecil-gen.rb" workingdir="CodeGen" />