-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
295 lines (259 loc) · 11.3 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
<!-- Build BEAST_CLASSIC. It is also used by Hudson BEAST_CLASSIC project. JUnit test is available for this build. -->
<project basedir="." default="build_jar_all_BEAST_CLASSIC" name="BUILD_BEAST_CLASSIC">
<description>
Build BEAST_CLASSIC.
Also used by Hudson BEAST_CLASSIC project.
JUnit test is available for this build.
$Id: build_BEAST_CLASSIC.xml $
</description>
<!-- set global properties for this build -->
<property name="BEAST_CLASSICdir" location="../beast-classic/" />
<property name="srcBEAST_CLASSIC" location="${BEAST_CLASSICdir}/src" />
<property name="buildBEAST_CLASSIC" location="${BEAST_CLASSICdir}/build" />
<property name="libBEAST_CLASSIC" location="${BEAST_CLASSICdir}/lib" />
<property name="release_dir" value="${BEAST_CLASSICdir}/release" />
<property name="distBEAST_CLASSIC" location="${buildBEAST_CLASSIC}/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="beastappdir" location="../BeastFX/" />
<property name="beastappclasspath" location="${beastappdir}/build" />
<property name="beastapplib" location="${beastappdir}/locallib" />
<property name="Add_on_dir" value="${release_dir}/add-on" />
<import file="${beast2path}/build.xml" />
<property name="main_class_BEAST" value="beast.app.BeastMCMC" />
<property name="report" value="${buildBEAST_CLASSIC}/junitreport"/>
<path id="classpath">
<pathelement path="${buildBEAST_CLASSIC}"/>
<fileset dir="${libBeast2}/junit" includes="junit-platform-console-standalone-1.8.2.jar"/>
<fileset dir="${libBEAST_CLASSIC}" includes="mtj.jar"/>
<fileset dir="${libBeast2}" includes="beagle.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="commons-math3-3.6.1.jar"/>
<fileset dir="${beastapplib}" includes="testfx.jar"/>
<pathelement path="${beast2classpath}"/>
<pathelement path="${beastappclasspath}"/>
</path>
<!-- start -->
<target name="initBEAST_CLASSIC">
<echo message="${ant.project.name}: ${ant.file}" />
<available file="${BEAST_CLASSICdir}/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="${BEAST_CLASSICdir}/version.xml" prefix="fromVersionFile" />
<property name="BEAST_CLASSICversion" value="${fromVersionFile.package(version)}" />
</target>
<target name="cleanBEAST_CLASSIC">
<delete dir="${buildBEAST_CLASSIC}" />
</target>
<!-- clean previous build, and then compile Java source code, and Juint test -->
<target name="build_all_BEAST_CLASSIC" depends="cleanBEAST_CLASSIC,compile-allBEAST_CLASSIC,junitBEAST_CLASSIC"
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_BEAST_CLASSIC" depends="cleanBEAST_CLASSIC,compile-allBEAST_CLASSIC,junitBEAST_CLASSIC,dist_all_BEAST_CLASSIC"
description="Clean and Build all run-time stuff">
</target>
<!-- No JUnit Test, clean previous build, compile Java source code, and make the BEAST_CLASSIC.jar and beauti.jar -->
<target name="build_jar_all_BEAST_CLASSIC_NoJUnitTest" depends="cleanBEAST_CLASSIC,compile-allBEAST_CLASSIC,dist_all_BEAST_CLASSIC"
description="Clean and Build all run-time stuff">
</target>
<!-- compile Java source code -->
<target name="compile-allBEAST_CLASSIC" depends="initBEAST_CLASSIC,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="${buildBEAST_CLASSIC}" />
<!-- Compile the java code from ${srcBEAST_CLASSIC} into ${buildBEAST_CLASSIC} /bin -->
<javac srcdir="${srcBEAST_CLASSIC}" destdir="${buildBEAST_CLASSIC}" classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="256m"
>
<include name="beastclassic/**/**" />
<!-- compile JUnit test classes -->
<!--
<include name="test/**" />
-->
</javac>
<echo message="Successfully compiled." />
</target>
<!-- make the beast.jar and beauti.jar -->
<target name="dist_all_BEAST_CLASSIC" depends="compile-allBEAST_CLASSIC" description="create BEAST_CLASSIC jar">
<!-- Create the distribution directory -->
<mkdir dir="${distBEAST_CLASSIC}" />
<!-- Put everything in ${buildBEAST_CLASSIC} into the beast.jar file -->
<jar jarfile="${distBEAST_CLASSIC}/BEAST_CLASSIC.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main_class_BEAST}" />
</manifest>
<fileset dir="${buildBEAST_CLASSIC}">
<include name="**/*.class" />
</fileset>
<fileset dir="${beast2classpath}">
<include name="beast/**/*.class" />
<include name="beast/**/*.properties" />
<include name="beast/**/*.png" />
<include name="beagle/**/*.class" />
<include name="org/**/*.class" />
</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="${libBEAST_CLASSIC}" includes="mtj.jar"/>
</jar>
<jar jarfile="${distBEAST_CLASSIC}/BEAST_CLASSIC.src.jar">
<fileset dir="${srcBEAST_CLASSIC}">
<include name="beastclassic/**/*.java" />
<include name="test/**/*.java" />
<include name="beast/**/*.png" />
<include name="beast/**/*.xsl" />
</fileset>
</jar>
<jar jarfile="${distBEAST_CLASSIC}/BEAST_CLASSIC.package.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildBEAST_CLASSIC}">
<include name="beastclassic/**/*.class" />
<include name="test/**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>
<!-- run beast.jar -->
<target name="run_BEAST_CLASSIC">
<java jar="${distBEAST_CLASSIC}/BEAST_CLASSIC.jar" fork="true" />
</target>
<!-- JUnit test -->
<target name="junitBEAST_CLASSIC">
<mkdir dir="${report}" />
<junit printsummary="yes"> <!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${buildBEAST_CLASSIC}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${srcBEAST_CLASSIC}">
<include name="test/**/*Test.java"/>
<!--exclude name="test/**/beauti/*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="package"/>
<target name="package"
depends="build_jar_all_BEAST_CLASSIC_NoJUnitTest"
description="release BEAST 2 add-on version of BEAST_CLASSIC">
<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}/examples" />
<mkdir dir="${Add_on_dir}/examples/nexus" />
<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" includes="*.xml"/>
</copy>
<copy todir="${Add_on_dir}/examples/nexus">
<fileset dir="examples/nexus" includes="*"/>
</copy>
<copy todir="${Add_on_dir}/lib">
<fileset dir="${libBEAST_CLASSIC}" includes="mtj.jar"/>
<fileset dir="${distBEAST_CLASSIC}" includes="BEAST_CLASSIC.package.jar" />
</copy>
<copy todir="${Add_on_dir}">
<fileset dir="${distBEAST_CLASSIC}" includes="BEAST_CLASSIC.src.jar" />
</copy>
<copy todir="${Add_on_dir}/fxtemplates">
<fileset file="fxtemplates/discrete-trait.xml" />
<fileset file="fxtemplates/ClassicSubtseModels.xml" />
<fileset file="fxtemplates/ClassicTreePriors.xml" />
<fileset file="fxtemplates/RelaxedClockModels.xml" />
<fileset file="fxtemplates/StarBeast.xml" />
</copy>
<jar jarfile="${distBEAST_CLASSIC}/BEAST_CLASSIC.package.v${BEAST_CLASSICversion}.zip">
<fileset dir="${Add_on_dir}">
<include name="**/*" />
</fileset>
</jar>
<echo message="Add-on version v${BEAST_CLASSICversion} release is finished." />
</target>
<target name="tutorial">
<!-- generate images -->
<junit printsummary="yes">
<classpath>
<path refid="classpath" />
<path location="${buildBEAST_CLASSIC}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${srcBEAST_CLASSIC}">
<include name="test/**/beauti/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="tutorial2">
<!-- generate discrete phylogeography AR.pdf -->
<exec executable="sh" dir="doc/tutorial/phylogeography_discrete">
<arg value='-c'/>
<arg value='pdflatex AR.tex'/>
</exec>
<exec executable="sh" dir="doc/tutorial/phylogeography_discrete">
<arg value='-c'/>
<arg value='bibtex AR.aux'/>
</exec>
<exec executable="sh" dir="doc/tutorial/phylogeography_discrete">
<arg value='-c'/>
<arg value='pdflatex AR.tex'/>
</exec>
<exec executable="sh" dir="doc/tutorial/phylogeography_discrete">
<arg value='-c'/>
<arg value='pdflatex AR.tex'/>
</exec>
<!-- generate continuous phylogeography phylogeography_s.pdf -->
<exec executable="sh" dir="doc/tutorial/phylogeography_continuous">
<arg value='-c'/>
<arg value='pdflatex phylogeography_c.tex'/>
</exec>
<exec executable="sh" dir="doc/tutorial/phylogeography_continuous">
<arg value='-c'/>
<arg value='bibtex phylogeography_c.aux'/>
</exec>
<exec executable="sh" dir="doc/tutorial/phylogeography_continuous">
<arg value='-c'/>
<arg value='pdflatex phylogeography_c.tex'/>
</exec>
<exec executable="sh" dir="doc/tutorial/phylogeography_continuous">
<arg value='-c'/>
<arg value='pdflatex phylogeography_c.tex'/>
</exec>
</target>
</project>