Move
[mono.git] / mcs / class / Mono.Cecil / default.build
1 <?xml version="1.0"?>
2 <project name="Cecil" default="cecil" basedir=".">
3
4     <property name="debug" value="false" />
5         <property name="optimize" value="true" />
6     <property name="build.dir" value="bin" />
7         <property name="keyfile" value="../../mcs/class/mono.snk" />
8
9         <!-- allow properties to be customized in external file" -->
10         <include buildfile="build.properties" if="${file::exists('build.properties')}" />
11
12     <fileset id="all-files">
13         <include name="./**/*.cs" />
14         <exclude name="CodeGen/**/*.*" />
15     </fileset>
16
17     <target name="clean">
18         <foreach item="Folder" property="f">
19             <in>
20                 <items>
21                     <include name="**/bin" />
22                     <include name="**/obj" />
23                     <include name="${build.dir}" />
24                 </items>
25             </in>
26             <do>
27                 <delete dir="${f}" failonerror="false"/>
28             </do>
29         </foreach>
30     </target>
31
32     <target name="init">
33         <mkdir dir="${build.dir}" />
34     </target>
35
36     <target name="cecil" depends="init">
37         <csc output="${build.dir}/Mono.Cecil.dll"
38              target="library" debug="${debug}" unsafe="false" optimize="${optimize}" keyfile="${keyfile}">
39             <sources refid="all-files"/>
40         </csc>
41     </target>
42
43         <target name="compactframework" depends="init" description="compiles cecil to run on the CompactFramework 1.0">
44                 <property name="compactframework.defines" value="CF_1_0" />
45                 <property name="compactframework.dir" value="${compactframework.v1.dir}" />
46                 <call target="compactframework-compilation" />
47         </target>
48
49         <target name="compactframework2" depends="init" description="compiles cecil to run on the CompactFramework 2.0">
50                 <property name="compactframework.defines" value="CF_2_0" />
51                 <property name="compactframework.dir" value="${compactframework.v2.dir}" />
52                 <call target="compactframework-compilation" />
53         </target>
54
55         <target name="compactframework-compilation">
56                 <csc output="${build.dir}/Mono.Cecil.dll"
57                         target="library" debug="${debug}" unsafe="false" optimize="${optimize}"
58                         noconfig="true" nostdlib="true" keyfile="${keyfile}"
59                         define="${compactframework.defines}">
60                         <sources refid="all-files" />
61
62                         <references basedir="${compactframework.dir}">
63                                 <include name="mscorlib.dll" />
64                                 <include name="System.dll" />
65                         </references>
66                 </csc>
67         </target>
68
69     <target name="codegen">
70         <exec program="ruby" commandline="cecil-gen.rb" workingdir="CodeGen" />
71     </target>
72
73 </project>