-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
139 lines (123 loc) · 4.29 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<project name="jfirm" default="jar" basedir=".">
<description>jfirm release</description>
<!-- set global properties for this build -->
<property name="projectname" value="jFirm" />
<property name="version" value="1.21.0" />
<property name="src" location="${basedir}/src"/>
<property name="jar" value="jfirm.jar"/>
<property name="workdir" location="${basedir}/release"/>
<property name="releasename" value="${projectname}-${version}"/>
<property name="fullreleasedir" location="${workdir}/${releasename}"/>
<property name="releasefile" location="${workdir}/${projectname}-${version}.zip"/>
<property name="releasefile-tgz" location="${workdir}/${projectname}-${version}.tgz"/>
<property name="build" location="${basedir}/classes"/>
<property name="lib" location="${basedir}/lib"/>
<property name="make.exe" value="make"/>
<property name="bfmain" value="example.BrainFuck.Main"/>
<property name="simpleifmain" value="example.SimpleIf"/>
<condition property="buildvariant" value="${VARIANT}" else="debug">
<isset property="VARIANT"/>
</condition>
<path id="project.classpath">
<pathelement location="${basedir}/lib/jna.jar"/>
</path>
<target name="init">
<mkdir dir="${build}"/>
<available property="libfirm.exists" file="${basedir}/../libfirm"/>
</target>
<target name="build" depends="init">
<javac destdir="${build}" source="1.6" target="1.6" debug="on" includeantruntime="false">
<src path="${src}"/>
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="jar" depends="build, libfirm.so">
<jar jarfile="${build}/${jar}">
<fileset dir="${build}" excludes="${jar},examples/**"/>
</jar>
</target>
<target name="libfirm.so" depends="init" if="libfirm.exists">
<exec executable="${make.exe}" failonerror="true" dir="${basedir}/../libfirm">
<arg value="-j2"/>
<arg value="variant=${buildvariant}"/>
</exec>
<copy todir="${lib}" flatten="true">
<fileset dir="${basedir}/../libfirm">
<include name="build/${buildvariant}/libfirm.so"/>
</fileset>
</copy>
</target>
<target name="clean-libfirm.so">
<exec executable="${make.exe}" failonerror="true" dir="${basedir}/../libfirm">
<arg value="clean"/>
<arg value="variant=${buildvariant}"/>
</exec>
</target>
<target name="clean" description="clean up" depends="clean-libfirm.so">
<delete dir="${build}"/>
<delete dir="${fullreleasedir}"/>
</target>
<target name="complete_clean" description="clean up complete" depends="clean" >
<delete dir="${workdir}"/>
</target>
<target name="zip" depends="copy_stuff" description="pack everything to a zip file">
<zip destfile="${releasefile}">
<fileset dir="${workdir}">
<filename name="${releasename}/**/*" />
</fileset>
</zip>
</target>
<target name="tar" depends="copy_stuff" description="pack everything to a tgz file">
<tar destfile="${releasefile-tgz}" compression="gzip">
<fileset dir="${workdir}">
<filename name="${releasename}/**/*" />
</fileset>
</tar>
</target>
<target name="create_dirs">
<mkdir dir="${workdir}"/>
<mkdir dir="${fullreleasedir}"/>
</target>
<target name="copy_stuff" depends="create_dirs">
<copy todir="${fullreleasedir}">
<fileset dir=".">
<or>
<filename name="README"/>
<filename name="README.OSX"/>
<filename name="NEWS"/>
<filename name="build.xml"/>
<filename name="bf_examples/*.bf"/>
<filename name="lib/jna.jar"/>
<filename name="lib/libfirm.so"/>
<filename name="lib/libfirm.dylib"/>
<filename name="lib/firm.dll"/>
<filename name="lib/x86_64/libfirm.so"/>
<filename name="lib/x86_64/libfirm.dylib"/>
<filename name="src/**/*" />
</or>
</fileset>
</copy>
</target>
<target name="beertest" depends="build">
<java classname="${bfmain}">
<arg value="bf_examples/bockbeer.bf"/>
<jvmarg value="-ea"/>
<sysproperty key="jna.library.path" value="${lib}"/>
<classpath>
<path refid="project.classpath"/>
<dirset dir="${build}"/>
</classpath>
</java>
</target>
<target name="simpleif" depends="build">
<java classname="${simpleifmain}">
<jvmarg value="-ea"/>
<sysproperty key="jna.library.path" value="${lib}"/>
<classpath>
<path refid="project.classpath"/>
<dirset dir="${build}"/>
</classpath>
</java>
</target>
<target name="test" depends="beertest,simpleif"/>
</project>