-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.xml
More file actions
487 lines (449 loc) · 22.2 KB
/
build.xml
File metadata and controls
487 lines (449 loc) · 22.2 KB
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
487
<?xml version="1.0"?>
<project name="ClusterONE" default="usage" basedir=".">
<!-- Package name and version number -->
<loadproperties>
<file file="etc/cl1.properties"/>
</loadproperties>
<!-- Compiler constants -->
<property name="debug" value="on"/>
<property name="optimize" value="on"/>
<property name="deprecation" value="on"/>
<!-- Directories -->
<property name="build" location="build" />
<property name="src" location="src" />
<property name="test" location="test" />
<property name="doc" location="doc" />
<property name="etc" location="etc" />
<property name="lib" location="lib" />
<property name="reports" location="reports" />
<property name="tools" location="tools" />
<!-- DON'T CHANGE ANYTHING BELOW THIS LINE
UNLESS YOU KNOW WHAT YOU'RE DOING -->
<property name="src.java" location="${src}/java" />
<property name="src.java.tests" location="${test}/java" />
<property name="src.web" location="${src}/web" />
<property name="build.java" location="${build}/java" />
<property name="build.java.tests" location="${build}/tests" />
<property name="build.webinf" location="${build}/WEB-INF" />
<property name="build.doc" location="${build}/doc" />
<property name="build.doc.cmdline" location="${build.doc}/cmdline" />
<property name="build.doc.cytoscape" location="${build}/java/${package.name.slashed}/ui/cytoscape/help" />
<property name="build.doc.cytoscape3" location="${build}/java/${package.name.slashed}/ui/cytoscape3/help" />
<property name="build.doc.procope" location="${build.doc}/procope" />
<property name="tool.bnd.path" location="${lib}/bnd-2.0.0.jar" />
<property name="ant.build.javac.source" value="1.5" />
<property name="ant.build.javac.target" value="1.5" />
<!-- Access to environment -->
<property environment="os" />
<!-- External dependencies -->
<condition property="lib.cytoscape.path" value="${cytoscape.path}/cytoscape.jar">
<available file="${cytoscape.path}/cytoscape.jar" />
</condition>
<condition property="lib.cytoscape3.path" value="${cytoscape3.api.jar}">
<available file="${cytoscape3.api.jar}" />
</condition>
<condition property="lib.procope.path" value="${procope.path}/lib/procope_core-${procope.version}.jar">
<available file="${procope.path}/lib/procope_core-${procope.version}.jar" />
</condition>
<condition property="lib.jsr311.path" value="${jersey.path}/lib/jsr311-api-${jersey.jsr311.version}.jar">
<available file="${jersey.path}/lib/jsr311-api-${jersey.jsr311.version}.jar" />
</condition>
<condition property="lib.jersey-core.path" value="${jersey.path}/lib/jersey-core-${jersey.version}.jar">
<available file="${jersey.path}/lib/jersey-core-${jersey.version}.jar" />
</condition>
<condition property="lib.jersey-json.path" value="${jersey.path}/lib/jersey-json-${jersey.version}.jar">
<available file="${jersey.path}/lib/jersey-json-${jersey.version}.jar" />
</condition>
<condition property="lib.jersey-multipart.path" value="${jersey.path}/contribs/jersey-multipart-${jersey.version}.jar">
<available file="${jersey.path}/contribs/jersey-multipart-${jersey.version}.jar" />
</condition>
<condition property="lib.osgi-core.path" value="${osgi.core.jar}">
<available file="${osgi.core.jar}" />
</condition>
<condition property="tool.rst2html" value="rst2html">
<available file="rst2html" filepath="${os.PATH}" />
</condition>
<condition property="tool.rst2html" value="rst2html.py">
<available file="rst2html.py" filepath="${os.PATH}" />
</condition>
<!-- Set up the default classpath -->
<path id="classpath.base">
<pathelement location="lib/tclib.jar" />
<pathelement location="lib/commons-cli-1.2.jar" />
<pathelement location="lib/tablelayout.jar" />
<pathelement location="${lib.cytoscape.path}" />
<pathelement location="${lib.cytoscape3.path}" />
<pathelement location="${lib.procope.path}" />
<pathelement location="${lib.jsr311.path}" />
<pathelement location="${lib.jersey-core.path}" />
<pathelement location="${lib.jersey-json.path}" />
<pathelement location="${lib.jersey-multipart.path}" />
<pathelement location="${lib.osgi-core.path}" />
</path>
<tstamp>
<format property="TODAY" pattern="MMMM dd, yyyy" locale="en" />
</tstamp>
<!-- Initializes the build tree, creates the necessary directories -->
<target name="-init" depends="-cytoscape_warning,-cytoscape3_warning,-procope_warning,-rst2html_warning,-web_warning"
description="Initializes the build process">
<mkdir dir="${build}" />
<mkdir dir="${build.java}" />
<mkdir dir="${build.java.tests}" />
<mkdir dir="${build.webinf}" />
<mkdir dir="${reports}" />
</target>
<target name="-cytoscape_warning" unless="lib.cytoscape.path">
<echo message="Cytoscape 2.x plugin will not be built: cytoscape.jar not found."
level="warning" />
</target>
<target name="-cytoscape3_warning" unless="lib.cytoscape3.path">
<echo message="Cytoscape 3.x plugin will not be built: cytoscape.jar not found."
level="warning" />
</target>
<target name="-procope_warning" unless="lib.procope.path">
<echo message="Procope plugin will not be built: procope_core-${procope.version}.jar not found" level="warning" />
</target>
<target name="-rst2html_warning" unless="tool.rst2html">
<echo message="Documentation will not be built: rst2html or rst2html.py not found." level="warning" />
</target>
<target name="-web_warning" unless="lib.jsr311.path">
<echo message="Web interface will not be built: jsr311-api-${jersey.jsr311.version}.jar not found" level="warning" />
</target>
<!-- Deletes the existing build -->
<target name="clean" description="Cleans up the build directories">
<!-- Delete build directories -->
<delete dir="${build.java}" />
<delete dir="${build.webinf}" />
<delete dir="${reports}" />
</target>
<!-- Compiles the Java source code -->
<target name="compile_java"
depends="-init,compile_java_base,compile_java_cytoscape_plugin,compile_java_cytoscape3_plugin,compile_java_procope_plugin,compile_java_rest_api"
description="--> compile Java code">
</target>
<!-- Compiles the base classes -->
<target name="compile_java_base" depends="-init">
<javac srcdir="${src.java}" destdir="${build.java}"
debug="${debug}" deprecation="${deprecation}"
optimize="${optimize}" includeAntRuntime="false">
<exclude name="**/cytoscape/*" />
<exclude name="**/cytoscape3/*" />
<exclude name="**/procope/*" />
<exclude name="**/api/**/*" />
<exclude name="**/CommitmentStatisticsCalculator.java" />
<classpath>
<path refid="classpath.base" />
</classpath>
</javac>
</target>
<!-- Compiles the Cytoscape 2.x plugin -->
<target name="compile_java_cytoscape_plugin" if="lib.cytoscape.path"
depends="compile_java_base">
<javac srcdir="${src.java}" destdir="${build.java}"
debug="${debug}" deprecation="${deprecation}"
optimize="${optimize}" includeAntRuntime="false">
<include name="${package.name.slashed}/ui/cytoscape/*.java" />
<classpath>
<path refid="classpath.base" />
</classpath>
</javac>
<copy file="${etc}/cytoscape/plugin.props.in"
tofile="${build.java}/${package.name.slashed}/ui/cytoscape/plugin.props" />
<replace file="${build.java}/${package.name.slashed}/ui/cytoscape/plugin.props">
<replacefilter token="@today@" value="${TODAY}" />
<replacefilter token="@package.name@" value="${package.name}" />
<replacefilter token="@package.version@" value="${package.version}" />
</replace>
</target>
<!-- Compiles the Cytoscape 3.x plugin -->
<target name="compile_java_cytoscape3_plugin" if="lib.cytoscape3.path"
depends="compile_java_base">
<javac srcdir="${src.java}" destdir="${build.java}"
debug="${debug}" deprecation="${deprecation}"
optimize="${optimize}" includeAntRuntime="false">
<include name="${package.name.slashed}/ui/cytoscape3/*.java" />
<classpath>
<path refid="classpath.base" />
</classpath>
</javac>
</target>
<!-- Compiles the Procope plugin -->
<target name="compile_java_procope_plugin" if="lib.procope.path"
depends="compile_java_base">
<javac srcdir="${src.java}" destdir="${build.java}"
debug="${debug}" deprecation="${deprecation}"
optimize="${optimize}" includeAntRuntime="false">
<include name="${package.name.slashed}/ui/procope/*.java" />
<classpath>
<path refid="classpath.base" />
</classpath>
</javac>
</target>
<!-- Compiles the web interface -->
<target name="compile_java_rest_api" if="lib.jsr311.path"
depends="compile_java_base">
<javac srcdir="${src.java}" destdir="${build.java}"
debug="${debug}" deprecation="${deprecation}"
optimize="${optimize}" includeAntRuntime="false">
<include name="${package.name.slashed}/api/rest/*.java" />
<exclude name="${package.name.slashed}/api/rest/StandaloneWebServer.java" />
<classpath>
<path refid="classpath.base" />
</classpath>
</javac>
<copy file="${etc}/web/web.xml.in" tofile="${build.webinf}/web.xml" />
<replace file="${build.webinf}/web.xml">
<replacefilter token="@ant.project.name@" value="${ant.project.name}" />
<replacefilter token="@package.name@" value="${package.name}" />
<replacefilter token="@package.version@" value="${package.version}" />
</replace>
</target>
<!-- Compiles the Java tests -->
<target name="compile_tests" depends="-init"
description="--> compile Java tests">
<javac srcdir="${src.java.tests}" destdir="${build.java.tests}">
<classpath>
<path refid="classpath.base" />
<pathelement location="${build.java}" />
<pathelement location="${lib}/junit-4.7.jar" />
</classpath>
</javac>
</target>
<!-- Compiles the whole thing -->
<target name="compile" depends="compile_java" description="Compiles all the source files">
</target>
<!-- Copies resource files to the build tree -->
<target name="-copy_resources" depends="compile_java" description="Copies resource files to the build tree">
<copy todir="${build.java}/${package.name.slashed}/resources">
<fileset dir="${src.java}/${package.name.slashed}/resources" />
<fileset file="${doc}/images/logo.png" />
</copy>
</target>
<!-- Creates the JAR file -->
<target name="jar" depends="compile,doc,-copy_resources" description="Creates the JAR file">
<taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${tool.bnd.path}" />
<copy file="${etc}/cl1.bnd.in"
tofile="${build}/cluster_one-${package.version}.bnd" />
<replace file="${build}/cluster_one-${package.version}.bnd">
<replacefilter token="@ant.project.name@" value="${ant.project.name}" />
<replacefilter token="@package.name@" value="${package.name}" />
<replacefilter token="@package.version@" value="${package.version}" />
</replace>
<bnd
classpath="${build.java}:${lib}/tclib.jar:${lib}/commons-cli-1.2.jar:${lib}/tablelayout.jar"
sourcepath="${src.java}" eclipse="false"
files="${build}/cluster_one-${package.version}.bnd"
output="cluster_one-${package.version}.jar" />
<!-- Old version that builds the JAR using Ant's built-in JAR task.
This is not suitable for OSGi bundles -->
<!--
<jar destfile="cluster_one-${package.version}.jar" basedir="${build.java}"
excludes="**/api/**/*.class">
<zipfileset src="lib/tclib.jar" includes="**/*.class" />
<zipfileset src="lib/commons-cli-1.2.jar" includes="**/*.class" />
<zipfileset src="lib/tablelayout.jar" includes="**/*.class" />
<manifest>
<attribute name="Manifest-Version" value="1.0" />
<attribute name="Extension-Name" value="${package.name}" />
<attribute name="Implementation-Version" value="${package.version}" />
<attribute name="Main-Class" value="${package.name}.ui.cmdline.CommandLineApplication" />
<attribute name="Cytoscape-Plugin" value="${package.name}.ui.cytoscape.CytoscapePlugin" />
<attribute name="Cytoscape-App-Version" value="${package.version}" />
<attribute name="Cytoscape-App-Name" value="${ant.project.name}" />
<attribute name="Cytoscape-App-Works-With" value="3.0" />
<attribute name="Bundle-ManifestVersion" value="2" />
<attribute name="Bundle-Name" value="ClusterONE plugin for Cytoscape 3" />
<attribute name="Bundle-SymbolicName" value="${package.name}.ui.cytoscape3" />
<attribute name="Bundle-Version" value="${package.version}" />
<attribute name="Bundle-Activator" value="${package.name}.ui.cytoscape3.CytoscapeAppActivator" />
<attribute name="Import-Package"
value="javax.help,javax.swing,javax.swing.event,org.cytoscape.application;version="[3.0,4)",org.cytoscape.application.swing;version="[3.0,4)",org.cytoscape.service.util;version="[3.0,4)",org.cytoscape.model;version="[3.0,4)",org.cytoscape.task;version="[3.0,4)",org.cytoscape.view.model;version="[3.0,4)",org.cytoscape.work;version="[3.0,4)"" />
</manifest>
</jar>
-->
</target>
<!-- Creates the WAR file -->
<target name="war" depends="jar" description="Creates the WAR file">
<war destfile="cluster_one-${package.version}.war"
webxml="${build.webinf}/web.xml">
<fileset dir="${src.web}" />
<zipfileset file="${etc}/logo/png/cl1_logo_64x64.png" prefix="img" />
<lib dir="lib/">
<include name="tclib.jar" />
</lib>
<lib dir=".">
<include name="cluster_one-${package.version}.jar" />
</lib>
<classes dir="${build.java}">
<include name="**/api/**/*.class" />
<exclude name="web.xml" />
</classes>
<metainf dir="${etc}/web">
<include name="**/context.xml" />
</metainf>
</war>
</target>
<!-- Creates a distributable ZIP file -->
<target name="zip" depends="jar,doc" description="Creates a distributable ZIP file">
<mkdir dir="${build.doc}/license" />
<copy todir="${build.doc}/license">
<fileset dir="doc/license" />
</copy>
<zip destfile="cluster_one-${package.version}.zip">
<zipfileset dir="${build.doc}" prefix="doc" />
<fileset dir="doc" includes="LICENSE.txt" />
<fileset dir="." includes="cluster_one-${package.version}.jar, COPYING" />
</zip>
</target>
<!-- Creates a ZIP file containing the source code -->
<target name="source_zip" description="Creates a ZIP file containing the source code">
<zip destfile="cluster_one-${package.version}_src.zip">
<fileset dir=".">
<include name="build.xml" />
</fileset>
<zipfileset dir="${doc}" prefix="doc" />
<zipfileset dir="${etc}" prefix="etc" />
<zipfileset dir="${lib}" prefix="lib">
<exclude name="junit*.jar" />
</zipfileset>
<zipfileset dir="${src}" prefix="src" />
<zipfileset dir="${test}" prefix="test" />
<zipfileset dir="${tools}" prefix="tools" />
</zip>
</target>
<!-- Tests the whole thing -->
<target name="test" depends="compile, compile_tests" description="Runs JUnit tests in the distribution">
<junit printsummary="yes" fork="yes" failureproperty="tests.failed">
<classpath>
<path refid="classpath.base" />
<pathelement location="${build.java.tests}" />
<pathelement location="${build.java}" />
<pathelement location="${lib}/junit-4.7.jar" />
</classpath>
<formatter type="plain" />
<batchtest todir="${reports}">
<fileset dir="${build.java.tests}">
<include name="**/*Test.class" />
<exclude name="**/AllTests.class" />
</fileset>
</batchtest>
</junit>
<fail message="Test failure detected, check test results" if="tests.failed" />
</target>
<!-- Command line interface documentation -->
<target name="doc_cmdline" description="Builds the command line interface documentation" if="tool.rst2html">
<mkdir dir="${build.doc.cmdline}" />
<mkdir dir="${build.doc.cmdline}/images" />
<exec executable="${tool.rst2html}">
<arg value="${doc}/cmdline/index.rst" />
<arg value="${build.doc.cmdline}/index.html" />
</exec>
<copy todir="${build.doc.cmdline}/images">
<fileset dir="${doc}/images">
<include name="*.*" />
</fileset>
</copy>
</target>
<!-- Cytoscape documentation -->
<target name="-doc_cytoscape_check">
<condition property="doc_cytoscape_run">
<and>
<isset property="tool.rst2html" />
<isset property="lib.cytoscape.path" />
</and>
</condition>
</target>
<target name="doc_cytoscape" description="Builds the Cytoscape 2.x plugin documentation"
depends="-doc_cytoscape_check" if="doc_cytoscape_run">
<mkdir dir="${build.doc.cytoscape}" />
<mkdir dir="${build.doc.cytoscape}/images" />
<exec executable="${tool.rst2html}">
<arg value="${doc}/cytoscape/index.rst" />
<arg value="${build.doc.cytoscape}/index.html" />
</exec>
<exec executable="python">
<arg value="${tools}/generate_javahelp.py" />
<arg value="${build.doc.cytoscape}/index.html" />
</exec>
<copy todir="${build.doc.cytoscape}/images">
<fileset dir="${doc}/images">
<include name="*.*" />
</fileset>
<fileset dir="${doc}/cytoscape/images">
<include name="*.*" />
</fileset>
</copy>
<copy file="${doc}/cytoscape/cl1.hs"
tofile="${build.doc.cytoscape}/cl1.hs" />
</target>
<!-- Cytoscape3 documentation -->
<target name="-doc_cytoscape3_check">
<condition property="doc_cytoscape3_run">
<and>
<isset property="tool.rst2html" />
<isset property="lib.cytoscape3.path" />
</and>
</condition>
</target>
<target name="doc_cytoscape3" description="Builds the Cytoscape 3.x plugin documentation"
depends="-doc_cytoscape3_check" if="doc_cytoscape3_run">
<mkdir dir="${build.doc.cytoscape3}" />
<mkdir dir="${build.doc.cytoscape3}/images" />
<exec executable="${tool.rst2html}">
<arg value="${doc}/cytoscape/index.rst" />
<arg value="${build.doc.cytoscape3}/index.html" />
</exec>
<exec executable="python">
<arg value="${tools}/generate_javahelp.py" />
<arg value="${build.doc.cytoscape3}/index.html" />
</exec>
<copy todir="${build.doc.cytoscape3}/images">
<fileset dir="${doc}/images">
<include name="*.*" />
</fileset>
<fileset dir="${doc}/cytoscape3/images">
<include name="*.*" />
</fileset>
</copy>
<copy file="${doc}/cytoscape3/cl1.hs"
tofile="${build.doc.cytoscape3}/cl1.hs" />
</target>
<!-- ProCope documentation -->
<target name="-doc_procope_check">
<condition property="doc_procope_run">
<and>
<isset property="tool.rst2html" />
<isset property="procope.path" />
</and>
</condition>
</target>
<target name="doc_procope" description="Builds the ProCope plugin documentation"
depends="-doc_procope_check" if="doc_procope_run">
<mkdir dir="${build.doc.procope}" />
<mkdir dir="${build.doc.procope}/images" />
<copy file="${doc}/cmdline/description.rst" todir="${build.doc.procope}" />
<copy file="${doc}/procope/index.rst" todir="${build.doc.procope}" />
<exec executable="${tool.rst2html}" dir="${build.doc.procope}">
<arg value="index.rst" />
<arg value="index.html" />
</exec>
<delete>
<fileset dir="${build.doc.procope}" includes="*.rst" />
</delete>
<copy todir="${build.doc.cmdline}/images">
<fileset dir="${doc}/images">
<include name="*.*" />
</fileset>
</copy>
</target>
<target name="doc" depends="doc_cmdline, doc_cytoscape, doc_cytoscape3, doc_procope" description="Builds the documentation" />
<!-- Main targets -->
<target name="build" depends="compile, doc, jar" description="Builds the whole project" />
<target name="rebuild" depends="clean, build" description="Rebuilds the project from scratch" />
<!-- Usage information target -->
<target name="usage" description="Display usage information">
<echo message=" Execute 'ant -projecthelp' for build file help." />
<echo message=" Execute 'ant -help' for Ant help." />
</target>
<target name="help" depends="usage" />
</project>