forked from CBSR-Biobank/biobank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
726 lines (639 loc) · 29.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
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
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
<?xml version="1.0" encoding="utf-8"?>
<project name="biobank" basedir="." default="deploy"
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:flyway="antlib:com.googlecode.flyway.ant">
<!--
Overall build file
use command "ant -projecthelp" to display the targets.
-->
<property environment="env" />
<property name="doxygen" location="/usr/bin/doxygen" />
<property name="xsltproc" location="/usr/bin/xsltproc" />
<!-- TODO: move as many properties as possible into build.properties -->
<!-- TODO: add tasks to push database properties to various files -->
<!-- TODO: create a cacore directory with all the cacore stuff in it
that we can throw into the war file and use to create the database -->
<property file="build.properties" />
<property file="client.properties" />
<property file="db.properties" />
<!-- must use a property with a LOCATION attribute because it is converted
to be an absolute value, which the product builder seems to require in
order to load its build.properties in product/build.properties -->
<property name="product.dir" location="product" />
<property name="buildDirectory" value="${product.dir}/buildDirectory" />
<path id="flyway.lib.path">
<fileset dir="${lib.dir}/flyway" includes="*.jar"/>
</path>
<path id="flyway.classpath">
<fileset dir="${lib.dir}/build" includes="mysql-connector-java.jar"/>
<fileset dir="${lib.dir}/flyway" includes="*.jar"/>
</path>
<import file="build-db.xml"/>
<import file="build-i18n.xml"/>
<import file="build-eclipse.xml"/>
<import file="build-tests.xml"/>
<import file="build-tools.xml"/>
<condition property="databse.exec.haveUserAndPassword">
<and>
<isset property="database.exec.username" />
<isset property="database.exec.password" />
</and>
</condition>
<condition property="perl" value="perl" else="/usr/bin/perl">
<os family="windows" />
</condition>
<condition property="debugFileExtension" value="-debug" else="">
<equals arg1="${debug}" arg2="true" casesensitive="false" trim="true" />
</condition>
<fileset id="biobank.common.server.build.classpath" dir="${eclipse.proj.dir.common}/lib/server">
<include name="csmapi.jar" />
<include name="flyway-core.jar" />
<include name="jta.jar" />
<include name="sdk-core.jar" />
<include name="sdk-writable-core.jar" />
<include name="spiffy-all.jar" />
<include name="supercsv.jar" />
</fileset>
<fileset id="biobank.common.client.build.classpath" dir="${eclipse.proj.dir.common}/lib/client">
<include name="acegi-security.jar" />
<include name="antlr.jar" />
<include name="asm.jar" />
<include name="axis.jar" />
<include name="caGrid-CQL-cql.jar" />
<include name="castor.jar" />
<include name="cglib.jar" />
<include name="cog-jglobus.jar" />
<include name="commons-codec.jar" />
<include name="commons-collections.jar" />
<include name="commons-discovery.jar" />
<include name="commons-lang.jar" />
<include name="commons-logging.jar" />
<include name="dom4j.jar" />
<include name="ehcache.jar"/>
<include name="gettext-commons.jar" />
<include name="hibernate-commons-annotations.jar"/>
<include name="hibernate-core.jar" />
<include name="hibernate-ehcache.jar"/>
<include name="hibernate-envers.jar" />
<include name="hibernate-jpa-2.0-api.jar" />
<include name="hibernate-validator.jar" />
<include name="javassist.jar" />
<include name="jaxrpc.jar" />
<include name="jdom.jar"/>
<include name="jsse.jar" />
<include name="jta.jar" />
<include name="log4j.jar" />
<include name="messages.jar" />
<include name="mysql-connector-java.jar" />
<include name="ognl.jar" />
<include name="saaj.jar" />
<include name="sdk-client-framework.jar" />
<include name="sdk-grid-remoting.jar" />
<include name="sdk-security.jar" />
<include name="sdk-writable-client-framework.jar" />
<include name="slf4j-api.jar" />
<include name="slf4j-log4j12.jar" />
<include name="spring.jar" />
<include name="validation-api.jar" />
<include name="wsdl4j.jar" />
<include name="xercesImpl.jar" />
<include name="xpp3.jar" />
<include name="xstream.jar" />
</fileset>
<path id="biobank.common.build.classpath">
<fileset refid="biobank.common.server.build.classpath" />
<fileset refid="biobank.common.client.build.classpath" />
</path>
<!-- for tests -->
<path id="biobank.common.run.classpath">
<fileset refid="biobank.common.server.build.classpath" />
<fileset refid="biobank.common.client.build.classpath" />
<pathelement location="${eclipse.proj.dir.common}/output" />
</path>
<target name="flyway-set-properties" depends="resolve,get-db-executor,build-common-project">
<taskdef uri="antlib:com.googlecode.flyway.ant"
resource="com/googlecode/flyway/ant/antlib.xml"
classpathref="flyway.lib.path"
onerror="ignore" />
<property name="flyway.driver" value="${database.driver}"/>
<property name="flyway.url" value="${database.url}"/>
<property name="flyway.user" value="${database.exec.username}"/>
<property name="flyway.password" value="${database.exec.password}"/>
<property name="flyway.schemas" value="${database.name}"/>
<!--property name="flyway.locations"
value="edu.ualberta.med.biobank.migration,db/migrations"/-->
<property name="flyway.locations" value="edu.ualberta.med.biobank.migration,db/migrations"/>
<copy file="${secu-log.dir}/jboss/flyway-application-config.xml.template"
tofile="${lib.dir}/flyway/flyway-application-config.xml"/>
<replace file="${lib.dir}/flyway/flyway-application-config.xml">
<replacefilter token="@database.url@" value="${database.url}"/>
<replacefilter token="@database.driver@" value="${database.driver}"/>
<replacefilter token="@database.username@" value="${database.username}"/>
<replacefilter token="@database.password@" value="${database.password}"/>
</replace>
<copy file="db/migration/V1__Base_version.sql.template"
tofile="db/migration/V1__Base_version.sql"/>
<replace file="db/migration/V1__Base_version.sql">
<replacefilter token="@database.url@" value="${database.url}"/>
<replacefilter token="@database.driver@" value="${database.driver}"/>
<replacefilter token="@database.username@" value="${database.username}"/>
<replacefilter token="@database.password@" value="${database.password}"/>
</replace>
<jar destfile="${lib.dir}/flyway/migrations.jar"
basedir="."
includes="db/migration/**">
<fileset dir="${eclipse.proj.dir.common}/output" includes="**/migration/*.class"/>
</jar>
</target>
<target name="flyway-clean" depends="flyway-set-properties">
<flyway:clean/>
</target>
<target name="flyway-info" depends="flyway-set-properties">
<flyway:info/>
</target>
<target name="flyway-init" depends="flyway-set-properties">
<flyway:init/>
</target>
<target name="flyway-migrate" depends="flyway-set-properties">
<flyway:migrate/>
</target>
<target name="flyway-repair" depends="flyway-set-properties">
<flyway:repair/>
</target>
<target name="flyway-validate" depends="flyway-set-properties">
<flyway:validate/>
</target>
<property name="ivy.install.version" value="2.2.0" />
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
</condition>
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="check-dependencies-uptodate">
<uptodate property="dependencies.uptodate">
<srcfiles dir="." includes="ivy.xml"/>
<mapper type="merge" to="${lib.dir}/.dependencies.resolved"/>
</uptodate>
</target>
<target name="resolve" depends="init-ivy,check-dependencies-uptodate" unless="dependencies.uptodate"
description="--> retrieve dependencies with ivy">
<ivy:retrieve pattern="lib/build/[artifact].[ext]" conf="biobank.build" type="jar" />
<ivy:retrieve pattern="lib/[conf]/[artifact].[ext]"
conf="hibernatetool,biobank.webapp" type="jar" />
<ivy:retrieve pattern="lib/[conf]/[artifact].[ext]" conf="flyway" type="jar" />
<ivy:retrieve pattern="lib/[conf]//[artifact]-[type].[ext]" conf="flyway" type="source" />
<ivy:retrieve pattern="eclipse_ws/biobank.common/lib/client/[artifact].[ext]" conf="biobank.common.client" type="jar" />
<ivy:retrieve pattern="eclipse_ws/biobank.common/lib/client/[artifact]-[type].[ext]" conf="biobank.common.client" type="source" />
<ivy:retrieve pattern="eclipse_ws/biobank.common/lib/server/[artifact].[ext]" conf="biobank.common.server" type="jar" />
<ivy:retrieve pattern="eclipse_ws/biobank.common/lib/server/[artifact]-[type].[ext]" conf="biobank.common.server" type="source" />
<ivy:retrieve pattern="eclipse_ws/[conf]/lib/[artifact].[ext]"
conf="biobank.gui.common,biobank.mvp,biobank2,biobank2.tools,biobank2.tests"
type="jar" />
<ivy:retrieve pattern="eclipse_ws/[conf]/lib/[artifact]-[type].[ext]"
conf="biobank.gui.common,biobank.mvp,biobank2,biobank2.tools,biobank2.tests"
type="source" />
<touch file="${lib.dir}/.dependencies.resolved" />
</target>
<target name="report" depends="resolve" description="--> generates a report of dependencies">
<ivy:report todir="${output.dir}"
conf="biobank.common.client,biobank.common.server,biobank.gui.common,biobank.mvp,biobank2,biobank2.tools,biobank2.tests" />
</target>
<target name="clean-ivy" depends="init-ivy"
description="--> cleans ivy temporary files">
<delete>
<fileset dir="${lib.dir}" includes=".dependencies.resolved"/>
</delete>
</target>
<target name="clean-cache" depends="init-ivy" description="--> cleans the ivy cache">
<ivy:cleancache />
</target>
<target name="check-messages-jar-exists">
<available file="${lib.dir}/messages.jar" property="messages-jar-exists" />
</target>
<target name="create-messages-jar" depends="check-messages-jar-exists"
unless="messages-jar-exists">
<antcall target="messages-jar"/>
</target>
<target name="versions-update"
depends="server-manifest,biobank-version-modify"
description="--> update version strings on server and client">
</target>
<target name="deploy-eclipse" depends="resolve,create-messages-jar,biobank-version-modify"
description="--> retrieve dependencies for eclipse projects">
<copy file="${lib.dir}/messages.jar" todir="${eclipse.proj.dir}/lib"/>
<copy file="${lib.dir}/messages.jar" todir="${eclipse.proj.dir.common}/lib/client"/>
<!-- File needed in the test project to call csm api methods -->
<copy file="sdk_conf/biobank.csm.new.hibernate.cfg.xml" todir="${eclipse.proj.dir.tests}/src" />
</target>
<target name="get-db-executor" unless="databse.exec.haveUserAndPassword">
<input message="Enter database executor's username (to execute database commands)"
addProperty="database.exec.username"
defaultValue="root" />
<input message="Enter password"
addProperty="database.exec.password"
defaultValue="">
<handler type="secure" />
</input>
</target>
<target name="check-db-user"
depends="check-db">
</target>
<target name="check-db"
depends="get-db-executor">
</target>
<!-- JBoss -->
<target name="check-jboss-uptodate">
<!-- remove the upt.war because it requires db name/url/username/pw variables
inside the war -->
<delete includeemptydirs="true">
<fileset dir="${env.JBOSS_HOME}/server/default/deploy">
<include name="upt*.war"/>
</fileset>
</delete>
<uptodate property="jboss.uptodate"
targetfile="${env.JBOSS_HOME}/server/default/deploy/biobank.war">
<srcfiles file="${war.file}" />
<srcfiles file="db.properties" />
</uptodate>
</target>
<target name="keystore-gen">
<hostinfo prefix="local" />
<echo message="Helping you to generate a TEMPORARY THROW-AWAY TEST key..." />
<input message="Enter CN:"
addproperty="dName.CN"
defaultValue="localhost" />
<input message="Enter subjectAltName:"
addproperty="subjectAltName"
defaultValue="IP:${local.ADDR4},DNS:localhost" />
<input message="Enter an alias:"
addproperty="keystore.alias"
defaultValue="${dName.CN}" />
<copy file="scripts/ssl/cert.cnf.template"
tofile="scripts/ssl/cert.cnf" overwrite="true" />
<replace file="scripts/ssl/cert.cnf">
<replacefilter token="@@dName.CN@@" value="${dName.CN}" />
<replacefilter token="@@subjectAltName@@" value="${subjectAltName}" />
</replace>
<exec executable="openssl" dir="scripts/ssl">
<arg line="req -newkey rsa:1024 -x509 -outform DER -out cert.der -days 3650 -config cert.cnf" />
</exec>
<exec executable="openssl" dir="scripts/ssl">
<arg line="pkcs8 -topk8 -nocrypt -in key.pem -inform PEM -out key.der -outform DER" />
</exec>
<exec executable="java" dir="scripts/ssl">
<arg line="-Dkeystore=biobank.keystore ImportKey key.der cert.der ${keystore.alias}" />
</exec>
<exec executable="keytool" dir="scripts/ssl">
<arg line="-keystore biobank.keystore -alias ${keystore.alias} -storepass importkey -keypasswd -keypass importkey -new biobank2" />
</exec>
<exec executable="keytool" dir="scripts/ssl">
<arg line="-keystore biobank.keystore -storepasswd -storepass importkey -new biobank2" />
</exec>
<copy file="scripts/ssl/biobank.keystore"
tofile="${secu-log.dir}/jboss/biobank.keystore" overwrite="true" />
</target>
<target name="keystore-check">
<available file="${secu-log.dir}/jboss/biobank.keystore" property="keystore.available" />
</target>
<target name="keystore-copy" depends="keystore-check">
<fail unless="keystore.available"
message="${secu-log.dir}/jboss/biobank.keystore not found. Use target 'keystore-gen' to generate a temporary key or create your own manually." />
<copy file="${secu-log.dir}/jboss/biobank.keystore"
tofile="${env.JBOSS_HOME}/server/default/conf/biobank.keystore"
overwrite="true" />
</target>
<!-- version number on server side -->
<target name="server-manifest">
<manifest file="${eclipse.proj.dir.common}/META-INF/MANIFEST.MF"
mode="update">
<attribute name="Bundle-Version" value="${server.version.num}" />
</manifest>
<fixcrlf srcdir="${eclipse.proj.dir.common}/META-INF"
eol="lf"
eof="asis">
<include name="**/*.MF" />
</fixcrlf>
<propertyfile file="${eclipse.proj.dir.common}/src/edu/ualberta/med/biobank/server/applicationservice/version.properties">
<entry key="server.version" value="${server.version.num}" />
</propertyfile>
</target>
<target name="update-db-config"
description="copies db configuration information from db.properties to various config files">
<copy todir="${secu-log.dir}/jboss" overwrite="true">
<fileset dir="${secu-log.dir}/jboss"/>
<globmapper from="*.template" to="*"/>
<filterset>
<filter token="database.url" value="${database.url}"/>
<filter token="database.driver" value="${database.driver}"/>
<filter token="database.username" value="${database.username}"/>
<filter token="database.password" value="${database.password}"/>
</filterset>
</copy>
<move file="${secu-log.dir}/jboss/application-config.xml"
tofile="webapp/WEB-INF/classes/application-config.xml"
overwrite="true" />
<move file="${secu-log.dir}/jboss/biobank.csm.new.hibernate.cfg.xml"
tofile="webapp/WEB-INF/classes/biobank.csm.new.hibernate.cfg.xml"
overwrite="true" />
<move file="${secu-log.dir}/jboss/log4j.xml"
tofile="webapp/WEB-INF/classes/log4j.xml"
overwrite="true" />
</target>
<target name="check-db-properties">
<available file="db.properties" property="db.properties.available" />
</target>
<target name="db-properties-copy" depends="check-db-properties">
<fail unless="db.properties.available"
message="File 'db.properties' not found in project's root directory. Copy 'db.properties.template' to 'db.properties' and modify accordingly." />
<copy file="db.properties.template"
tofile="db.properties"
overwrite="false" />
</target>
<target name="check-deploy-jboss"
depends="db-properties-copy,check-db-user">
<echo message="to skip this check set the check.deploy.jboss.skip property on the command line" />
<exec dir="" executable="${perl}" failonerror="true">
<arg line="scripts/chkconfig -d ${database.name} --host ${database.host} -u ${database.exec.username} -p ${database.exec.password}"/>
</exec>
</target>
<target name="check-deploy-jboss-required"
unless="check.deploy.jboss.skip">
<antcall target="check-deploy-jboss" />
</target>
<target name="deploy-jboss"
depends="check-deploy-jboss-required,update-db-config,package-webapp,check-jboss-uptodate,keystore-copy"
description="deploys the caCORE SDK webapp to JBoss"
unless="jboss.uptodate">
<copy file="${secu-log.dir}/jboss/login-config.xml"
tofile="${env.JBOSS_HOME}/server/default/conf/login-config.xml"
overwrite="true" verbose="true" />
<copy file="${secu-log.dir}/jboss/server${debugFileExtension}.xml"
tofile="${env.JBOSS_HOME}/server/default/deploy/jbossweb-tomcat55.sar/server.xml"
overwrite="true" verbose="true" />
<!-- for compatibility: this file has been split -->
<delete file="${env.JBOSS_HOME}/server/default/deploy/mysql-ds.xml" />
<copy file="${lib.dir}/build/mysql-connector-java.jar"
tofile="${env.JBOSS_HOME}/server/default/lib/mysql-connector-java.jar"
overwrite="true" verbose="true" />
<copy file="${secu-log.dir}/jboss/upt-ds.xml"
tofile="${env.JBOSS_HOME}/server/default/deploy/upt-ds.xml"
overwrite="true" verbose="true" />
<copy file="${secu-log.dir}/jboss/biobank-ds.xml"
tofile="${env.JBOSS_HOME}/server/default/deploy/biobank-ds.xml"
overwrite="true" verbose="true" />
<!-- ignore this war for now
<copy file="${secu-log.dir}/jboss/upt.war"
tofile="${env.JBOSS_HOME}/server/default/deploy/upt.war"
overwrite="true" verbose="true" />
-->
<delete includeemptydirs="true">
<fileset dir="${env.JBOSS_HOME}/server/default/deploy">
<include name="upt*.war"/>
</fileset>
</delete>
<copy file="${war.file}"
tofile="${env.JBOSS_HOME}/server/default/deploy/biobank.war"
overwrite="true" verbose="true"/>
</target>
<target name="build-eclipse-projects"
description="builds the Biobank client Eipse projects">
<antcall target="eclipse-projects" />
</target>
<target name="deploy" description="deploys to JBoss and Eclipse project"
depends="deploy-eclipse,deploy-jboss">
</target>
<target name="build-common-project"
depends="resolve,create-messages-jar,server-manifest">
<copy file="${lib.dir}/messages.jar" todir="${eclipse.proj.dir.common}/lib/client" overwrite="true"/>
<mkdir dir="${eclipse.proj.dir.common}/output" />
<copy includeemptydirs="false" todir="${eclipse.proj.dir.common}/output" overwrite="false">
<fileset dir="${eclipse.proj.dir.common}/src">
<exclude name="**/*.launch" />
<exclude name="**/*.java" />
</fileset>
</copy>
<javac debug="true"
debuglevel="source,lines,vars"
srcdir="${eclipse.proj.dir.common}/src"
destdir="${eclipse.proj.dir.common}/output"
source="1.6"
target="1.6"
includeantruntime="false">
<classpath refid="biobank.common.build.classpath" />
</javac>
</target>
<target name="package-webapp" depends="build-common-project">
<mkdir dir="${output.dir}" />
<delete dir="webapp/db"/>
<copy includeemptydirs="false" todir="webapp">
<fileset dir=".">
<include name="db/migration/*.sql" />
</fileset>
</copy>
<war destfile="${war.file}"
webxml="webapp/WEB-INF/web.xml">
<manifest>
<attribute name="Version" value="${server.version.num}" />
</manifest>
<lib dir="${req.jars.dir}">
<include name="messages.jar" />
</lib>
<lib dir="${req.jars.dir}/biobank.webapp">
<include name="*.jar" />
</lib>
<lib dir="${req.jars.dir}/flyway">
<include name="flyway-core.jar" />
</lib>
<fileset dir="webapp">
<exclude name="**/WEB-INF/**" />
</fileset>
<classes dir="${eclipse.proj.dir.common}/output">
<exclude name="**/client/**" />
</classes>
<webinf dir="webapp/WEB-INF">
<include name="**/*" />
<exclude name="**/web.xml" />
</webinf>
</war>
</target>
<target name="clean-jars" depends="clean-ivy" description="deletes jars from eclipse projects">
<delete>
<fileset dir="${eclipse.proj.dir}/lib" includes="**/*.jar" />
<fileset dir="${eclipse.proj.dir.mvp}/lib" includes="**/*.jar" />
<fileset dir="${eclipse.proj.dir.gui.common}/lib" includes="**/*.jar" />
<fileset dir="${eclipse.proj.dir.common}/lib" includes="**/*.jar" />
<fileset dir="${eclipse.proj.dir.tests}/lib" includes="**/*.jar" />
<fileset dir="${eclipse.proj.dir.tools}/lib" includes="**/*.jar" />
</delete>
</target>
<target name="clean"
depends="clean-tests,clean-tools,clean-jars,clean-product,clean-doxygen"
description="cleans project output, tests, and jars">
<delete dir="${eclipse.proj.dir.common}/output" />
<delete dir="${eclipse.proj.dir.tools}/output" />
<delete dir="${lib.dir}/biobank.webapp" />
<delete dir="${lib.dir}/hibernatetool" />
<delete dir="${lib.dir}/build" />
<delete dir="${lib.dir}/flyway" />
<antcall target="clean-eclipse-projects" />
</target>
<property name="doxygen.output" location="docs/doxygen" />
<target name="clean-product">
<delete dir="${buildDirectory}" />
</target>
<target name="product"
depends="clean-product,versions-update,deploy"
description="build the product">
<!-- buildDirectory is the folder where the plugins and products are found and build -->
<!-- plugins and features are copied into the buildDirectory -->
<copy todir="${buildDirectory}/plugins/biobank2" verbose="true">
<fileset dir="${eclipse.workspace.dir}/biobank2" />
</copy>
<!-- TODO : copy all project containing .nl1. into the plugins folder -->
<copy todir="${buildDirectory}/plugins/biobank.nl1.fr_CA">
<fileset dir="${eclipse.workspace.dir}/biobank.nl1.fr_CA" />
</copy>
<copy todir="${buildDirectory}/plugins/scannerConfig">
<fileset dir="${eclipse.workspace.dir}/scannerConfig" />
</copy>
<copy todir="${buildDirectory}/plugins/biobank.common">
<fileset dir="${eclipse.workspace.dir}/biobank.common" />
</copy>
<copy todir="${buildDirectory}/plugins/labelPrinter">
<fileset dir="${eclipse.workspace.dir}/labelPrinter" />
</copy>
<copy todir="${buildDirectory}/plugins/biobank.gui.common">
<fileset dir="${eclipse.workspace.dir}/biobank.gui.common" />
</copy>
<copy todir="${buildDirectory}/plugins/biobank.mvp">
<fileset dir="${eclipse.workspace.dir}/biobank.mvp" />
</copy>
<copy todir="${buildDirectory}/features/biobank2.feature.core">
<fileset dir="${eclipse.workspace.dir}/biobank2.feature.core" />
</copy>
<copy todir="${buildDirectory}/features/biobank2.feature.platform">
<fileset dir="${eclipse.workspace.dir}/biobank2.feature.platform" />
</copy>
<!-- get current org.eclipse.equinox.launcher jar. If find more than one, will use the last one in the list (should be the last version)-->
<fileset id="launcher.id.all"
dir="${env.ECLIPSE_HOME}/plugins/"
includes="org.eclipse.equinox.launcher_*.jar" />
<last id="launcher.id" count="1">
<fileset refid="launcher.id.all" />
</last>
<!-- get current org.eclipse.pde.build folder. If find more than one, will use the last one in the list (should be the last version) -->
<fileset id="pde.build.id.all"
dir="${env.ECLIPSE_HOME}/plugins/"
includes="org.eclipse.pde.build_*/scripts/productBuild/productBuild.xml" />
<last id="pde.build.id" count="1">
<fileset refid="pde.build.id.all" />
</last>
<!-- launch product creation -->
<java classpath="${toString:launcher.id}"
classname="org.eclipse.equinox.launcher.Main"
failonerror="true"
fork="true">
<arg line="-application org.eclipse.ant.core.antRunner" />
<arg line="-buildfile ${toString:pde.build.id}" />
<arg line="-Dbuilder=${product.dir}" />
<!-- product.dir is used in product/customTarget.xml -->
<arg line="-Dproduct.dir=${product.dir}" />
<!-- instead of fixed paths in product/build.properties: -->
<arg line="-Dproduct=${eclipse.proj.dir}/biobank2.product" />
<arg line="-DbuildDirectory=${product.dir}/buildDirectory" />
<arg line="-DbaseLocation=${env.ECLIPSE_HOME}" />
<arg line="-Djava.client.version.num=${java.client.version.num}" />
<!-- uncomment line below to build a single executable product -->
<!-- arg line="-Dconfigs='win32, win32, x86'" / -->
<!-- arg line="-Dconfigs='linux, gtk, x86_64'" / -->
</java>
<antcall target="updateSiteMetadata" />
</target>
<target name="updateSiteMetadata"
description="Build the update site folder">
<property name="buildDirectory" value="${product.dir}/buildDirectory" />
<property name="updateSiteFolder" value="${buildDirectory}/updateSite" />
<copy todir="${updateSiteFolder}/features/">
<fileset dir="${buildDirectory}/buildRepo/features/" />
</copy>
<copy todir="${updateSiteFolder}/plugins/">
<fileset dir="${buildDirectory}/buildRepo/plugins/" />
</copy>
<fileset id="featureJar.id"
dir="${updateSiteFolder}/features/"
includes="biobank2.feature.core_*.jar" />
<property name="featureJar" refid="featureJar.id" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${product.dir}/ant-contrib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<propertyregex property="featureVersion"
input="${featureJar}"
regexp="biobank2.feature.core_(.*)\.jar"
select="\1"
casesensitive="true" />
<copy file="${product.dir}/site.xml"
tofile="${updateSiteFolder}/site.xml" />
<replace file="${updateSiteFolder}/site.xml"
token="@VERSION@"
value="${featureVersion}" />
<!-- get current org.eclipse.equinox.launcher jar. If find more than one, will use the last one in the list (should be the last version)-->
<fileset id="launcher.id.all"
dir="${env.ECLIPSE_HOME}/plugins/"
includes="org.eclipse.equinox.launcher_*.jar" />
<last id="launcher.id" count="1">
<fileset refid="launcher.id.all" />
</last>
<java classpath="${toString:launcher.id}"
classname="org.eclipse.equinox.launcher.Main"
failonerror="true"
fork="true">
<arg line="-application org.eclipse.equinox.p2.publisher.UpdateSitePublisher" />
<arg line="-source ${updateSiteFolder}" />
<arg line="-compress" />
<arg line="-publishArtifacts" />
<arg line="-consoleLog" />
<arg line="-artifactRepository file:${updateSiteFolder}" />
<arg line="-metadataRepository file:${updateSiteFolder}" />
</java>
</target>
<target name="doxygen" description="generates documentation for the model classes">
<exec executable="${doxygen}">
<arg value="docs/doxygen/doxygen.cfg" />
</exec>
<echo message="point your browser to: file://${doxygen.output}/html/index.html" />
<exec executable="${xsltproc}" dir="docs/doxygen/xml" output="docs/doxygen/xml/all.xml">
<arg value="combine.xslt" />
<arg value="index.xml" />
</exec>
</target>
<target name="clean-doxygen">
<delete dir="docs/doxygen/html" />
<delete dir="docs/doxygen/xml" />
</target>
<!-- (setq nxml-slash-auto-complete-flag t) -->
</project>
<!--
Local Variables:
compile-command: "ant"
End:
-->