-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
306 lines (264 loc) · 11.5 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
<!-- Build Babel. It is also used by Hudson Babel project. JUnit test is available for this build. -->
<project basedir="." default="package" name="BUILD_Babel">
<description>
Build Babel.
Also used by Hudson Babel project.
JUnit test is available for this build.
$Id: build_Babel.xml $
</description>
<!-- set global properties for this build -->
<property name="Babeldir" location="../Babel" />
<property name="srcBabel" location="${Babeldir}/src" />
<property name="buildBabel" location="${Babeldir}/build" />
<property name="libBabel" location="${Babeldir}/lib" />
<property name="release_dir" value="release" />
<property name="distBabel" location="${buildBabel}/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="beastappclasspath" location="../BeastFX/build" />
<property name="BEASTLabsclasspath" location="../BEASTLabs/build" />
<property name="Package_dir" value="${release_dir}/add-on" />
<import file="${beast2path}/build.xml" />
<property name="main_class_BEAST" value="beast.app.BeastMCMC" />
<property name="report" value="${buildBabel}/junitreport"/>
<path id="classpath">
<pathelement path="${buildBabel}"/>
<fileset dir="${libBeast2}/junit" includes="junit-platform-console-standalone-1.8.2.jar"/>
<fileset dir="${libBeast2}" includes="beagle.jar"/>
<fileset dir="${libBabel}" includes="itextpdf-5.5.9.jar"/>
<fileset dir="${libBeast2}" includes="antlr-runtime-4.10.1.jar"/>
<fileset dir="${libBeast2}" includes="beagle.jar"/>
<fileset dir="${libBeast2}" includes="colt.jar"/>
<fileset dir="${libBeast2}" includes="jam.jar"/>
<fileset dir="../BEASTLabs/lib" includes="nashorn-core-15.3.jar"/>
<pathelement path="${beast2classpath}"/>
<pathelement path="${beastappclasspath}"/>
<pathelement path="${BEASTLabsclasspath}"/>
</path>
<!-- start -->
<target name="initBabel">
<echo message="${ant.project.name}: ${ant.file}" />
<available file="${Babeldir}/version.xml" property="versionAvailable"/>
<fail unless="versionAvailable">
** Required file version.xml does not exist. **
</fail>
<!-- Read package name and version from xml file -->
<xmlproperty file="${Babeldir}/version.xml" prefix="fromVersionFile" />
<property name="projName" value="${fromVersionFile.package(name)}" />
<property name="Babelversion" value="${fromVersionFile.package(version)}" />
</target>
<target name="cleanBabel">
<delete dir="${buildBabel}" />
</target>
<!-- clean previous build, and then compile Java source code, and Juint test -->
<target name="build_all_Babel" depends="cleanBabel,compile-allBabel,junitBabel"
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_Babel" depends="cleanBabel,compile-allBabel,junitBabel,dist_all_Babel"
description="Clean and Build all run-time stuff">
</target>
<!-- No JUnit Test, clean previous build, compile Java source code, and make the Babel.jar and beauti.jar -->
<target name="build_jar_all_Babel_NoJUnitTest" depends="cleanBabel,compile-allBabel,dist_all_Babel"
description="Clean and Build all run-time stuff">
</target>
<!-- compile Java source code -->
<target name="compile-allBabel" depends="initBabel,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="${buildBabel}" />
<!-- Compile the java code from ${srcBabel} into ${buildBabel} /bin -->
<javac srcdir="${srcBabel}" destdir="${buildBabel}" classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="256m">
<include name="beast/**/**" />
<include name="babel/**/**" />
<!-- compile JUnit test classes -->
<include name="test/babel/**" />
</javac>
<echo message="Successfully compiled." />
</target>
<!-- make the beast.jar and beauti.jar -->
<target name="dist_all_Babel" depends="compile-allBabel" description="create Babel jar">
<!-- Create the distribution directory -->
<mkdir dir="${distBabel}" />
<jar jarfile="${distBabel}/stree.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="babel.spanningtrees.Panel" />
</manifest>
<fileset dir="${buildBabel}">
<include name="babel/spanningtrees/*.class" />
</fileset>
<zipgroupfileset dir="${libBeast2}" includes="itextpdf-5.5.9.jar" />
</jar>
<!-- Put everything in ${buildBabel} into the beast.jar file -->
<jar jarfile="${distBabel}/Babel.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main_class_BEAST}" />
</manifest>
<fileset dir="${buildBabel}">
<include name="babel/**/*.class" />
</fileset>
<fileset dir="${beast2classpath}">
<include name="beast/**/*.class" />
<include name="beast/**/*.properties" />
<include name="**/*.png" />
<include name="beagle/**/*.class" />
<include name="org/**/*.class" />
</fileset>
<fileset dir="${BEASTLabsclasspath}">
<include name="**/*.class" />
</fileset>
<zipgroupfileset dir="${libBeast2}" includes="beagle.jar"/>
<zipgroupfileset dir="${libBabel}" includes="itextpdf-5.5.9.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="antlr-runtime-4.7.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="beagle.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="colt.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="jam.jar"/>
</jar>
<jar jarfile="${distBabel}/Babel.src.jar">
<fileset dir="${srcBabel}">
<include name="**/*.java" />
<include name="**/*.png" />
</fileset>
</jar>
<jar jarfile="${distBabel}/Babel.package.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildBabel}">
<include name="**/*.class" />
<include name="**/*.png" />
<include name="**/*.properties" />
</fileset>
<fileset dir="${srcBabel}">
<include name="**/*.png" />
</fileset>
</jar>
</target>
<target name="DolloAnnotator" depends="compile-allBabel" description="create DolloAnnotator.jar">
<!-- Create the distribution directory -->
<mkdir dir="${distBabel}" />
<!-- Put everything in ${buildBabel} into the beast.jar file -->
<jar jarfile="${distBabel}/DolloAnnotator.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="babel.tools.DolloAnnotator" />
</manifest>
<fileset dir="${buildBabel}">
<include name="babel/**/*.class" />
</fileset>
<fileset dir="${beast2classpath}">
<include name="beast/**/*.class" />
<include name="beast/**/*.properties" />
<include name="**/*.png" />
<include name="beagle/**/*.class" />
<include name="org/**/*.class" />
</fileset>
<fileset dir="${BEASTLabsclasspath}">
<include name="**/*.class" />
</fileset>
<zipgroupfileset dir="${libBeast2}" includes="beagle.jar"/>
<zipgroupfileset dir="${libBabel}" includes="itextpdf-5.5.9.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="antlr-runtime-4.7.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="beagle.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="colt.jar"/>
<zipgroupfileset dir="${libBeast2}" includes="jam.jar"/>
</jar>
</target>
<!-- run beast.jar -->
<target name="run_Babel">
<java jar="${distBabel}/Babel.jar" fork="true" />
</target>
<!-- JUnit test -->
<target name="junitBabel">
<mkdir dir="${report}" />
<junit printsummary="yes"> <!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${buildBabel}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${srcBabel}">
<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="package"
depends="build_jar_all_Babel_NoJUnitTest"
description="release BEAST 2 add-on version of Babel">
<delete dir="${Package_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Package_dir}" />
<mkdir dir="${Package_dir}/lib" />
<mkdir dir="${Package_dir}/examples" />
<mkdir dir="${Package_dir}/fxtemplates" />
<copy todir="${Package_dir}">
<fileset file="version.xml"/>
</copy>
<copy todir="${Package_dir}/examples">
<fileset dir="examples" />
</copy>
<copy todir="${Package_dir}/fxtemplates">
<fileset dir="fxtemplates" />
</copy>
<copy todir="${Package_dir}/lib">
<fileset dir="${distBabel}" includes="Babel.package.jar" />
</copy>
<copy todir="${Package_dir}/lib">
<fileset dir="${libBabel}" includes="itextpdf-5.5.9.jar" />
</copy>
<copy todir="${Package_dir}">
<fileset dir="${distBabel}" includes="Babel.src.jar" />
</copy>
<copy todir="${Package_dir}/fxtemplates">
<fileset dir="fxtemplates">
<include name="*.xml"/>
</fileset>
</copy>
<jar jarfile="${distBabel}/Babel.package.v${Babelversion}.zip">
<fileset dir="${Package_dir}">
<include name="**/*" />
</fileset>
</jar>
<echo message="Add-on version v${Babelversion} release is finished." />
</target>
<condition property="isWindows"><os family="windows" /></condition>
<condition property="isLinux"><and><os family="unix"/><not><os family="mac"/></not></and></condition>
<condition property="isMac"><os family="mac" /></condition>
<target name="installLinux" depends="package" if="isLinux">
<mkdir dir="${user.home}/.beast/2.7/${projName}"/>
<unzip src="${distBabel}/Babel.package.v${Babelversion}.zip" dest="${user.home}/.beast/2.7/${projName}"/>
</target>
<target name="installMac" depends="package" if="isMac">
<mkdir dir="${user.home}/.beast/2.7/${projName}"/>
<unzip src="${distBabel}/Babel.package.v${Babelversion}.zip" dest="${user.home}/Library/Application Support/BEAST/2.7/${projName}"/>
</target>
<target name="installWindows" depends="package" if="isWindows">
<mkdir dir="${user.home}/BEAST/2.7/${projName}"/>
<unzip src="${distBabel}/Babel.package.v${Babelversion}.zip" dest="${user.home}/BEAST/2.7/${projName}"/>
</target>
<target name="install" depends="installWindows,installMac,installLinux">
</target>
</project>