-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
364 lines (297 loc) · 13.2 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<!-- Build ORC. It is also used by Hudson ORC project. JUnit test is available for this build. -->
<project basedir="." default="build_jar_all_ORC" name="BUILD_ORC">
<description>
Build ORC.
JUnit test is available for this build.
$Id: build_ORC.xml $
</description>
<!-- set global properties for this build -->
<property name="versionORC" value="1.2.0" />
<property name="srcORC" location="src" />
<property name="docORC" location="doc" />
<property name="buildORC" location="build" />
<property name="libORC" location="lib" />
<property name="release_dir" value="release" />
<property name="distORC" location="${buildORC}/dist" />
<property name="beast2path" location="../beast2"/>
<property name="libBeast2" location="${beast2path}/lib" />
<property name="srcBeast2" location="${beast2path}/src" />
<property name="beast2classpath" location="${beast2path}/build" />
<property name="Add_on_dir" value="${release_dir}/add-on" />
<import file="${beast2path}/build.xml" />
<property name="main_class_CladeAge" value="beast.app.ca.ORCPanel" />
<property name="report" value="${buildORC}/junitreport"/>
<path id="classpath">
<pathelement path="${buildORC}"/>
<fileset dir="${libBeast2}" includes="junit/junit-platform-console-standalone-1.8.2.jar"/>
<fileset dir="${libBeast2}" includes="jam.jar"/>
<fileset dir="${libBeast2}" includes="commons-math3-3.6.1.jar"/>
<pathelement path="${beast2classpath}"/>
<fileset dir="${beast2path}/lib" includes="jam.jar"/>
<fileset dir="${beast2path}/lib" includes="beagle.jar"/>
<fileset dir="${beast2path}/lib" includes="fest.jar"/>
<fileset dir="${beast2path}/lib" includes="colt.jar"/>
<pathelement path="../BeastFX/build"/>
</path>
<!-- start -->
<target name="initORC">
<echo message="${ant.project.name}: ${ant.file}" />
</target>
<target name="cleanORC">
<delete dir="${buildORC}" />
</target>
<!-- clean previous build, and then compile Java source code, and Juint test -->
<target name="build_all_ORC" depends="cleanORC,compile-allORC,junitORC"
description="Clean and Build all run-time stuff">
</target>
<!-- clean previous build, compile Java source code, and Junit test, and make the beast.jar and beauti.jar -->
<target name="build_jar_all_ORC" depends="cleanORC,compile-allORC,junitORC,dist_all_ORC"
description="Clean and Build all run-time stuff">
</target>
<!-- No JUnit Test, clean previous build, compile Java source code, and make the ORC.jar and beauti.jar -->
<target name="build_jar_all_ORC_NoJUnitTest" depends="cleanORC,compile-allORC,dist_all_ORC"
description="Clean and Build all run-time stuff">
</target>
<!-- compile Java source code -->
<target name="compile-allORC" depends="initORC,compile-all">
<!-- Capture the path as a delimited property using the refid attribute -->
<property name="myclasspath" refid="classpath"/>
<!-- Emit the property to the ant console -->
<echo message="Classpath = ${myclasspath}"/>
<mkdir dir="${buildORC}" />
<!-- Compile the java code from ${srcORC} into ${buildORC} /bin -->
<javac srcdir="${srcORC}" destdir="${buildORC}" classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="256m"
source="1.8"
target="1.8">
<include name="**/**" />
<!-- compile JUnit test classes -->
<include name="test/beast/**" />
</javac>
<copy todir="${buildORC}">
<fileset dir="${srcORC}" includes="**/*.png" />
</copy>
<echo message="Successfully compiled." />
</target>
<!-- make the beast.jar and beauti.jar -->
<target name="dist_all_ORC" depends="compile-allORC" description="create ORC jar">
<!-- Create the distribution directory -->
<mkdir dir="${distORC}" />
<!-- Put everything in ${buildORC} into the beast.jar file -->
<jar jarfile="${distORC}/ORC.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main_class_CladeAge}" />
</manifest>
<fileset dir="${buildORC}">
<include name="**/*.class" />
<include name="**/*.png" />
</fileset>
<fileset dir="${beast2classpath}">
<include name="**/*.class" />
<include name="**/*.properties" />
<include name="**/*.png" />
</fileset>
<zipgroupfileset dir="${libBeast2}" includes="jam.jar" />
<zipgroupfileset dir="${libBeast2}" includes="beagle.jar" />
<zipgroupfileset dir="${libBeast2}" includes="colt.jar" />
<zipgroupfileset dir="${libBeast2}" includes="commons-math3-3.1.1.jar" />
<zipgroupfileset dir="${libBeast2}" includes="antlr-runtime-4.7.jar" />
</jar>
<jar jarfile="${distORC}/ORC.src.jar">
<fileset dir="${srcORC}">
<include name="**/*.java" />
<include name="**/*.png" />
<include name="**/*.xsl" />
</fileset>
</jar>
<jar jarfile="${distORC}/ORC.addon.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildORC}">
<include name="**/*.png" />
<include name="**/*.class" />
<include name="**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>
<!-- run beast.jar -->
<target name="run_ORC">
<java jar="${distORC}/ORC.jar" fork="true" />
</target>
<!-- JUnit test -->
<target name="junitORC">
<mkdir dir="${report}" />
<junit printsummary="yes"> <!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${buildORC}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${srcORC}">
<include name="test/**/*Test.java"/>
</fileset>
<fileset dir="${srcBeast2}">
<include name="test/beast/integration/**/*Test.java"/>
<exclude name="test/beast/integration/**/ResumeTest.java"/>
</fileset>
</batchtest>
</junit>
<echo message="JUnit test finished." />
</target>
<target name="junitreport">
<junitreport todir="${report}">
<fileset dir="${report}" includes="*.xml"/>
<report format="frames" todir="${report}"/>
</junitreport>
<echo message="JUnit test report finished." />
</target>
<target name="addon"
depends="build_jar_all_ORC_NoJUnitTest"
description="release BEAST 2 add-on version of ORC">
<delete dir="${Add_on_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Add_on_dir}" />
<mkdir dir="${Add_on_dir}/lib" />
<mkdir dir="${Add_on_dir}/doc" />
<mkdir dir="${Add_on_dir}/examples" />
<mkdir dir="${Add_on_dir}/fxtemplates" />
<copy todir="${Add_on_dir}">
<fileset file="version.xml"/>
</copy>
<copy todir="${Add_on_dir}/examples">
<fileset dir="examples" />
</copy>
<!--
<copy todir="${Add_on_dir}/doc">
<fileset dir="doc" includes="ORC.pdf"/>
</copy>
-->
<copy todir="${Add_on_dir}/lib">
<fileset dir="${distORC}" includes="ORC.addon.jar" />
</copy>
<copy todir="${Add_on_dir}">
<fileset dir="${distORC}" includes="ORC.src.jar" />
</copy>
<copy todir="${Add_on_dir}/fxtemplates">
<fileset file="fxtemplates/*.xml" />
</copy>
<jar jarfile="${distORC}/ORC.addon.v${versionORC}.zip">
<fileset dir="${Add_on_dir}">
<include name="**/*" />
</fileset>
</jar>
<echo message="Add-on version v${versionORC} release is finished." />
</target>
<!-- Release -->
<property name="version" value="1.0.0" />
<property name="version_number" value="${versionORC}" />
<property name="release_dirORC" value="release" />
<property name="copyright" value="CladeAge development team 2013" />
<property name="CladeAge_name" value="CladeAge" />
<property name="common_dirORC" value="${release_dirORC}/common" />
<property name="Mac_dirORC" value="${release_dirORC}/Mac" />
<property name="Linux_dirORC" value="${release_dirORC}/Linux" />
<property name="Windows_dirORC" value="${release_dirORC}/Windows" />
<property name="Mac_package_dirORC" value="${Mac_dirORC}/${CladeAge_name}" />
<property name="Linux_package_dirORC" value="${Linux_dirORC}/${CladeAge_name}" />
<property name="Windows_package_dirORC" value="${Windows_dirORC}/${CladeAge_name}" />
<!-- Need to either install Launch4j under {CladeAge workspace}/${release}
or install it in the default directory and change the location of launch4j.dir -->
<target name="windows"
depends="build_jar_all_ORC_NoJUnitTest"
description="release Windows version of CladeAge">
<delete dir="${Windows_package_dirORC}" />
<!-- Create the release directory -->
<mkdir dir="${Windows_package_dirORC}" />
<property name="launch4j.dir" location="../../launch4j" />
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar :${launch4j.dir}/lib/xstream.jar" />
<copy file="${distORC}/ORC.src.jar" todir="${Windows_package_dirORC}/lib" />
<copy file="${common_dirORC}/VERSION HISTORY.txt" todir="${Windows_package_dirORC}" />
<copy file="${common_dirORC}/README.txt" todir="${Windows_package_dirORC}" />
<copy file="${common_dirORC}/LICENSE.txt" todir="${Windows_package_dirORC}" />
<!-- CladeAge v?.?.?.exe -->
<launch4j configFile="${Windows_dirORC}/CladeAge_launch4j.xml"
jar="${distORC}/ORC.jar"
outfile="${Windows_package_dirORC}/${CladeAge_name}.exe"
fileVersion="${version_number}.0"
txtFileVersion="${versionORC}"
productVersion="${version_number}.0"
txtProductVersion="${versionORC}" />
<copy todir="${Windows_package_dirORC}/fxtemplates/">
<fileset dir="fxtemplates/" />
</copy>
<zip destfile="${Windows_dirORC}/${CladeAge_name} v${versionORC}.zip">
<zipfileset dir="${Windows_package_dirORC}" prefix="${CladeAge_name}" />
</zip>
<echo message="Windows version release is finished." />
</target>
<target name="linux"
depends="build_jar_all_ORC_NoJUnitTest"
description="release Linux/Unix version of CladeAge">
<delete dir="${Linux_package_dirORC}" />
<!-- Create the release directory -->
<mkdir dir="${Linux_package_dirORC}" />
<copy todir="${Linux_package_dirORC}/bin">
<fileset dir="${Linux_dirORC}/bin" />
</copy>
<chmod dir="${Linux_package_dirORC}/bin" perm="755" includes="**/**" />
<copy file="${distORC}/ORC.jar" todir="${Linux_package_dirORC}/lib" />
<copy file="${distORC}/ORC.src.jar" todir="${Linux_package_dirORC}/lib" />
<copy file="${common_dirORC}/icons/ORC.png" todir="${Linux_package_dirORC}/images" />
<copy file="${common_dirORC}/VERSION HISTORY.txt" todir="${Linux_package_dirORC}" />
<copy file="${common_dirORC}/README.txt" todir="${Linux_package_dirORC}" />
<copy file="${common_dirORC}/LICENSE.txt" todir="${Linux_package_dirORC}" />
<echo message="Have to tar manaully, because [ANT Bug 550] the tar task change the mode of the executables files." />
<echo message="Linux/Unix version release is finished." />
</target>
<property name="jarbundler_dir" value="/Applications/eclipse/plugins/org.apache.ant_1.8.3.v201301120609/lib" />
<target name="mac"
depends="build_jar_all_ORC_NoJUnitTest"
description="release Mac version of CladeAge">
<delete dir="${Mac_package_dirORC}" />
<delete file="${Mac_dirORC}/pack.temp.dmg"/>
<delete file="${Mac_dirORC}/CladeAge v${versionORC}.dmg"/>
<!-- Create the release directory -->
<mkdir dir="${Mac_package_dirORC}" />
<copy todir="${Mac_package_dirORC}/bin">
<fileset dir="${Linux_dirORC}/bin" />
</copy>
<chmod dir="${Mac_package_dirORC}/bin" perm="755" includes="**/**" />
<copy file="${distORC}/ORC.jar" todir="${Mac_package_dirORC}/lib" />
<copy file="${distORC}/ORC.src.jar" todir="${Mac_package_dirORC}/lib" />
<copy file="${common_dirORC}/VERSION HISTORY.txt" todir="${Mac_package_dirORC}" />
<copy file="${common_dirORC}/README.txt" todir="${Mac_package_dirORC}" />
<copy file="${common_dirORC}/LICENSE.txt" todir="${Mac_package_dirORC}" />
<taskdef name="jarbundler"
classname="net.sourceforge.jarbundler.JarBundler"
classpath="${jarbundler_dir}/jarbundler-2.2.0.jar" />
<!-- create a jar bundle for the mac -->
<jarbundler dir="${Mac_package_dirORC}"
name="${CladeAge_name}"
mainclass="${main_class_CladeAge}"
icon="${common_dirORC}/icons/ORC.icns"
jvmversion="1.8+"
vmoptions="-Xmx1024M"
arguments="-window -working -options"
version="${versionORC}"
infostring="${CladeAge_name}, ${copyright}"
bundleid="${main_class_CladeAge}">
<jarfileset dir="${Mac_package_dirORC}/lib">
<include name="**/ORC.jar" />
</jarfileset>
<javaproperty name="apple.laf.useScreenMenuBar" value="true" />
<javaproperty name="java.library.path" value="$JAVAROOT:/usr/local/lib" />
</jarbundler>
<echo message="Building disk image." />
<exec executable='release/Mac/createdmg.sh'/>
<echo message="Mac version release is finished." />
</target>
</project>