-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
executable file
·197 lines (165 loc) · 7.62 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
<!-- Build contactrees.-->
<project basedir="." default="build_jar_all_contactrees" name="BUILD_contactrees">
<description>
Build contactrees.
JUnit test is available for this build.
$Id: build_contactrees.xml $
</description>
<!-- set global properties for this build -->
<property name="srccontactrees" location="./src" />
<property name="buildcontactrees" location="./build" />
<property name="libcontactrees" location="./lib" />
<property name="release_dir" value="release" />
<property name="addon_dir" value="${release_dir}/add-on" />
<property name="templates_dir" location="./fxtemplates" />
<property name="distcontactrees" location="./dist" />
<property name="beast2path" location="../beast2" />
<property name="srcBeast2" location="${beast2path}/src" />
<property name="beast2classpath" location="${beast2path}/build" />
<property name="beastfxclasspath" location="../BeastFX/build" />
<property name="feastclasspath" location="../feast/build" />
<import file="${beast2path}/build.xml" />
<property name="main_class_BEAST" value="beast.app.BeastMCMC" />
<property name="report" value="${buildcontactrees}/junitreport"/>
<path id="classpath">
<pathelement path="${buildcontactrees}"/>
<fileset dir="${libcontactrees}" includes="guava-23.0.jar"/>
<fileset dir="${beast2path}/lib" includes="beagle.jar"/>
<fileset dir="${beast2path}/lib" includes="colt.jar"/>
<fileset dir="${beast2path}/lib" includes="antlr-runtime-4.10.1.jar"/>
<fileset dir="${beast2path}/lib" includes="commons-math3-3.6.1.jar"/>
<fileset dir="${beast2path}/lib/junit" includes="junit-platform-console-standalone-1.8.2.jar"/>
<pathelement path="${beast2classpath}"/>
<pathelement path="${beastfxclasspath}"/>
<pathelement path="${feastclasspath}"/>
</path>
<!-- start -->
<target name="initcontactrees">
<echo message="${ant.project.name}: ${ant.file}" />
<available file="./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="./version.xml" prefix="fromVersionFile" />
<property name="ContacTreesVersion" value="${fromVersionFile.package(version)}" />
</target>
<target name="cleancontactrees">
<delete dir="${buildcontactrees}" />
</target>
<!-- clean previous build, and then compile Java source code, and Juint test -->
<target name="build_all_contactrees" depends="cleancontactrees,compile-all-contactrees"
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_contactrees" depends="cleancontactrees,compile-all-contactrees,dist_all_contactrees"
description="Clean and Build all run-time stuff">
</target>
<!-- No JUnit Test, clean previous build, compile Java source code, and make the contactrees.jar and beauti.jar -->
<target name="build_jar_all_contactrees_NoJUnitTest" depends="cleancontactrees,compile-all-contactrees,dist_all_contactrees"
description="Clean and Build all run-time stuff">
</target>
<!-- compile Java source code -->
<target name="compile-all-contactrees" depends="initcontactrees,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="${buildcontactrees}" />
<!-- Compile the java code from ${srccontactrees} into ${buildcontactrees} /bin -->
<javac srcdir="${srccontactrees}" destdir="${buildcontactrees}" classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="1024m"
includeantruntime="false"
source="1.8"
target="1.8">
<include name="contactrees/**/**" />
<!-- compile JUnit test classes -->
<include name="test/beast/**" />
</javac>
<echo message="Successfully compiled." />
</target>
<!-- make the contactrees.hjar -->
<target name="dist_all_contactrees" depends="compile-all-contactrees" description="create contactrees jar">
<!-- Create the distribution directory -->
<mkdir dir="${distcontactrees}" />
<!-- Put everything in ${buildcontactrees} into the beast.jar file -->
<jar jarfile="${distcontactrees}/contactrees.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main_class_BEAST}" />
</manifest>
<fileset dir="${buildcontactrees}">
<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="${beast2path}/lib" includes="jam.jar" />
<zipgroupfileset dir="${beast2path}/lib" includes="beagle.jar" />
<zipgroupfileset dir="${beast2path}/lib" includes="colt.jar" />
<zipgroupfileset dir="${beast2path}/lib" includes="commons-math3-3.1.1.jar" />
<zipgroupfileset dir="${beast2path}/lib" includes="antlr-runtime-4.7.jar"/>
<zipgroupfileset dir="${libcontactrees}" includes="guava-23.0.jar"/>
</jar>
<jar jarfile="${distcontactrees}/contactrees.src.jar">
<fileset dir="${srccontactrees}">
<include name="**/*.java" />
<include name="**/*.png" />
</fileset>
</jar>
<jar jarfile="${distcontactrees}/contactrees.addon.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildcontactrees}">
<include name="**/*.class" />
<exclude name="contactrees/test/**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>
<!-- run beast.jar -->
<target name="run_contactrees">
<java jar="${distcontactrees}/contactrees.jar" fork="true" />
</target>
<target name="addon"
depends="build_jar_all_contactrees_NoJUnitTest"
description="release BEAST 2 add-on version of contacTrees">
<delete dir="${addon_dir}" />
<!-- Create the release directory -->
<mkdir dir="${addon_dir}" />
<mkdir dir="${addon_dir}/lib" />
<mkdir dir="${addon_dir}/examples" />
<mkdir dir="${addon_dir}/fxtemplates" />
<copy todir="${addon_dir}">
<fileset file="version.xml"/>
</copy>
<copy todir="${addon_dir}/examples">
<fileset dir="examples" includes="bantu*.xml"/>
<fileset dir="examples" includes="contactrees_example_v2.xml"/>
</copy>
<mkdir dir="${templates_dir}" />
<copy todir="${addon_dir}/fxtemplates">
<fileset dir="${templates_dir}" includes="*.xml" />
</copy>
<copy todir="${addon_dir}/lib">
<fileset file="${libcontactrees}/guava-23.0.jar" />
<fileset file="${distcontactrees}/contactrees.addon.jar" />
</copy>
<copy todir="${addon_dir}">
<fileset file="${distcontactrees}/contactrees.src.jar" />
</copy>
<jar jarfile="${distcontactrees}/contactrees.addon.v${ContacTreesVersion}.zip">
<fileset dir="${addon_dir}">
<include name="**/*" />
</fileset>
</jar>
<echo message="Add-on version v${ContacTreesVersion}release is finished." />
</target>
</project>