-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
210 lines (179 loc) · 8.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
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
<!-- Build MODEL_SELECTION. It is also used by Hudson MODEL_SELECTION project. JUnit test is available for this build. -->
<project basedir="." default="package" name="BUILD_MODEL_SELECTION">
<description>
Build MODEL_SELECTION.
Also used by Hudson MODEL_SELECTION project.
JUnit test is available for this build.
$Id: build_MODEL_SELECTION.xml $
</description>
<!-- set global properties for this build -->
<property name="MODEL_SELECTIONdir" location="../model-selection/" />
<property name="beast2path" location="../beast2" />
<property name="srcMODEL_SELECTION" location="${MODEL_SELECTIONdir}/src" />
<property name="buildMODEL_SELECTION" location="${MODEL_SELECTIONdir}/build" />
<property name="libMODEL_SELECTION" location="${MODEL_SELECTIONdir}/lib" />
<property name="release_dir" value="${MODEL_SELECTIONdir}/release" />
<property name="distMODEL_SELECTION" location="${buildMODEL_SELECTION}/dist" />
<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="Package_dir" value="${release_dir}/package" />
<import file="${beast2path}/build.xml" />
<property name="main_class_BEAST" value="beast.app.BeastMCMC" />
<property name="report" value="${buildMODEL_SELECTION}/junitreport"/>
<path id="classpath">
<pathelement path="${buildMODEL_SELECTION}"/>
<fileset dir="${libBeast2}" includes="junit-4.8.2.jar"/>
<fileset dir="${libBeast2}" includes="jam.jar"/>
<fileset dir="${libBeast2}" includes="colt.jar"/>
<fileset dir="${libBeast2}" includes="antlr-runtime-4.7.jar"/>
<fileset dir="${libBeast2}" includes="beagle.jar"/>
<fileset dir="${libBeast2}/junit" includes="junit-platform-console-standalone-1.8.2.jar"/>
<pathelement path="${beast2classpath}"/>
<pathelement path="${beastappclasspath}"/>
</path>
<!-- start -->
<target name="initMODEL_SELECTION">
<echo message="${ant.project.name}: ${ant.file}" />
<available file="${MODEL_SELECTIONdir}/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="${MODEL_SELECTIONdir}/version.xml" prefix="fromVersionFile" />
<property name="MODEL_SELECTIONversion" value="${fromVersionFile.package(version)}" />
</target>
<target name="cleanMODEL_SELECTION">
<delete dir="${buildMODEL_SELECTION}" />
</target>
<!-- clean previous build, and then compile Java source code, and Juint test -->
<target name="build_all_MODEL_SELECTION" depends="cleanMODEL_SELECTION,compile-allMODEL_SELECTION,junitMODEL_SELECTION"
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_MODEL_SELECTION" depends="cleanMODEL_SELECTION,compile-allMODEL_SELECTION,junitMODEL_SELECTION,dist_all_MODEL_SELECTION"
description="Clean and Build all run-time stuff">
</target>
<!-- No JUnit Test, clean previous build, compile Java source code, and make the MODEL_SELECTION.jar and beauti.jar -->
<target name="build_jar_all_MODEL_SELECTION_NoJUnitTest" depends="cleanMODEL_SELECTION,compile-allMODEL_SELECTION,dist_all_MODEL_SELECTION"
description="Clean and Build all run-time stuff">
</target>
<!-- compile Java source code -->
<target name="compile-allMODEL_SELECTION" depends="initMODEL_SELECTION,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="${buildMODEL_SELECTION}" />
<!-- Compile the java code from ${srcMODEL_SELECTION} into ${buildMODEL_SELECTION} /bin -->
<javac srcdir="${srcMODEL_SELECTION}" destdir="${buildMODEL_SELECTION}" classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="256m"
source="1.8"
target="1.8">
<include name="modelselection/**/**" />
<!-- compile JUnit test classes -->
<include name="test/**" />
</javac>
<copy todir="${buildMODEL_SELECTION}">
<fileset dir="${srcMODEL_SELECTION}" includes="**/*.properties" />
<fileset dir="${srcMODEL_SELECTION}" includes="**/*.png" />
</copy>
<echo message="Successfully compiled." />
</target>
<!-- make the beast.jar and beauti.jar -->
<target name="dist_all_MODEL_SELECTION" depends="compile-allMODEL_SELECTION" description="create MODEL_SELECTION jar">
<!-- Create the distribution directory -->
<mkdir dir="${distMODEL_SELECTION}" />
<jar jarfile="${distMODEL_SELECTION}/MODEL_SELECTION.src.jar">
<fileset dir="${srcMODEL_SELECTION}">
<include name="modelselection/**/*.java" />
<include name="modelselection/**/*.png" />
<include name="modelselection/**/*.xsl" />
</fileset>
</jar>
<jar jarfile="${distMODEL_SELECTION}/MODEL_SELECTION.addon.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildMODEL_SELECTION}">
<include name="modelselection/**/*.png" />
<include name="modelselection/**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>
<!-- run beast.jar -->
<target name="run_MODEL_SELECTION">
<java jar="${distMODEL_SELECTION}/MODEL_SELECTION.jar" fork="true" />
</target>
<!-- JUnit test -->
<target name="junitMODEL_SELECTION">
<mkdir dir="${report}" />
<junit printsummary="yes"> <!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${buildMODEL_SELECTION}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${srcMODEL_SELECTION}">
<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="package"/>
<target name="package"
depends="build_jar_all_MODEL_SELECTION_NoJUnitTest"
description="release BEAST 2 add-on version of MODEL_SELECTION">
<delete dir="${Package_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Package_dir}" />
<mkdir dir="${Package_dir}/doc" />
<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}/doc">
<fileset file="doc/readme.txt"/>
</copy>
<copy todir="${Package_dir}/lib">
<fileset dir="${distMODEL_SELECTION}" includes="MODEL_SELECTION.addon.jar" />
</copy>
<copy todir="${Package_dir}">
<fileset dir="${distMODEL_SELECTION}" includes="MODEL_SELECTION.src.jar" />
</copy>
<copy todir="${Package_dir}/fxtemplates">
<fileset file="fxtemplates/ModelSelection.xml" />
<!--
<fileset file="fxtemplates/AutoPartition.xml" />
-->
</copy>
<jar jarfile="${distMODEL_SELECTION}/MODEL_SELECTION.addon.v${MODEL_SELECTIONversion}.zip">
<fileset dir="${Package_dir}">
<include name="**/*" />
</fileset>
</jar>
<echo message="Add-on version v${MODEL_SELECTIONversion} release is finished." />
</target>
</project>