-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.xml
277 lines (233 loc) · 11.4 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
<!--
~ build_tracer.xml
~
~ Copyright (C) 2002-2021 Andrew Rambaut, Marc Suchard & Alexei J. Drummond
~
~ This file is part of Tracer.
~ See the NOTICE file distributed with this work for additional
~ information regarding copyright ownership and licensing.
~
~ Tracer is free software; you can redistribute it and/or modify
~ it under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2
~ of the License, or (at your option) any later version.
~
~ Tracer is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with Tracer; if not, write to the
~ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
~ Boston, MA 02110-1301 USA
-->
<project name="Tracer_RELEASE" default="compile" basedir=".">
<description>
Build file for Tracer release versions
$Id: build_release.xml,v 1.6 2017/02/28 18:16:17 rambaut Exp $
</description>
<property name="version" value="1.7.3" />
<property name="version_number" value="1.7.3" />
<property name="release_dir" value="release" />
<property name="name" value="Tracer" />
<property name="copyright" value="Copyright 2002-2023"/>
<!-- source & lib from beast1 but build in tracer -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name="dist" location="${build}/dist"/>
<property environment="env"/>
<target name="clean">
<delete dir="${build}"/>
</target>
<target name="init" depends="clean">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" depends="init">
<!-- Compile the java code from ${src} into ${build} -->
<javac source="1.8" target="1.8" srcdir="${src}" destdir="${build}"
classpath="${lib}/trace.jar:${lib}/jam.jar:${lib}/jebl.jar:${lib}/commons-math-2.2.jar:${lib}/itext-1.4.5.jar">
<include name="tracer/**"/>
</javac>
</target>
<!--TODO trigger BEAST1 build.xml copy_trace_jar, before dist -->
<target name="dist" depends="compile"
description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Put everything in ${build} into the beast.jar file -->
<jar jarfile="${dist}/tracer.jar">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="tracer.application.TracerApp"/>
</manifest>
<fileset dir="${build}">
<include name="tracer/**/*.class"/>
</fileset>
<fileset dir="${src}">
<include name="tracer/**/*.png"/>
<include name="tracer/**/*.gif"/>
<include name="tracer/**/*.tiff"/>
<include name="org/virion/jam/**/*.png"/>
</fileset>
<zipgroupfileset dir="${lib}" includes="trace.jar"/>
<zipgroupfileset dir="${lib}" includes="jam.jar"/>
<zipgroupfileset dir="${lib}" includes="jebl.jar"/>
<zipgroupfileset dir="${lib}" includes="itext-1.4.5.jar"/>
<zipgroupfileset dir="${lib}" includes="commons-math-2.2.jar"/>
</jar>
<echo>
Application: ${name} v${version}
Built by : ${ant.file}
Run by : ${user.name}
Build Dir : ${build}
Dist Dir : ${dist}
JDK version: ${java.version}
Java Home : ${java.home}
</echo>
</target>
<!-- release folders -->
<property name="packaging_tools" value="packaging_tools" />
<property name="common_dir" value="${release_dir}/common" />
<property name="Mac_dir" value="${release_dir}/Mac" />
<property name="Linux_dir" value="${release_dir}/Linux" />
<property name="Windows_dir" value="${release_dir}/Windows" />
<property name="package_name" value="${name} v${version}" />
<property name="linux_package_name" value="${name}_v${version}" />
<property name="Mac_package_dir" value="${Mac_dir}/${package_name}" />
<property name="Linux_package_dir" value="${Linux_dir}/${linux_package_name}" />
<property name="Windows_package_dir" value="${Windows_dir}/${package_name}" />
<!-- Need to either install Launch4j under {BEAST 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 Tracer">
<!-- clean windows release-->
<delete failonerror="false" file="${release_dir}/${package_name}.zip"/>
<delete failonerror="false" dir="${Windows_package_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Windows_package_dir}" />
<property name="launch4j.dir" location="${packaging_tools}/windows/launch4j" />
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar :${launch4j.dir}/lib/xstream.jar" />
<copy file="${dist}/tracer.jar" todir="${Windows_package_dir}/lib"/>
<copy todir="${Windows_package_dir}/lib">
<fileset dir="${Windows_dir}/lib"/>
</copy>
<copy file="${common_dir}/README.txt" todir="${Windows_package_dir}"/>
<launch4j configFile="${Windows_dir}/tracer_launch4j.xml"
jar="${dist}/tracer.jar"
outfile="${Windows_package_dir}/${package_name}.exe"
fileVersion="${version_number}.0"
txtFileVersion="${version}"
productVersion="${version_number}.0"
txtProductVersion="${version}"/>
<zip destfile="${release_dir}/${package_name}.zip">
<zipfileset dir="${Windows_package_dir}" prefix="${package_name}"/>
</zip>
<echo message="Windows version release is finished." />
</target>
<target name="linux" depends="dist" description="release Linux/Unix version of Tracer">
<!-- clean linux release-->
<delete failonerror="false" file="${release_dir}/${package_name}.tgz"/>
<delete failonerror="false" dir="${Linux_package_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Linux_package_dir}" />
<copy todir="${Linux_package_dir}/bin">
<fileset dir="${Linux_dir}/scripts"/>
</copy>
<chmod dir="${Linux_package_dir}/bin" perm="755" includes="**/**"/>
<copy file="${Linux_dir}/icons/Tracer.png" todir="${Linux_package_dir}/images"/>
<copy file="${dist}/tracer.jar" todir="${Linux_package_dir}/lib"/>
<!--TODO there is no release/Linux/lib/ -->
<!--<copy todir="${Linux_package_dir}/lib">-->
<!--<fileset dir="${Linux_dir}/lib"/>-->
<!--</copy>-->
<copy file="${common_dir}/README.txt" todir="${Linux_package_dir}"/>
<tar destfile="${release_dir}/${linux_package_name}.tgz" compression="gzip">
<tarfileset dir="${Linux_package_dir}" filemode="755" includes="**/**">
<include name="bin/tracer"/>
</tarfileset>
</tar>
<echo message="Linux/Unix version release is finished." />
</target>
<!-- this will only work on Andrew's computer -->
<property name="AppleSigner" value="Developer ID Application: Andrew Rambaut (9E4WXAQ6SE)" />
<!--<property name="AppleSigner" value="Developer ID Application: Walter Xie (27V5YMX65C)" />-->
<target name="mac" depends="dist" description="release Mac version of Tracer">
<!-- clean mac release-->
<delete failonerror="false" file="${release_dir}/${package_name}.dmg"/>
<delete failonerror="false" dir="${Mac_package_dir}"/>
<!-- Create the release directory -->
<mkdir dir="${Mac_package_dir}" />
<!--<copy file="${common_dir}/README.txt" todir="${Mac_package_dir}"/>-->
<copy file="${packaging_tools}/mac/install.png" todir="${Mac_package_dir}"/>
<taskdef name="jarbundler" classname="com.ultramixer.jarbundler.JarBundler"
classpath="${packaging_tools}/mac/jarbundler-core-3.3.0.jar"/>
<!-- create a jar bundle for the mac -->
<jarbundler dir="${Mac_package_dir}"
name="${package_name}"
mainclass="tracer.application.TracerApp"
stubfile="${packaging_tools}/mac/universalJavaApplicationStub"
useJavaXKey="true"
icon="${Mac_dir}/icons/Tracer.icns"
jvmversion="1.8+"
vmoptions="-Xmx10000M"
highresolutioncapable="true"
arguments=""
version="${version}"
copyright="${package_name}, ${copyright}, Andrew Rambaut, Alexei J. Drummond, Walter Xie, Guy Baele, & Marc A. Suchard"
bundleid="tracer" >
<javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
<jarfileset dir="${dist}">
<include name="**/tracer.jar"/>
</jarfileset>
<jarfileset dir="${Mac_dir}/lib">
<include name="**/VAqua9.jar"/>
</jarfileset>
</jarbundler>
<echo message="codesign ${package_name}.app ..." />
<!-- code signing -->
<exec executable="codesign">
<arg value="--deep"/>
<arg value="-s"/>
<arg value="${AppleSigner}"/>
<arg value="-v"/>
<arg value="${Mac_package_dir}/${package_name}.app"/>
</exec>
<echo message="Building disk image." />
<exec executable='packaging_tools/mac/createdmg.sh'/>
<!-- create disk image -->
<!-- createdmg now does this...
<exec executable="/usr/bin/hdiutil">
<arg value="create"/>
<arg value="-ov"/>
<arg value="-srcfolder"/>
<arg value="${Mac_package_dir}"/>
<arg value="-volname"/>
<arg value="${package_name}"/>
<arg value="-imagekey"/>
<arg value="zlib-level=6"/>
<arg value="${release_dir}/${package_name}.dmg"/>
</exec>
-->
<exec executable="codesign">
<arg value="-s"/>
<arg value="${AppleSigner}"/>
<arg value="-v"/>
<arg value="${release_dir}/${package_name}.dmg"/>
</exec>
<echo message="Mac version release is not finished yet. Please upload ${package_name}.dmg to be notarized ! " />
<!-- example CMD, note -\- is 2 hyphens because of XML sepc :
cp Tracer\ v1.7.2.dmg ~/tmp
# notarizition
xcrun altool -\-notarize-app -f Tracer\ v1.7.2.dmg -\-primary-bundle-id Tracer -u Apple_Username -p Apple_Password
# check error or info
xcrun altool -\-notarization-info RequestUUID -u Apple_Username -p Apple_Password
-->
</target>
<target name="build" depends="mac, windows, linux" description="build all the executables" />
</project>