-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
executable file
·486 lines (433 loc) · 19.2 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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<?xml version="1.0"?>
<project name="PathVisio" default="all" basedir=".">
<property name="src.dir" value="modules"/>
<property name="debug.mode" value="true"/>
<property name="apidoc.dir" value="apidoc"/>
<property name="webstart.dir" value="webstart"/>
<property name="release.dir" value="release"/>
<property name="build.wpi.bin" value="build/wpi/bin"/>
<property name="build.wpi.applet" value="build/wpi/applet"/>
<property name="wikipathways.dest.bin" value="${wikipathways.dest}/wpi/bin"/> <!-- install dir for wikipathways utilities !-->
<property name="wikipathways.dest.applet" value="${wikipathways.dest}/wpi/applet"/> <!-- install dir for wikipathways applets !-->
<property name="svn.exec.svnversion" value="svnversion"/>
<property name="checkstyle.output.file" value="warnings.txt"/>
<property name="webstart.base.url" value="http://www.pathvisio.org/webstart"/>
<!-- needed to build zip files correctly -->
<property name="pathvisio.version" value="3.2.1"/>
<property name="lib.axis.dir" value="tools/cytoscape-gpml/lib"/>
<macrodef name="iterate">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<filelist dir=".">
<file name="modules/org.pathvisio.core/build.xml"/>
<file name="modules/org.pathvisio.gui/build.xml"/>
<file name="modules/org.pathvisio.data/build.xml"/>
<file name="modules/org.pathvisio.desktop/build.xml"/>
<file name="modules/org.pathvisio.pluginmanager/build.xml"/>
<file name="modules/org.pathvisio.launcher/build.xml"/>
<file name="modules/org.pathvisio.gex/build.xml"/>
<file name="modules/org.pathvisio.statistics/build.xml"/>
<file name="modules/org.pathvisio.visualization/build.xml"/>
<file name="modules/org.wikipathways.applet/build.xml"/>
<file name="modules/org.wikipathways.client/build.xml"/>
</filelist>
</subant>
</sequential>
</macrodef>
<target name="svnversion">
<exec executable="${svn.exec.svnversion}" outputproperty="subversion_revision" failifexecutionfails="false">
<arg line="-n ."/>
</exec>
</target>
<target name="prepare" depends="svnversion">
<mkdir dir="${apidoc.dir}"/>
<mkdir dir="${build.wpi.bin}"/>
<mkdir dir="${release.dir}" />
</target>
<target name="clean" description="Remove all intermediate files.">
<delete dir="${build.test.dir}"/>
<delete dir="${apidoc.dir}"/>
<delete dir="${webstart.dir}/www"/>
<delete dir="${build.wpi.bin}"/>
<delete dir="${build.wpi.applet}"/>
<delete dir="build/exe"/>
<iterate target="clean"/>
</target>
<target name="dist-clean" depends="clean" description="Cleaner than clean: remove all generated files">
<delete file="lib/resources.jar"/>
<delete file="${src.dir}/org.pathvisio.core/src/org/pathvisio/core/Revision.java"/>
<delete file="visplugins.jar"/>
<delete file="diffview.jar"/>
<delete file="pathvisio_core.jar"/>
<delete file="pathvisio.jar"/>
<delete file="preloader.jar"/>
<delete file="wikipathways.jar"/>
<delete file="wikipathways-client.jar"/>
<delete dir="${release.dir}" />
<delete dir="${axis.wpclient.dir}" />
<iterate target="dist-clean"/>
</target>
<target name="core.jar" depends="prepare">
<subant target="jar" buildpath="modules/org.pathvisio.core/build.xml"/>
</target>
<target name="data.jar" depends="prepare">
<subant target="jar" buildpath="modules/org.pathvisio.data/build.xml"/>
</target>
<target name="gui.jar" depends="core.jar">
<subant target="jar" buildpath="modules/org.pathvisio.gui/build.xml"/>
</target>
<target name="desktop.jar" depends="gui.jar, data.jar">
<subant target="jar" buildpath="modules/org.pathvisio.desktop/build.xml"/>
</target>
<target name="pluginmanager.jar" depends="desktop.jar">
<subant target="jar" buildpath="modules/org.pathvisio.pluginmanager/build.xml"/>
</target>
<target name="launcher.jar" depends="core.jar">
<subant target="jar" buildpath="modules/org.pathvisio.launcher/build.xml"/>
</target>
<target name="applet.jar" depends="gui.jar">
<subant target="jar" buildpath="modules/org.wikipathways.applet/build.xml"/>
</target>
<target name="wpclient.jar" depends="applet.jar">
<subant target="jar" buildpath="modules/org.wikipathways.client/build.xml"/>
</target>
<target name="visualization.jar" depends="desktop.jar">
<subant target="jar" buildpath="modules/org.pathvisio.visualization/build.xml"/>
</target>
<target name="plugin-dev" depends="plugins.jar">
<mkdir dir="plugin-dev"/>
<copy toDir="plugin-dev">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="modules">
<include name="*.jar"/>
</fileset>
</copy>
</target>
<target name="plugins.jar" depends="visualization.jar,pluginmanager.jar">
<subant target="jar" buildpath="modules/org.pathvisio.gex/build.xml"/>
<subant target="jar" buildpath="modules/org.pathvisio.statistics/build.xml"/>
</target>
<target name="exe" depends="launcher.jar,plugins.jar">
<mkdir dir="build/exe"/>
<copy toDir="build/exe">
<fileset dir="modules">
<include name="org.pathvisio.core.jar"/>
<include name="org.pathvisio.data.jar"/>
<include name="org.pathvisio.pluginmanager.jar"/>
<include name="org.pathvisio.gui.jar"/>
<include name="org.pathvisio.desktop.jar"/>
<include name="org.pathvisio.statistics.jar"/>
<include name="org.pathvisio.visualization.jar"/>
<include name="org.pathvisio.gexplugin.jar"/>
</fileset>
<fileset dir="lib">
<include name="org.apache*.jar"/>
<include name="org.w3c*.jar"/>
<!-- <include name="org.eclipse.osgi.jar"/> -->
<include name="derby.jar"/>
<include name="org.bridgedb*.jar"/>
<include name="org.pathvisio.*.jar"/>
<include name="javax.*.jar"/>
<include name="commons-math*.jar"/>
<include name="com.springsource*.jar"/>
<include name="org.apache.felix.bundlerepository-1.6.6.jar"/>
</fileset>
</copy>
<unjar src="modules/org.pathvisio.launcher.jar" dest="build/exe"/>
<!-- <unjar src="lib/org.eclipse.osgi.jar" dest="build/exe"/> -->
<unjar src="lib/felix.jar" dest="build/exe"/>
<jar file="pathvisio.jar" basedir="build/exe">
<manifest>
<attribute name="Main-Class" value="org.pathvisio.launcher.PathVisioMain"/>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Codebase" value="www.pathvisio.org"/>
<attribute name="Application-Name" value="PathVisio"/>
</manifest>
</jar>
</target>
<target name="all" depends="exe" description="Compile all versions of this project" />
<target name="prepare-webstart" depends="exe" description="prepares webstart">
<fail message="You must specify a keystore password for opening visioKeyStore: ant -Dkeystore.password=***** [ant target]">
<condition>
<not> <isset property="keystore.password"/> </not>
</condition>
</fail>
<mkdir dir="${webstart.dir}/www"/>
<!-- Update latest version file -->
<echo file="${webstart.dir}/www/latestversion">${subversion_revision}</echo>
<!-- Copy files needed for webstart !-->
<!--tsaurl="http://timestamp.comodoca.com/authenticode"-->
<signjar jar="pathvisio.jar"
alias="secure.ksoftware.net" storetype="pkcs12" storepass="${keystore.password}" keystore="../lib/visioKeyStore.p12"/>
<copy file="pathvisio.jar" toDir="${webstart.dir}/www"/>
<copy file="${webstart.dir}/pathvisio.jnlp" toDir="${webstart.dir}/www"/>
<!-- modify the base url in the jnlp-->
<replace file="webstart/www/pathvisio.jnlp" token="#BASEURL#" value="${webstart.base.url}"/>
</target>
<path id="applet.libs">
<fileset dir="lib">
<include name="org.bridgedb.jar"/>
<include name="org.bridgedb.bio.jar"/>
<include name="org.bridgedb.rdb.jar"/>
<include name="org.bridgedb.webservice.bridgerest.jar"/>
<include name="derbyclient.jar"/>
<include name="org.pathvisio.jgoodies.forms.jar"/>
<include name="org.pathvisio.xmlrpc.client.jar"/>
<include name="org.pathvisio.xmlrpc.common.jar"/>
<include name="org.pathvisio.ws.commons.util.jar"/>
<include name="com.springsource.org.jdom-1.1.0.jar"/>
</fileset>
<fileset dir="lib/apache">
<include name="*.jar"/>
</fileset>
<fileset dir="modules">
<include name="org.pathvisio.core.jar"/>
<include name="org.pathvisio.gui.jar"/>
<include name="org.wikipathways.applet.jar"/>
</fileset>
</path>
<path id="utility.libs">
<fileset dir="lib">
<include name="org.bridgedb.jar"/>
<include name="org.bridgedb.bio.jar"/>
<include name="org.bridgedb.rdb.jar"/>
<include name="org.apache.batik.*.jar"/>
<include name="org.pathvisio.pdftranscoder.jar"/>
<include name="org.apache.xalan*.jar"/>
<include name="org.apache.xerces*.jar"/>
<include name="org.apache.xml*.jar"/>
<include name="org.w3c*.jar"/>
<include name="javax.xml*.jar"/>
<include name="derbyclient.jar"/>
<include name="org.pathvisio.jgoodies.forms.jar"/>
<include name="org.pathvisio.ws.commons.util.jar"/>
<include name="org.pathvisio.xmlrpc.client.jar"/>
<include name="org.pathvisio.xmlrpc.common.jar"/>
<include name="com.springsource.org.jdom-1.1.0.jar"/>
</fileset>
</path>
<target name="prepare-wpi" depends="applet.jar" description="Prepare all applets and utilities needed by WikiPathways">
<!-- Copy converter jar with modified main class -->
<copy tofile="${build.wpi.bin}/pathvisio_color_exporter.jar"
file="modules/org.pathvisio.core.jar"/>
<copy toDir="${build.wpi.bin}/lib"><path refid="utility.libs"/></copy>
<manifestclasspath property="jar.class.path" jarfile="${build.wpi.bin}/pathvisio_color_exporter.jar">
<classpath>
<fileset dir="${build.wpi.bin}/lib"><include name="*.jar"/></fileset>
<!-- add reference to optional BioPAX converter to classpath -->
<pathelement location="${build.wpi.bin}/Biopax3GPML.jar"/>
</classpath>
</manifestclasspath>
<jar file="${build.wpi.bin}/pathvisio_color_exporter.jar" update="true">
<manifest>
<attribute name="Main-Class" value="org.pathvisio.core.util.ColorExporter"/>
<attribute name="Class-Path" value="${jar.class.path}"/>
</manifest>
</jar>
<copy tofile="${build.wpi.bin}/pathvisio_core.jar"
file="modules/org.pathvisio.core.jar"/>
<jar file="${build.wpi.bin}/pathvisio_core.jar" update="true">
<manifest>
<attribute name="Main-Class" value="org.pathvisio.core.util.Converter"/>
<attribute name="Class-Path" value="${jar.class.path}"/>
</manifest>
</jar>
<!-- Copy necessary libraries -->
<copy toDir="${build.wpi.applet}">
<fileset dir=".">
<include name="preloader.jar"/>
</fileset>
</copy>
<copy toDir="${build.wpi.applet}">
<path refid="applet.libs"/>
</copy>
<!-- Copy preloader class -->
<copy toDir="${build.wpi.applet}/org/wikipathways/applet"
file="modules/org.wikipathways.applet/build/org/wikipathways/applet/Preloader.class"/>
<!-- generate cache_archive, which will be used to determine which jars are needed for the applet -->
<pathconvert property="wikipathways.class.path"
pathsep=" ">
<path refid="applet.libs"/>
<flattenmapper/>
</pathconvert>
<echo file="${build.wpi.applet}/cache_archive" message="org.wikipathways.applet.jar ${wikipathways.class.path}" />
</target>
<target name="install-wpi" depends="prepare-wpi" description="Install applets and utilities in the WikiPathways www directory">
<fail message="You must specify a destination path for WikiPathways to run this task: ant -Dwikipathways.dest=/path/to/wikipathways [ant target]">
<condition>
<not> <isset property="wikipathways.dest"/> </not>
</condition>
</fail>
<fail message="You must specify a keystore password for opening visioKeyStore: ant -Dkeystore.password=***** [ant target]">
<condition>
<not> <isset property="keystore.password"/> </not>
</condition>
</fail>
<!-- Sign all jar files -->
<signjar alias="secure.ksoftware.net"
storetype="pkcs12" storepass="${keystore.password}" keystore="../lib/visioKeyStore.p12">
<fileset dir="${build.wpi.applet}" includes="**/*.jar"/>
<fileset dir="${build.wpi.bin}" includes="**/*.jar"/>
</signjar>
<!-- copy to /var/www/wikipathways -->
<copy toDir="${wikipathways.dest.applet}">
<fileset dir="${build.wpi.applet}" includes="**/*" />
</copy>
<copy toDir="${wikipathways.dest.bin}">
<fileset dir="${build.wpi.bin}" includes="**/*" />
</copy>
</target>
<target name="docs" depends="prepare" description="generate api-docs">
<tstamp /> <!-- set ${TODAY} -->
<javadoc destdir="${apidoc.dir}"
doctitle="PathVisio"
header="Revision ${subversion_revision}"
footer="Generated ${TODAY}">
<classpath>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</classpath>
<packageset dir="${src.dir}/org.pathvisio.core/src"/>
<packageset dir="${src.dir}/org.pathvisio.data/src"/>
<packageset dir="${src.dir}/org.pathvisio.pluginmanager/src"/>
<packageset dir="${src.dir}/org.pathvisio.gui/src"/>
<packageset dir="${src.dir}/org.pathvisio.desktop/src"/>
<packageset dir="${src.dir}/org.wikipathways.applet/src"/>
<packageset dir="${src.dir}/org.pathvisio.gex/src"/>
<packageset dir="${src.dir}/org.pathvisio.visualization/src"/>
<packageset dir="${src.dir}/org.pathvisio.statistics/src"/>
<packageset dir="${src.dir}/org.wikipathways.client/src"/>
<packageset dir="${src.dir}/org.wikipathways.client/gen-src"/>
<sourcepath>
<pathelement location="${src.dir}/org.pathvisio.core/src"/>
<pathelement location="${src.dir}/org.pathvisio.data/src"/>
<pathelement location="${src.dir}/org.pathvisio.pluginmanager/src"/>
<pathelement location="${src.dir}/org.pathvisio.gex/src"/>
<pathelement location="${src.dir}/org.pathvisio.visualization/src"/>
<pathelement location="${src.dir}/org.pathvisio.statistics/src"/>
<pathelement location="${src.dir}/org.pathvisio.gui/src"/>
<pathelement location="${src.dir}/org.pathvisio.desktop/src"/>
<pathelement location="${src.dir}/org.wikipathways.applet/src"/>
<pathelement location="${src.dir}/org.wikipathways.client/src"/>
</sourcepath>
</javadoc>
</target>
<target name="zip.src" depends="svnversion" description="create source tarball and zip">
<property name="srcbase" value="pathvisio_src-${pathvisio.version}-r${subversion_revision}"/>
<zip destfile="${release.dir}/${srcbase}.zip">
<zipfileset dir="." prefix="pathvisio-${pathvisio.version}">
<include name="modules/**/*"/>
<exclude name="modules/**/*.class"/>
<include name="lib/**/*"/>
<include name="lib-build/*.jar"/>
<include name="resources/**/*"/>
<include name="GPML.xsd"/>
<include name="LICENSE-2.0.txt"/>
<include name="NOTICE.txt"/>
<include name="readme.txt"/>
<include name="example-data/**/*"/>
<include name="testData/**/*"/>
<include name="build.xml"/>
<include name="build-common.xml"/>
<include name="pathvisio.sh"/>
<include name="pathvisio.bat"/>
</zipfileset>
</zip>
<tar destfile="${release.dir}/${srcbase}.tar.gz" compression="gzip">
<zipfileset src="${release.dir}/${srcbase}.zip"/>
</tar>
</target>
<target name="zip.bin" depends="exe" description="create binary tarball and zip">
<property name="binbase" value="pathvisio_bin-${pathvisio.version}-r${subversion_revision}"/>
<zip destfile="${release.dir}/${binbase}.zip">
<zipfileset dir="." prefix="pathvisio-${pathvisio.version}">
<include name="pathvisio.jar"/>
<include name="LICENSE-2.0.txt"/>
<include name="NOTICE.txt"/>
<include name="readme.txt"/>
<include name="pathvisio.sh"/>
<include name="pathvisio.bat"/>
</zipfileset>
</zip>
<tar destfile="${release.dir}/${binbase}.tar.gz" compression="gzip">
<zipfileset src="${release.dir}/${binbase}.zip"/>
</tar>
</target>
<target name="zip" depends="zip.src,zip.bin" description="create both source and binary tarballs and zips"/>
<target name="test" depends="desktop.jar">
<subant target="test" buildpath="modules/org.pathvisio.core/build.xml"/>
<subant target="test" buildpath="modules/org.pathvisio.desktop/build.xml"/>
</target>
<taskdef resource="checkstyletask.properties"
classpath="lib-build/checkstyle-all-5.0.jar"/>
<target name="checkstyle">
<checkstyle config="tools/dailybuild/pv_checks.xml">
<fileset dir="modules">
<include name="**/*.java"/>
<exclude name="org.wikipathways.client/gen-src/**/*.java"/>
</fileset>
<formatter toFile="${checkstyle.output.file}"/>
</checkstyle>
</target>
<target name="appbundler" depends="exe" description="Generate OS X Bundle">
<property name="app.name" value="PathVisio" />
<property name="app.icon" value="bigcateye.icns"/>
<property name="app.dir" value="${release.dir}/${app.name}.app" />
<property name="app.executableName" value="JavaApplicationStub" />
<tstamp>
<format property="year" pattern="yyyy"/>
</tstamp>
<mkdir dir="${app.dir}/Contents/Java"/>
<mkdir dir="${app.dir}/Contents/MacOS"/>
<mkdir dir="${app.dir}/Contents/Resources/en.lproj"/>
<copy todir="${app.dir}/Contents/Java" file="pathvisio.jar" />
<copy todir="${app.dir}/Contents/MacOS" file="${app.executableName}" />
<copy todir="${app.dir}/Contents/Resources" file="lib-build/${app.icon}" />
<echo message="AAPL????" file="${app.dir}/Contents/PkgInfo" />
<copy todir="${app.dir}/Contents/" file="Info.plist" overwrite="true">
<filterset>
<filter token="PV_APP_NAME" value="${app.name}" />
<filter token="PV_APP_VERSION" value="${pathvisio.version}" />
<filter token="PV_APP_SHORT_VERSION" value="${pathvisio.version}" />
<filter token="PV_APP_ICON" value="${app.icon}" />
<filter token="PV_APP_COPYRIGHT" value="2006-${year} BiGCaT Bioinformatics" />
</filterset>
</copy>
<zip destfile="${release.dir}/${app.name}.app.zip">
<zipfileset prefix="${app.name}.app" dir="${app.dir}" excludes="${app.dir}/Contents/MacOS/${app.executableName}" />
<zipfileset prefix="${app.name}.app/Contents/MacOS" file="${app.dir}/Contents/MacOS/${app.executableName}" filemode="755" />
</zip>
<delete dir="${app.dir}" />
</target>
<target name="wp-bots" depends="wpclient.jar" description="">
<subant target="wp-bots" buildpath="modules/org.wikipathways.client/build.xml"/>
</target>
<target name="tarbin-wpclient" depends="wpclient.jar" description="Create a binary tarball for the WikiPathways client">
<property name="binbase2" value="wikipathways_client_bin-${pathvisio.version}-r${subversion_revision}" />
<zip destfile="${release.dir}/${binbase2}.zip">
<zipfileset dir="." prefix="wikipathways_client-${pathvisio.version}">
<include name="modules/org.wikipathways.client.jar" />
<include name="lib/com.springsource.org.jdom-1.1.0.jar" />
<include name="lib/derby.jar" />
<include name="modules/org.pathvisio.core.jar" />
<include name="modules/org.wikipathways.applet.jar" />
<include name="${lib.axis.dir}/*.jar" />
<include name="lib/resources.jar"/>
<include name="modules/org.pathvisio.core/resources/botresult.css" />
<include name="modules/org.pathvisio.core/resources/sorttable.js" />
<include name="lib/org.bridgedb.jar"/>
<include name="lib/org.bridgedb.bio.jar"/>
<include name="lib/org.bridgedb.webservice.bridgerest.jar"/>
<include name="lib/org.bridgedb.rdb.jar"/>
</zipfileset>
</zip>
<tar destfile="${release.dir}/${binbase2}.tar.gz" compression="gzip">
<zipfileset src="${release.dir}/${binbase2}.zip"/>
</tar>
</target>
<target name="dist" depends="tarbin-wpclient,zip"/>
</project>