-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
354 lines (293 loc) · 11.9 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
<project name="DensiTree" default="dist" basedir=".">
<description>
DensiTree build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name="dist" location="dist"/>
<property name="report" value="build/junitreport" />
<property name="version" value="2.2.3" />
<property name="release_dir" value="release" />
<property name="Windows_dir" value="${release_dir}/Windows" />
<property name="Mac_dir" value="${release_dir}/Mac" />
<property name="common_dir" value="${release_dir}/common" />
<property name="Linux_dir" value="${release_dir}/Linux" />
<property name="tools_dir" value="${common_dir}/tools" />
<property name="DensiTree_name" value="DensiTree" />
<property name="Mac_package_dir" value="${Mac_dir}/${DensiTree_name}" />
<property name="Linux_package_dir" value="${Linux_dir}/${DensiTree_name}" />
<property name="Windows_package_dir" value="${Windows_dir}/${DensiTree_name}" />
<path id="classpath">
<pathelement path="build"/>
<fileset dir="lib" includes="jam.jar"/>
<fileset dir="lib" includes="itextpdf-5.2.1.jar"/>
<fileset dir="lib" includes="itext-xtra-5.2.1.jar"/>
<fileset dir="lib" includes="osx.jar"/>
</path>
<path id="compileclasspath">
<pathelement path="build"/>
<fileset dir="lib" includes="jam.jar"/>
<fileset dir="lib" includes="itextpdf-5.2.1.jar"/>
<fileset dir="lib" includes="itext-xtra-5.2.1.jar"/>
<fileset dir="lib" includes="debug-1.0.jar"/>
<fileset dir="lib" includes="fest-assert-1.1.jar"/>
<fileset dir="lib" includes="fest-reflect-1.1.jar"/>
<fileset dir="lib" includes="fest-swing-1.2a3.jar"/>
<fileset dir="lib" includes="fest-swing-junit-1.2a3.jar"/>
<fileset dir="lib" includes="fest-swing-junit-4.5-1.2a3.jar"/>
<fileset dir="lib" includes="fest-util-1.1.jar"/>
<fileset dir="lib" includes="jcip-annotations-1.0.jar"/>
<fileset dir="lib" includes="junit-4.8.2.jar"/>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<!--javac srcdir="${src}" destdir="${build}" excludes="**/geo/**/*"/-->
<javac srcdir="${src}" destdir="${build}" classpathref="compileclasspath" includeantruntime="false"
source="1.8"
target="1.8">
<!--
bootclasspath='/opt/jdk1.7/jre/lib/rt.jar'
-->
<!--
<compilerarg value="-Xlint:deprecation"/>
-->
</javac>
<copy todir="${build}/viz/icons">
<resources>
<fileset dir="${src}/viz/icons/"/>
</resources>
</copy>
<copy todir="${build}/viz/graphics" file="${src}/viz/graphics/JFontChooserMessages.properties"/>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put source files together -->
<delete dir="${build}/lib/DensiTree.src.jar"/>
<jar jarfile="${dist}/lib/DensiTree.src.jar" basedir="${src}">
<exclude name="**/C/**/*"/>
<exclude name="**/tst/**/*"/>
<exclude name="**/*class"/>
<exclude name="**/geo/**/*"/>
<exclude name="**/geo*/**/*"/>
<exclude name="**/weka/**/*"/>
<exclude name="**/viz/DensiTreeS*"/>
<exclude name="**/viz/DensiTreeG*"/>
<exclude name="**/.git/**/*"/>
</jar>
<!-- Put everything in ${build} into the DensiTree.jar file -->
<jar jarfile="${dist}/lib/DensiTree.jar" basedir="${build}">
<zipgroupfileset dir="lib" includes="itextpdf-5.2.1.jar" />
<zipgroupfileset dir="lib" includes="itext-xtra-5.2.1.jar" />
<zipgroupfileset dir="lib" includes="jam.jar" />
<!--exclude name="**/weka/gui/**/*"/-->
<exclude name="**/C/**/*"/>
<exclude name="**/weka/**/*"/>
<exclude name="**/tst/**/*"/>
<exclude name="**/geo/**/*"/>
<exclude name="**/geo*/**/*"/>
<exclude name="**/viz/DensiTreeS*"/>
<exclude name="**/viz/DensiTreeG*"/>
<manifest>
<attribute name="Main-Class" value="viz.DensiTree"/>
</manifest>
</jar>
</target>
<!-- testing beauti gui-->
<target name="junit" depends="compile">
<mkdir dir="${report}" />
<junit printsummary="yes" failureproperty="junitfailed"
showoutput='yes' >
<classpath>
<path refid="compileclasspath" />
<path location="${build}" />
</classpath>
<formatter type="plain" usefile="false" />
<!--formatter type="xml" /-->
<batchtest fork="yes" todir="${report}">
<fileset dir="${src}">
<include name="test/**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<echo message="JUnit test finished." />
<fail if="junitfailed" message="One or more DensiTree tests failed."/>
</target>
<target name="all" depends="clean,dist,junit"/>
<target name="distS" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put source files together -->
<delete dir="${build}/lib/DensiTreeS.src.jar"/>
<jar jarfile="${dist}/lib/DensiTreeS.src.jar" basedir="${src}">
<exclude name="**/C/**/*"/>
<exclude name="**/tst/**/*"/>
<exclude name="**/*class"/>
<exclude name="**/geo/**/*"/>
<exclude name="**/geo*/**/*"/>
<exclude name="**/weka/**/*"/>
<exclude name="**/viz/DensiTreeG*"/>
<exclude name="**/.git/**/*"/>
</jar>
<!-- Put everything in ${build} into the DensiTree.jar file -->
<jar jarfile="${dist}/lib/DensiTreeS.jar" basedir="${build}">
<!--exclude name="**/weka/gui/**/*"/-->
<exclude name="**/C/**/*"/>
<exclude name="**/weka/**/*"/>
<exclude name="**/tst/**/*"/>
<exclude name="**/geo/**/*"/>
<exclude name="**/geo*/**/*"/>
<exclude name="**/viz/DensiTreeG*"/>
<exclude name="**/viz/maconly/*"/>
<manifest>
<attribute name="Main-Class" value="viz.DensiTreeS"/>
</manifest>
</jar>
</target>
<target name="approx" depends="compile"
description="generate the distribution to do geo experiments" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the DensiTree.jar file -->
<jar jarfile="${dist}/lib/approx.jar" basedir="${build}">
<!--exclude name="**/weka/gui/**/*"/-->
<exclude name="**/C/**/*"/>
<exclude name="**/weka/**/*"/>
<exclude name="**/tst/**/*"/>
<exclude name="**/viz/DensiTreeS*"/>
<exclude name="**/viz/DensiTreeG*"/>
<exclude name="**/viz/maconly/*"/>
<zipgroupfileset dir="${lib}" includes="beast.jar" />
<manifest>
<attribute name="Main-Class" value="beast.app.BeastMCMC"/>
</manifest>
</jar>
</target>
<target name="geo" depends="compile"
description="generate the distribution to do geo visualization" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the DensiTree.jar file -->
<jar jarfile="${dist}/lib/geodraw.jar" basedir="${build}">
<!--exclude name="**/weka/gui/**/*"/-->
<exclude name="**/C/**/*"/>
<!--exclude name="**/weka/**/*"/-->
<exclude name="**/tst/**/*"/>
<exclude name="**/viz/DensiTreeS*"/>
<exclude name="**/viz/DensiTreeG*"/>
<exclude name="**/viz/maconly/*"/>
<manifest>
<attribute name="Main-Class" value="geo.draw.GeoDrawer"/>
</manifest>
</jar>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="osxlib" depends="compile"
description="generate the OSX Adapter library containing Mac-only stuff" >
<!-- first compile maconly/src/viz/maconly/OSXAdepter.java to build directory -->
<!-- TODO: add ant task for this -->
<jar jarfile="lib/osx.jar" basedir="${build}">
<!--exclude name="**/weka/gui/**/*"/-->
<exclude name="**/C/**/*"/>
<exclude name="**/test/**/*"/>
<exclude name="**/viz/*"/>
<exclude name="**/viz/graphics/*"/>
<exclude name="**/viz/icons/*"/>
<exclude name="**/viz/panel/*"/>
<exclude name="**/viz/process/*"/>
<exclude name="**/viz/util/*"/>
</jar>
</target>
<!-- Need to either install Launch4j under {DensiTree workspace}/${release}
or install it in the default directory and change the location of launch4j.dir -->
<target name="windows"
depends="dist"
description="release Windows version of DensiTree">
<delete dir="${Windows_package_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Windows_package_dir}" />
<property name="launch4j.dir" location="${Windows_dir}/launch4j" />
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar :${launch4j.dir}/lib/xstream.jar" />
<launch4j configFile="${tools_dir}/DensiTree_launch4j.xml"
jar="${dist}/lib/DensiTree.jar"
outfile="${Windows_package_dir}/DensiTree.exe"
fileVersion="${version}.0"
txtFileVersion="${version}.0"
productVersion="${version}.0"
txtProductVersion="${version}.0" />
<copy file="${common_dir}/doc/DensiTreeManual.pdf" todir="${Windows_package_dir}" />
<copy file="${common_dir}/LICENSE.txt" todir="${Windows_package_dir}" />
<copy file="${common_dir}/README.txt" todir="${Windows_package_dir}" />
<zip destfile="${Windows_dir}/${DensiTree_name} v${version}.zip">
<zipfileset dir="${Windows_package_dir}" prefix="${DensiTree_name}" />
</zip>
<echo message="Windows version release is finished." />
</target>
<property name="jarbundler_dir" value="/Applications/eclipse/plugins/org.apache.ant_1.8.2.v20110505-1300/lib" />
<target name="mac"
depends="dist"
description="release Mac version of DensiTree">
<delete dir="${Mac_package_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Mac_package_dir}" />
<copy todir="${Mac_package_dir}/bin">
<fileset dir="${Linux_dir}/bin" />
</copy>
<chmod dir="${Mac_package_dir}/bin" perm="755" includes="**/**" />
<copy file="${dist}/lib/DensiTree.jar" todir="${Mac_package_dir}/lib" />
<copy file="${common_dir}/doc/DensiTreeManual.pdf" todir="${Mac_package_dir}" />
<copy file="${common_dir}/LICENSE.txt" todir="${Mac_package_dir}" />
<copy file="${common_dir}/README.txt" todir="${Mac_package_dir}" />
<taskdef name="jarbundler"
classname="net.sourceforge.jarbundler.JarBundler"
classpath="${jarbundler_dir}/jarbundler-2.2.0.jar" />
<jarbundler dir="${Mac_package_dir}"
name="DensiTree"
mainclass="viz.DensiTree"
icon="${tools_dir}/DensiTree.icns"
jvmversion="1.7+"
vmoptions="-Xmx3g"
arguments=""
version="${version}"
infostring="DensiTree, http://compevol.auckland.ac.nz/software/DensiTree/"
bundleid="viz.DensiTree">
<jarfileset dir="${Mac_package_dir}">
<include name="**/DensiTree.jar" />
</jarfileset>
<javaproperty name="apple.laf.useScreenMenuBar" value="true" />
<javaproperty name="java.library.path" value="$JAVAROOT/lib" />
</jarbundler>
<echo message="Building disk image." />
<!-- create disk image -->
<exec executable="/usr/bin/hdiutil">
<arg value="create" />
<arg value="-ov" />
<arg value="-srcfolder" />
<arg value="${Mac_package_dir}" />
<arg value="-volname" />
<arg value="${DensiTree_name}" />
<arg value="-imagekey" />
<arg value="zlib-level=6" />
<arg value="${Mac_dir}/${DensiTree_name} v${version}.dmg" />
</exec>
<echo message="Mac version release is finished." />
</target>
</project>