-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
548 lines (473 loc) · 19.3 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
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
<?xml version="1.0" encoding="UTF-8"?>
<!--
Generic Build script for a Meandre Components repository.
This build.xml provides targets useful in dealing with a repository of
Meandre Components. These targets do things like generating rdf descriptors
that Meandre needs to execute and the ability to upload the code and
descriptors to a running Meandre server.
-->
<project name="Components-Foundry" default="dist">
<!--
======================
REPOSITORY SPECIFIC INFO
======================
These are the only properties that should vary from repository to
repository.
-->
<!-- used in jar file name, error messages, etc. -->
<property name="project.name" value="foundry"/>
<!--
=================================
ENVIRONMENT CHECKS
====================================
-->
<!-- Check whether Java 1.5+ is being used -->
<condition property="using.java.1.5">
<or>
<equals arg1="${ant.java.version}" arg2="1.5"/>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<equals arg1="${ant.java.version}" arg2="1.7"/>
</or>
</condition>
<!-- Check whether Ant 1.7 is being used. 1.7 is needed for junit4
support (junit4 allows annotations to declare test cases). -->
<condition property="using.ant.1.7">
<or>
<contains string="${ant.version}" substring="1.7"/>
<contains string="${ant.version}" substring="1.8"/>
</or>
</condition>
<!-- Make sure we're running under the correct environment -->
<fail message="This package requires at least Ant 1.7." unless="using.ant.1.7"/>
<fail message="This package requires at least Java 5. Please set JAVA_HOME to point to where JDK 1.5 or higher is installed."
unless="using.java.1.5"/>
<!--
=================================
DIRECTORY STRUCTURE DEFINITION
====================================
-->
<!-- Project structure -->
<property name="lib.dir" value="${basedir}/lib"/>
<property name="lib.gwt.dir" value="${lib.dir}/gwt"/>
<property name="lib.devkit.dir" value="${basedir}/devkit"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="descriptors.dir" value="${basedir}/descriptors"/>
<property name="gwt.base.dir" value="${basedir}/src-gwt"/>
<property name="gwt.src.dir" value="${gwt.base.dir}/src"/>
<property name="gwt.modules.list" value="org.seasr.meandre.components.vis.gwt.helloworld.HelloWorld,org.seasr.meandre.components.vis.gwt.tableviewer.TableViewer,org.seasr.meandre.components.vis.gwt.inputdata.InputData"/>
<!-- Default settings for the 'upload-components' task -->
<property name="server" value="localhost"/>
<property name="port" value="1714"/>
<property name="user" value="admin"/>
<property name="pw" value="admin"/>
<!-- JUnit elements -->
<property name="test.classes.dir" value="${build.dir}/classes-test/"/>
<property name="test.root.dir" value="${basedir}/test"/>
<property name="test.logs.dir" value="${test.root.dir}/log"/>
<property name="test.output.dir" value="${test.root.dir}/output"/>
<!-- Generated JAR location -->
<property name="components.jar.file" value="${project.name}-components.jar"/>
<!-- Compile target -->
<property name="compile.target" value="1.5"/>
<!-- Code locations -->
<path id="src.code.dirs">
<dirset dir="${basedir}" includes="src-*" excludes="src-test, src-gwt, src-abstracts, src-datatype"/>
</path>
<property name="src.abstracts.dir" value="${basedir}/src-abstracts"/>
<property name="src.datatype.dir" value="${basedir}/src-datatype"/>
<property name="src.support.dir" value="${basedir}/src-support"/>
<!-- Test locations -->
<path id="src.test.root.dirs">
<dirset dir="${basedir}" includes="src-test" />
</path>
<!--
=================
WIKI UPLOAD PROPERTIES
=================
-->
<!-- Confluence settings (for update-wiki task) -->
<!-- These need to be handled differently - they should probably be set in $HOME/.SEASR/WikiCreateComponentPages.conf or specified via command line -->
<property name="confluence.server" value="http://dev-tools.seasr.org/confluence"/>
<property name="confluence.space" value="COOK"/>
<property name="confluence.title" value="Foundry-Components"/>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${lib.dir}/ant-contrib.jar"/>
</classpath>
</taskdef>
<!--
=================
CLASSPATHS
=================
-->
<!-- Compilation classpath -->
<path id="classpath.build">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<!-- Foundry libraries -->
<path id="classpath.foundry">
<fileset dir="${lib.dir}/foundry" includes="*.jar"/>
</path>
<!-- Runtime class path -->
<path id="classpath.runtime">
<path refid="classpath.build"/>
<fileset dir="${dist.dir}" includes="*.jar"/>
</path>
<!-- Test class path -->
<path id="classpath.test">
<pathelement location="${test.classes.dir}"/>
<path refid="classpath.foundry"/>
<path refid="classpath.runtime"/>
</path>
<!-- Classpath for Meandre utilities -->
<path id="classpath.devkit">
<fileset dir="${lib.devkit.dir}" includes="*.jar"/>
</path>
<!-- GWT class path -->
<path id="gwt.class.path">
<pathelement location="${gwt.base.dir}/war/WEB-INF/classes"/>
<pathelement location="${lib.gwt.dir}/gwt-user.jar"/>
<fileset dir="${lib.gwt.dir}" includes="gwt-dev.jar"/>
<!-- Add any additional non-server libs (such as JUnit) -->
<fileset dir="${gwt.base.dir}/war/WEB-INF/lib" includes="**/*.jar"/>
</path>
<!--
=================
BUILD TARGETS
=================
-->
<!--
Creates required folders
-->
<target name="init" description="-> creates required folders">
<tstamp/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${test.root.dir}"/>
<mkdir dir="${test.classes.dir}"/>
<mkdir dir="${test.logs.dir}"/>
<mkdir dir="${test.output.dir}"/>
</target>
<target name="init-gwt">
<mkdir dir="${gwt.base.dir}/war/WEB-INF/lib" />
<copy todir="${gwt.base.dir}/war/WEB-INF/lib" file="${lib.gwt.dir}/gwt-servlet.jar" />
<!-- Add any additional server libs that need to be copied -->
</target>
<!--
Performs cleanup
-->
<target name="clean" description="-> removes build artifacts">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${descriptors.dir}"/>
<delete dir="${test.logs.dir}"/>
<delete dir="${test.output.dir}"/>
<delete dir="published_resources"/>
<delete dir="run"/>
<delete file="meandre-config-core.xml"/>
<delete file="velocity.log"/>
<delete dir="log"/>
</target>
<!--
Compiles and generates the foundry-abstracts, foundry-datatype-datamining, foundry-datatype-core libs
-->
<target name="update-foundry-libs" depends="init" description="-> compiles and regenerates the foundry-*.jar libs">
<mkdir dir="${build.dir}/classes-datatype"/>
<javac target="${compile.target}"
srcdir="${src.datatype.dir}"
destdir="${build.dir}/classes-datatype"
includeantruntime="false"
debug="true"
classpathref="classpath.build"
updatedProperty="datatype.updated"/>
<jar destfile="${lib.dir}/foundry/foundry-datatype-core.jar"
basedir="${build.dir}/classes-datatype"
includes="org/seasr/datatypes/core/**">
<fileset dir="${basedir}/src-datatype" includes="org/seasr/datatypes/core/**"/>
</jar>
<jar destfile="${lib.dir}/foundry/foundry-datatype-datamining.jar"
basedir="${build.dir}/classes-datatype"
includes="org/seasr/datatypes/datamining/**">
<fileset dir="${basedir}/src-datatype" includes="org/seasr/datatypes/datamining/**"/>
</jar>
<mkdir dir="${build.dir}/classes-abstracts"/>
<javac target="${compile.target}"
srcdir="${src.abstracts.dir}"
destdir="${build.dir}/classes-abstracts"
includeantruntime="false"
debug="true"
updatedProperty="abstracts.updated">
<classpath>
<path refid="classpath.build"/>
<path refid="classpath.foundry"/>
</classpath>
</javac>
<jar destfile="${lib.dir}/foundry/foundry-abstracts.jar"
basedir="${build.dir}/classes-abstracts">
<fileset dir="${basedir}/src-abstracts"/>
</jar>
<mkdir dir="${build.dir}/classes-support"/>
<javac target="${compile.target}"
srcdir="${src.support.dir}"
destdir="${build.dir}/classes-support"
includeantruntime="false"
debug="true"
classpathref="classpath.test"
updatedProperty="support.updated"/>
<jar destfile="${lib.dir}/foundry/foundry-datatype-tuples.jar"
basedir="${build.dir}/classes-support"
includes="org/seasr/meandre/support/components/tuples/**">
<fileset dir="${basedir}/src-support" includes="org/seasr/meandre/support/components/tuples/**"/>
</jar>
</target>
<!--
Compiles components code
-->
<target name="compile"
depends="init, update-foundry-libs"
description="-> compiles all components">
<!-- compile -->
<javac target="${compile.target}"
debug="on" debuglevel="lines,vars,source"
destdir="${classes.dir}"
includeantruntime="false">
<src refid="src.code.dirs"/>
<classpath>
<path refid="classpath.build"/>
<path refid="classpath.foundry"/>
</classpath>
<!-- <compilerarg value="-Xlint:deprecation"/> -->
</javac>
<!-- include other files that should be available to runtime classpath-->
<copy todir="${classes.dir}"
includeEmptyDirs="no">
<fileset dir="${basedir}">
<include name="src-*/**/*.properties"/>
<include name="src-*/**/*.xml"/>
<include name="src-*/**/*.vm"/>
<include name="src-*/**/*.js"/>
<include name="src-*/**/*.swf"/>
<include name="src-*/**/*.list"/>
<include name="src-*/**/*.jar"/>
<exclude name="src-gwt/**"/>
</fileset>
<regexpmapper from="^src-[^/]+/(.+)$" to="\1"/>
</copy>
</target>
<target name="compile-gwt" depends="init-gwt" description="-> compiles the GWT code">
<mkdir dir="${gwt.base.dir}/war/WEB-INF/classes"/>
<javac srcdir="${gwt.src.dir}" includes="**" encoding="utf-8"
destdir="${gwt.base.dir}/war/WEB-INF/classes"
source="1.5" target="${compile.target}" nowarn="true"
debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<classpath refid="gwt.class.path"/>
</javac>
<copy todir="${gwt.base.dir}/war/WEB-INF/classes">
<fileset dir="${gwt.base.dir}/src" excludes="**/*.java"/>
</copy>
<foreach list="${gwt.modules.list}" target="gwtc" param="gwtmodule"/>
</target>
<target name="gwtc">
<delete dir="${gwt.base.dir}/war/${gwtmodule}"/>
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${gwt.base.dir}/src"/>
<path refid="gwt.class.path"/>
<pathelement location="${lib.gwt.dir}/validation-api-1.0.0.GA.jar" />
<pathelement location="${lib.gwt.dir}/validation-api-1.0.0.GA-sources.jar" />
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="-war ${gwt.base.dir}/war"/>
<arg value="${gwtmodule}"/>
</java>
<jar destfile="${lib.dir}/${gwtmodule}.jar" basedir="${gwt.base.dir}/war/${gwtmodule}"/>
</target>
<!--
Packages all components into one jar file
-->
<target name="dist"
depends="compile"
description="-> creates components jar file">
<jar destfile="${dist.dir}/${components.jar.file}"
basedir="${classes.dir}"/>
</target>
<!--
=================
JUNIT TESTS TARGETS
=================
-->
<!--
Compile tests
-->
<target name="compile-tests"
depends="dist"
description="-> compiles the unit tests">
<!-- compile -->
<javac target="${compile.target}"
debug="on" debuglevel="lines,vars,source"
destdir="${test.classes.dir}"
includeantruntime="false">
<src refid="src.test.root.dirs"/>
<classpath>
<path refid="classpath.runtime"/>
<path refid="classpath.foundry"/>
</classpath>
</javac>
<!-- include other files that should be available to runtime classpath-->
<copy todir="${test.classes.dir}"
includeEmptyDirs="no">
<fileset dir="${basedir}">
<include name="src-test/**/*.properties"/>
<include name="src-test/**/*.xml"/>
<include name="src-test/**/*.vm"/>
<include name="src-test/**/*.list"/>
</fileset>
<regexpmapper from="^src-test/(.+)$" to="\1"/>
</copy>
</target>
<!--
run the JUnit tests
-->
<target name="run-tests"
depends="compile-tests"
description= "-> runs the unit tests and generates xml logs and html reports">
<mkdir dir="${test.logs.dir}/xml"/>
<!--
<property name="cp" refid="classpath.test"/>
<echo message="Classpath: ${cp}"/>
-->
<junit printsummary="yes"
errorProperty="test.failed"
failureProperty="test.failed"
showoutput="yes">
<jvmarg value="-Duser.language=en"/>
<classpath refid="classpath.test"/>
<formatter type="xml"/>
<formatter type="brief" usefile="false"/>
<batchtest todir="${test.logs.dir}/xml">
<fileset dir="${test.classes.dir}" includes="**/*Tests.class"/>
</batchtest>
</junit>
<junitreport todir="${test.logs.dir}/xml">
<fileset dir="${test.logs.dir}/xml">
<include name="TEST-*.xml"/>
</fileset>
<report format="noframes" todir="${test.root.dir}"/>
</junitreport>
<echo message="Report generated at:
file://${test.root.dir}/junit-noframes.html"/>
</target>
<!--
=================
MEANDRE RELATED TARGETS
=================
-->
<!--
installs all components (descriptors and java contexts) to a
meandre-infrastructure server
-->
<target name="upload-components"
depends="compile"
description="-> uploads and installs components to a Meandre Infrastructure server running on the local machine">
<java classname="org.meandre.tools.components.installer.InstallComponentsCMD"
fork="yes"
maxmemory="1024m">
<classpath refid="classpath.devkit"/>
<jvmarg value="-showversion"/>
<arg value="--class-dir"/>
<arg value="${classes.dir}"/>
<arg value="--lib-dir"/>
<arg value="${lib.dir}"/>
<arg value="--tmp-dir"/>
<arg value="${build.dir}"/>
<arg value="--meandre-host"/>
<arg value="${server}"/>
<arg value="--meandre-port"/>
<arg value="${port}"/>
<arg value="--meandre-username"/>
<arg value="${user}"/>
<arg value="--meandre-password"/>
<arg value="${pw}"/>
</java>
</target>
<!--
Creates/updates the wiki component documentation
-->
<target name="update-wiki"
depends="create-descriptors"
description="-> updates the wiki documentation for components. Example: >ant update-wiki -Dusername=wiki_username -Dpassword=wiki_password">
<java classname="org.meandre.tools.wiki.WikiCreateComponentPages"
fork="yes"
maxmemory="1024m">
<classpath refid="classpath.devkit"/>
<jvmarg value="-showversion"/>
<arg value="-s"/>
<arg value="${confluence.server}"/>
<arg value="-d"/>
<arg value="${descriptors.dir}"/>
<arg value="--title"/>
<arg value="${confluence.title}"/>
<arg value="--space"/>
<arg value="${confluence.space}"/>
<arg value="-u"/>
<arg value="${username}"/>
<arg value="-p"/>
<arg value="${password}"/>
</java>
</target>
<!--
Creates the component descriptors and saves them to a particular folder
-->
<target name="create-descriptors"
depends="compile"
description="-> creates descriptors for all components. Example: >ant create-descriptors [-Ddescriptors.dir=...]">
<java classname="org.meandre.tools.components.CreateDescriptors"
fork="yes"
maxmemory="1024m">
<classpath refid="classpath.devkit"/>
<arg value="${classes.dir}"/>
<arg value="${lib.dir}"/>
<arg value="${descriptors.dir}"/>
</java>
</target>
<!--
CLOVER targets
-->
<target name="check.clover">
<taskdef resource="cloverlib.xml"/>
<available property="clover.installed" classname="com.cenqua.clover.CloverInstr" />
</target>
<target name="guard.noclover" depends="check.clover" unless="clover.installed">
<fail message="The target you are attempting to run requires Clover, which doesn't appear to be installed"/>
</target>
<target name="with.clover" depends="guard.noclover" description="-> enables code coverage analysis for following tasks">
<mkdir dir="${test.root.dir}/clover"/>
<clover-setup/>
</target>
<target name="clover-xml" description="-> generates the code coverage report in XML format">
<mkdir dir="${test.root.dir}/clover/history"/>
<clover-historypoint historyDir="${test.root.dir}/clover/history"/>
<clover-report>
<current outfile="${test.root.dir}/clover/coverage.xml">
<format type="xml"/>
</current>
</clover-report>
</target>
<target name="clover-html" description="-> generates the code coverage report in HTML format">
<clover-historypoint historyDir="${test.root.dir}/clover/history"/>
<clover-html-report outdir="${test.root.dir}/clover"/>
<echo message="The code coverage report is available at file:///${test.root.dir}/clover"/>
</target>
<target name="clover-pdf" description="-> generates the code coverage report in PDF format">
<clover-historypoint historyDir="${test.root.dir}/clover/history"/>
<clover-pdf-report outfile="${test.root.dir}/clover/coverage.pdf"/>
</target>
</project>
<!-- DO NOT EDIT BELOW THIS LINE PLEASE -->
<!-- vim:sw=4:softtabstop=4:expandtab
-->