-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.xml
668 lines (579 loc) · 31.9 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
<!ENTITY release_targets SYSTEM "./releaseTargets.xml">
]>
<project basedir="." default="targets" name="genepattern">
<import file="test/build.xml"/>
<description>JAR deployment for genepattern</description>
<property name="java.target" value="1.7" />
<property name="java.source" value="1.7" />
<property name="java.debug" value="off" />
<property name="java.optimize" value="on" />
<property name="java.visualizer.target" value="1.7" />
<property name="java.visualizer.source" value="1.7" />
<property location="lib" name="lib_compile" />
<property location="website/WEB-INF/lib" name="lib" />
<property location="src" name="src" />
<property location="build" name="build" />
<property name="junit.report.dir" location="${build}/junit/reports" />
<property location="." name="dist" />
<property name="classpath" value="${lib}/crimson.jar:${lib}/dom.jar:${lib}/ejb.jar:${lib}/genepattern.properties:${lib}/jaxb-rt-1.0-ea.jar:${lib}/jaxp-api.jar:${lib}/log4j-1.2.8.jar:${lib}/omnigene.jar:${lib}/oromatcher.jar:${lib}/runtask.jar:${lib}/sax.jar:${lib}/trove.jar:${lib}/xalan.jar:${lib}/xercesImpl.jar:${lib}/xsltc.jar:${lib}/image.jar:${lib}/colt.jar" />
<property name="common-manifest" value="gp-common.mf" />
<property name="uisupport-manifest" value="ui_support.mf" />
<property name="common-jarname" value="gp-common.jar" />
<property name="full-jarname" value="gp-full.jar" />
<property name="uisupport-jarname" value="ui_support.jar" />
<property name="runtask-jarname" value="runMain.jar" />
<property name="gp-library-jarname" value="GenePattern.jar" />
<!-- signed applet stuff for running visualizers from web page -->
<property name="runVisualizer-jarname" value="runVisualizer.jar" />
<path id="genepattern.root">
<pathelement location="${basedir}" />
</path>
<!-- bring in the release targets from their seperate file -->
&release_targets;
<property name="clover.dest" location="${basedir}/build/clover" />
<property name="clover.home" location="${user.home}/.gp_build/clover/clover-ant-3.2.0" />
<available file="${clover.home}/lib/clover.jar" property="clover.enabled" />
<target name="init-clover" if="clover.enabled">
<taskdef resource="cloverlib.xml" classpath="${clover.home}/lib/clover.jar"/>
<clover-env/>
</target>
<!-- Get all the files in the /lib directory and add them to the -->
<!-- Classpath -->
<target name="targets">
<echo>You probably want to use the following targets:</echo>
<echo>website: builds website (including R and Java clients)</echo>
<echo>tag: tags entire repository prior to an official build</echo>
</target>
<property name="tomcat.home" location="./installer-2014-sp1/gpdist/Tomcat" />
<target name="init" depends="init-clover">
<tstamp />
<property name="genepattern.root" value="${basedir}" />
<property name="genepattern.website" value="${genepattern.root}/website" />
<property name="genepattern.clients" value="${genepattern.root}/clients" />
<property name="genepattern.common" value="${genepattern.root}" />
<property name="genepattern.build" value="${genepattern.root}/build" />
<property name="defaultInstallDir" value="/xchip/gpint/gpdev03/gp-3.2" />
<property name="genepattern.installer" value="${genepattern.root}/installer-2014-sp1" />
<property name="genepattern.package" value="org/genepattern" />
<available file="post-compile.xml" property="post-compile.present" />
<!-- available file="${keyStore}" property="keyStore.present" / -->
<path id="library.classpath">
<fileset dir="${lib_compile}">
<include name="*.jar" />
<include name="*.zip" />
</fileset>
<fileset dir="${lib}">
<include name="*.jar" />
<include name="*.zip" />
</fileset>
<fileset dir="${genepattern.root}">
<include name="*.jar" />
<include name="*.zip" />
</fileset>
</path>
<path id="junit.classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
<fileset dir="test/lib">
<include name="*.jar" />
</fileset>
<pathelement location="${build}/junit/classes" />
<pathelement location="${build}" />
<fileset dir="website/WEB-INF/lib">
<!-- exclude older version of ant, so that we can use from the lib directory -->
<exclude name="ant-1.6.5.jar" />
<exclude name="ant-antlr-1.6.5.jar" />
<exclude name="ant-junit-1.6.5.jar" />
<exclude name="ant-launcher-1.6.5.jar" />
<exclude name="ant-swing-1.6.5.jar" />
<exclude name="groovy-all-1.0.jar" />
<!-- include the rest -->
<include name="*.jar" />
</fileset>
<!-- include src on classpath for tests which call getResourceAsStream -->
<pathelement location="test/src" />
<fileset dir="${clover.home}/lib" erroronmissingdir="false">
<include name="clover.jar" if="clover.enabled" />
</fileset>
</path>
<path id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar" />
<fileset dir="${tomcat.home}/bin">
<include name="*.jar" />
</fileset>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar" />
</fileset>
<fileset dir="build" includes="${full-jarname}" />
<fileset dir="lib" includes="*.jar" />
</path>
<mkdir dir="${build}" />
<mkdir dir="${build}/jars" />
<!-- for debugging only -->
<!-- echo message="My junit.classpath is ${toString:junit.classpath}" / -->
</target>
<target name="clover.clean" description="Deletes the clover database." depends="init" if="clover.enabled">
<clover-clean />
</target>
<target name="clean" depends="init">
<delete dir="applet-build" />
<delete quiet="true" failonerror="false">
<fileset dir="src/" includes="**/*.class" />
<fileset dir="website/" includes="**/*.class" />
<fileset dir="installer-2014-sp1/GP_server_Build_Output/" includes="**/*" />
<fileset dir="installer-2014-sp1/server_Build_Output/" includes="**/*" />
<fileset dir="installer-2014-sp1/" includes=".buildinstaller*.tmp/**" />
</delete>
<delete quiet="true" failonerror="false" includeemptydirs="true">
<fileset dir="build/" includes="**/*" excludes="placeholder.txt, log4j.properties, log4j2.xml" />
</delete>
<!-- <ant antfile="build.xml" dir="clients/MATLAB" target="clean" /> -->
<!--<ant antfile="build.xml" dir="clients/R" target="clean" >-->
<!--<property name="R.client.downloads" location="${R.client.downloads}" />-->
<!--</ant>-->
<delete quiet="true" failonerror="false" dir="${junit.report.dir}" />
<delete quiet="true" failonerror="false" dir="wartemp" />
<delete quiet="true" failonerror="false" dir="ziptemp" />
<delete quiet="true" failonerror="false" file="gp_war.zip" />
</target>
<target name="clean-jspc">
<delete quiet="true" failonerror="false">
<fileset dir="${webapp.path}/WEB-INF/classes/org/apache/jsp" includes="**/*.class" />
<fileset dir="${webapp.path}/WEB-INF/src/org/apache/jsp" includes="**/*.java" />
</delete>
</target>
<target name="clean-all" depends="init, clover.clean, clean-jspc, clean" />
<target name="findbugs" depends="init, compile, common" description="Findbugs static code analysis">
<property name="findbugs.home" value="build_tools/findbugs-3.0.1" />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
<classpath>
<pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
</classpath>
</taskdef>
<findbugs home="${findbugs.home}" output="xml" outputFile="findbugs.xml" excludeFilter="findbugsExcludeFilter.xml">
<auxClasspath path="${library.classpath}" />
<sourcePath path="${basedir}/src" />
<class location="${build}/${full-jarname}" />
</findbugs>
</target>
<target name="compile-junit" depends="init,compile">
<mkdir dir="${build}/junit/classes" />
<javac debug="true"
includeantruntime="false"
classpathref="junit.classpath"
destdir="${build}/junit/classes"
srcdir="test/src"
/>
</target>
<target name="junit" depends="compile-junit">
<mkdir dir="${junit.report.dir}" />
<mkdir dir="${junit.report.dir}/xml" />
<mkdir dir="${junit.report.dir}/html" />
<property name="junit.forkmode" value="once" /> <!-- set forkmode=once to create only a single JVM, set forkmode=perTest to fork a new JVM for each test -->
<!-- junit includeantruntime="yes" printsummary="withOutAndErr" haltonfailure="no" showoutput="yes" filtertrace="off"> -->
<junit includeantruntime="yes" printsummary="no" haltonfailure="no" showoutput="no" filtertrace="on" fork="true" forkmode="${junit.forkmode}">
<formatter type="xml"/>
<classpath refid="junit.classpath" />
<batchtest todir="${junit.report.dir}/xml" filtertrace="on">
<fileset dir="test/src">
<exclude name="org/genepattern/junitutil/*.java" />
<exclude name="**/RecordEulaStub.java" />
<!-- skip the FTP integration tests -->
<exclude name="org/genepattern/server/job/input/TestFileDownloader.java" />
<include name="**/*.java" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${junit.report.dir}">
<fileset dir="${junit.report.dir}/xml">
<include name="*.xml" />
</fileset>
<report format="frames" todir="${junit.report.dir}/html" />
</junitreport>
</target>
<target name="compile" depends="init, initBuildProperties" description="Compiles all the source.">
<javac debug="true"
includeantruntime="false"
source="${java.source}" target="${java.target}"
classpathref="library.classpath"
destdir="${genepattern.build}"
srcdir="${src}"
excludes="org/genepattern/server/analysis/*,org/genepattern/server/handler/*,org/genepattern/jaxb/**"
/>
<copy todir="${genepattern.build}">
<fileset dir="${src}" includes="**/*.xml" />
</copy>
</target>
<target depends="init" name="get_dependencies">
<copy todir="${build}">
<fileset dir="${lib}" includes="**/*.jar" />
</copy>
</target>
<target name="gp-library-doc" depends="init" unless="skipdoc" description="Builds the javadoc for the Java programming API">
<!-- requires https://svnrepos/gp2/modules be checked out to ../modules -->
<property name="gp.modules.src.dir" value="../modules/common/src/" />
<javadoc destdir="clients/Java/doc" Author="no" Public="true" Verbose="false" sourcepath="website/WEB-INF/gp-modules.jar" classpathref="library.classpath">
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/cls/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/featureset/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/gct/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/mage/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/odf/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/res/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/snp/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/stanford/*.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/io/ParseException.java, org/genepattern/io/IOUtil.java,
org/genepattern/io/DefaultDatasetCreator.java, org/genepattern/io/DatasetWriter.java, org/genepattern/io/DatasetParser.java,
org/genepattern/io/DatasetHandler.java, org/genepattern/io/DatasetCreator.java, org/genepattern/module/AnalysisUtil.java,
org/genepattern/module/VisualizerUtil.java" />
<fileset dir="${gp.modules.src.dir}" includes="org/genepattern/matrix/*.java" />
<fileset dir="src">
<include name="org/genepattern/client/GPClient.java" />
<include name="org/genepattern/client/Util.java" />
<include name="org/genepattern/webservice/JobResult.java" />
<include name="org/genepattern/webservice/Parameter.java" />
</fileset>
</javadoc>
</target>
<target name="javadoc-all" depends="compile" unless="skipdoc"
description="Builds the javadoc for all classes in the GP project">
<javadoc destdir="build/javadoc/all" packagenames="org.genepattern.*"
sourcepath="src"
defaultexcludes="yes"
author="true"
version="true"
use="true"
windowtitle="GenePattern API"
classpathref="library.classpath"
>
<doctitle><![CDATA[<h1>GenePattern API</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright (c) 2003-2022 Regents of the University of California and Broad Institute</i>]]></bottom>
</javadoc>
</target>
<target name="javadoc-jobrunner" depends="compile" unless="skipdoc"
description="Builds the javadoc for the JobRunner API">
<javadoc
additionalparam="-Xdoclint:none"
destdir="build/javadoc/jobrunner"
defaultexcludes="yes"
author="true"
version="true"
use="true"
windowtitle="JobRunner API"
classpathref="library.classpath"
>
<!-- jobrunner api -->
<packageset dir="src" defaultexcludes="yes">
<include name="org/genepattern/drm/**" />
<include name="org/genepattern/server/config/**" />
<exclude name="com/dummy/test/doc-files/**"/>
</packageset>
<!-- awsbatch integration -->
<packageset dir="gp-jobrunner-awsbatch/src/main/java" defaultexcludes="yes">
<include name="org/genepattern/server/executor/awsbatch/**"/>
<exclude name="com/dummy/test/doc-files/**"/>
</packageset>
<doctitle><![CDATA[<h1>GenePattern JobRunner API</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright (c) 2003-2022 Regents of the University of California and Broad Institute</i>]]></bottom>
</javadoc>
</target>
<target name="gp-library" depends="init" description="builds GenePattern.zip, the zip file containing the Java programming API">
<jar basedir="${genepattern.build}" defaultexcludes="true" includes="log4j2.xml, log4j.properties, org/**/*.class, edu/**/*.class, **/*.xml" jarfile="${genepattern.build}/${gp-library-jarname}">
<manifest>
<attribute name="Class-Path" value="./lib/axis.jar ./lib/commons-codec-1.6.jar ./lib/commons-discovery-0.2.jar ./lib/commons-httpclient-3.1.jar ./lib/commons-logging.jar ./lib/gp-modules.jar ./lib/jaxb-rt-1.0-ea.jar ./lib/jaxrpc.jar ./lib/log4j-1.2-api-2.12.4.jar ./lib/log4j-api-2.12.4.jar ./lib/log4j-core-2.12.4.jar ./lib/javax.mail.jar ./lib/saaj.jar ./lib/trove.jar ./lib/wsdl4j-1.5.1.jar ./lib/Jama-1.0.1.jar ./lib/MAGEstk-2003-10-24-v1.1-compatible.jar " />
</manifest>
</jar>
<zip destfile="build/GenePattern.zip">
<zipfileset dir="${genepattern.build}">
<include name="${gp-library-jarname}" />
</zipfileset>
<zipfileset dir="website/WEB-INF/lib" prefix="lib" includes="axis.jar commons-codec-1.6.jar commons-discovery-0.2.jar commons-httpclient-3.1.jar commons-logging.jar gp-modules.jar jaxb-rt-1.0-ea.jar jaxrpc.jar log4j-1.2.17.jar javax.mail.jar saaj.jar trove.jar wsdl4j-1.5.1.jar Jama-1.0.1.jar MAGEstk-2003-10-24-v1.1-compatible.jar guava-15.0.jar" />
<zipfileset dir="clients/Java/doc" prefix="doc" />
</zip>
</target>
<target name="common" depends="init,compile,compile-jspc"
description="Create the gp-full.jar file in the build directory"
>
<!-- Makes gp-common.jar -->
<jar basedir="${genepattern.build}" defaultexcludes="true" excludes="org/genepattern/util/RunGenePatternTaskMain.class org/genepattern/util/GenePatternNetworkClassLoader.class,org/genepattern/server/**,org/genepattern/resources/**,**/*.java,**/*.form,**/*.nbattrs" includes="org/**/*.class" jarfile="${genepattern.build}/${common-jarname}" />
<!-- get code fragments for pipeline code generation -->
<copy todir="${build}">
<fileset dir="${src}" includes="**/*.code" />
</copy>
<jar basedir="${genepattern.build}" defaultexcludes="true" excludes="**/*.form,**/*.nbattrs" includes="org/**/*.class, edu/mit/genome/gp/ui/analysis/*.class, **/*.xml" jarfile="${genepattern.build}/${full-jarname}" />
<jar basedir="${genepattern.build}" defaultexcludes="true" excludes="**/*.form,**/*.nbattrs" includes="edu/mit/genome/gp/ui/analysis/*.class" jarfile="${genepattern.build}/analysis.jar">
<manifest>
<attribute name="Class-Path" value="${full-jarname} hsqldb.jar xalan.jar saaj.jar jaxrpc.jar jaxb-rt-1.0-ea.jar" />
</manifest>
</jar>
</target>
<target depends="init" name="runtask">
<javac debug="true"
includeantruntime="false"
classpathref="library.classpath"
destdir="${genepattern.build}"
srcdir="${src}"
source="${java.source}"
target="${java.target}"
includes="org/genepattern/util/RunGenePatternTaskMain.java"
/>
<!-- Makes runMain.jar -->
<jar basedir="${genepattern.build}" defaultexcludes="true" excludes="**/*.form,**/*.nbattrs" includes="org/genepattern/util/RunGenePatternTaskMain.class edu/mit/genome/gp/util/GenePatternNetworkClassLoader.class" jarfile="${genepattern.build}/${runtask-jarname}">
<manifest>
<attribute name="Main-Class" value="org.genepattern.RunGenePatternTaskMain" />
</manifest>
</jar>
</target>
<target depends="init,compile" name="uisupport">
<jar basedir="${genepattern.build}" defaultexcludes="true" excludes="**/*.java,**/*.form,**/*.nbattrs" includes="org/genepattern/modules/ui/,org/genepattern/module/" jarfile="${genepattern.build}/${uisupport-jarname}" />
</target>
<target depends="common,compile,get_dependencies,init,runtask,uisupport" name="package">
</target>
<target depends="init" name="jwhich">
<java classname="org.genepattern.debug.JWhich" classpathref="library.classpath" dir="${build}" fork="true">
<arg value="javax.ejb.EJBObject" />
</java>
</target>
<target depends="init" name="prepare-compile" unless="prepare.disable">
<mkdir dir="${genepattern.build}" />
</target>
<target depends="init" name="runsuite">
<java classname="org.genepattern.server.process.SuiteRepository">
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${build}" />
</classpath>
</java>
</target>
<target name="clients" depends="R-client,matlabclient">
</target>
<property name="R.client.downloads" location="clients/R/downloads" />
<target name="R-client" depends="init, gp-library">
<ant antfile="build.xml" dir="${genepattern.root}/clients/R">
<property name="R.client.downloads" location="${R.client.downloads}" />
</ant>
</target>
<target name="matlabclient" depends="gp-library, analysis">
<ant antfile="build.xml" dir="${genepattern.root}/clients/MATLAB" />
</target>
<target name="analysis" depends="init,common,runtask,uisupport">
<jar jarfile="${build}/gpwebservice.jar">
<fileset dir="${build}">
<include name="org/apache/xml/**" />
<include name="org/genepattern/**" />
</fileset>
</jar>
</target>
<target name="show-version" depends="initBuildProperties">
<echo>
genepattern.version: ${genepattern.version}
version.label: ${version.label}
version.revision.id: ${version.revision.id}
version.build.date: ${version.build.date}
</echo>
</target>
<target name="installers" depends="website">
<ant dir="${genepattern.installer}" inheritall="false" inheritrefs="false" target="installers" />
</target>
<target name="build-visualizer-applet" depends="jar-visualizer-applet" />
<target name="compile-visualizer-applet" depends="init">
<mkdir dir="applet-build" />
<javac debug="true"
includeantruntime="false"
destdir="applet-build"
srcdir="src"
classpathref="library.classpath"
includes="org/genepattern/visualizer/*.java"
target="${java.visualizer.target}"
source="${java.visualizer.source}" />
</target>
<target name="jar-visualizer-applet" depends="compile-visualizer-applet">
<mkdir dir="${genepattern.build}/META-INF" />
<manifest file="${genepattern.build}/META-INF/MANIFEST.MF">
<attribute name="Permissions" value="all-permissions" />
<attribute name="Trusted-Library" value="true" />
<attribute name="Application-Name" value="GenePattern Visualizer launcher" />
</manifest>
<jar basedir="applet-build"
manifest="${genepattern.build}/META-INF/MANIFEST.MF"
defaultexcludes="true"
includes="org/genepattern/visualizer/*.class"
jarfile="${genepattern.build}/${runVisualizer-jarname}">
</jar>
</target>
<macrodef name="signjar" uri="http://genepattern.org/gp">
<attribute name="jarfile" />
<element name="sysproperties" />
<sequential>
<echo>signing @{jarfile} with keystore=${signjar.keystore}</echo>
<signjar jar="@{jarfile}"
preservelastmodified="true"
keystore="${signjar.keystore}"
maxmemory="1024M"
alias="${signjar.alias}"
storepass="${signjar.storepass}"
tsaurl="${signjar.tsaurl}"
/>
</sequential>
</macrodef>
<target name="init-signjar">
<!-- load signjar.properties -->
<property file="${user.home}/.gp_build/signjar.properties" />
<property file="signjar.properties" />
<!-- for properties not set in 'signjar.properties', set defaults directly -->
<property name="signjar.keystore" location="${build}/keystore" />
<property name="signjar.alias" value="Genepattern" />
<!-- if not otherwise defined, prompt for password -->
<input message="Password for Jar Signing Key: " addproperty="signjar.storepass" defaultValue="gEnEpAtTeRn">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<available file="${signjar.keystore}" property="keyStore.present" />
<!--
Set the time-stamp authority url for signing the jar file.
signjar ... -t {signjar.tsaurl} ...
Time-stamping allows signed jar files to be used after the signing certificate expires.
Additional time-stamp authorities are listed here (https://www.entrust.com/what-is-time-stamping/):
RFC 3161 (SHA-1) – http://timestamp.entrust.net/TSS/RFC3161sha1TS
-->
<property name="signjar.tsaurl" value="https://timestamp.geotrust.com/tsa" />
</target>
<target name="makeKeystore" depends="init-signjar" unless="keyStore.present">
<genkey alias="GenePattern" keypass="${signjar.storepass}" storepass="${signjar.storepass}" keystore="${signjar.keystore}" keyalg="RSA">
<dname>
<param name="CN" value="GenePattern" />
<param name="OU" value="Cancer Genomics" />
<param name="O" value="Broad Institute" />
<param name="L" value="Cambridge" />
<param name="S" value="MA" />
<param name="C" value="US" />
<param name="EMAILADDRESS" value="genepattern-team@broadinstitute.org" />
</dname>
</genkey>
</target>
<target name="sign-visualizer-applet" depends="jar-visualizer-applet,init-signjar,makeKeystore"
description="Sign the visualizer applet jar files"
xmlns:gp="http://genepattern.org/gp"
>
<gp:signjar jarfile="${genepattern.build}/${runVisualizer-jarname}">
<sysproperties>
<sysproperty key="https.protocols" value="TLSv1.2" />
</sysproperties>
</gp:signjar>
<gp:signjar jarfile="external-src/commons-httpclient-3.0.1/dist/commons-httpclient.jar" />
<gp:signjar jarfile="website/WEB-INF/lib/commons-codec-1.6.jar" />
</target>
<!-- =================================================================== -->
<!-- Custom post-compilation step -->
<!-- =================================================================== -->
<target depends="init" if="post-compile.present" name="post-compile">
<ant antfile="post-compile.xml" dir="${genepattern.root}" />
</target>
<!-- classpathref="library.classpath" -->
<target depends="init,prepare-compile,common,analysis,build-visualizer-applet" name="website">
<mkdir dir="${genepattern.build}/website/classes" />
<mkdir dir="${genepattern.build}/website/lib" />
<ant antfile="build.xml" dir="${genepattern.root}/clients/MATLAB" />
<mkdir dir="${genepattern.website}/WEB-INF/classes" />
<javac debug="true"
includeantruntime="false"
destdir="${genepattern.build}/website/classes"
srcdir="${genepattern.website}/WEB-INF/classes"
classpathref="library.classpath"
/>
<!-- copy the web sites jar files to build/web-site/lib -->
<!-- ***** NOTE THAT THIS IS THE DEFINITIVE LIST ****** -->
<copy todir="${genepattern.build}/website/lib">
<fileset dir="${lib}">
<include name="axis.jar" />
<include name="axis-ant.jar" />
<include name="commons-discovery-0.2.jar" />
<include name="commons-logging.jar" />
<include name="commons-fileupload-1.1.1.jar" />
<include name="commons-io-2.0.1.jar" />
<include name="hsqldb.jar" />
<include name="jaxb-rt-1.0-ea.jar" />
<include name="jaxp.jar" />
<include name="jaxrpc.jar" />
<include name="jdom.jar" />
<include name="jspsmart.jar" />
<include name="log4j-1.2.8.jar" />
<include name="javax.mail.jar" />
<include name="PDFBox*.jar" />
<include name="saaj.jar" />
<include name="wsdl4j-1.5.1.jar" />
<include name="xalan.jar" />
</fileset>
<fileset dir="${genepattern.build}" includes="${full-jarname}" />
</copy>
<!-- Now call any custom post-compilation people want to do -->
<antcall target="post-compile" inheritall="true" inheritrefs="true" />
</target>
<target depends="init,common,analysis,build-visualizer-applet" name="quick-website">
<mkdir dir="${genepattern.build}/website/classes" />
<javac debug="true"
includeantruntime="false"
destdir="${genepattern.build}/website/classes"
srcdir="${genepattern.website}/WEB-INF/classes"
classpathref="library.classpath"
/>
<!-- Now call any custom post-compilation people want to do -->
<antcall target="post-compile" />
</target>
<target name="initBuildProperties"
description="Updates the build.properties file." >
<property file="build.versionNumbers" />
<property name="build.properties.file" value="website/WEB-INF/build.properties" />
<propertyfile file="${build.properties.file}" comment="Created by ANT; defines the build version, date etc.">
<entry key="genepattern.version" type="string" value="${genepattern.version}" />
<entry key="version.label" type="string" value="${version.label}" />
<entry key="version.revision.id" type="string" value="${version}" />
<entry key="version.build.date" type="date" pattern="yyyy-MM-dd HH:mm" value="${TSTAMP}" />
<entry key="builders.name" operation="=" type="string" value="${user.name}" />
<!-- add entries required for GenePattern Client installation -->
<entry key="build" operation="=" pattern="yyyyMMdd" type="date" value="now" />
<entry key="date" pattern="EEE, MMM d yyyy" type="date" value="now" />
<entry key="version.major" operation="=" type="int" value="${version.major}" />
<entry key="version.minor" operation="=" type="string" value="${version.minor}" />
<entry key="version.revision" operation="=" type="int" value="0" default="-1" />
<entry key="count" operation="+" type="int" default="0" />
<entry key="release" operation="=" type="string" value="" />
<entry key="program.name" operation="=" type="string" value="GenePattern Client" />
<entry key="build.tag" operation="=" type="string" value="${version}" />
</propertyfile>
<property file="${build.properties.file}" />
</target>
<target name="nightlyBuild" depends="initBuildProperties, website, gp-library, installers, createWar, copyWar" />
<property name="webapp.path" value="website" />
<target name="jspc" depends="init" description="generate .java files from .jsp files">
<property name="output.dir" value="${webapp.path}/WEB-INF/src" />
<mkdir dir="${webapp.path}/WEB-INF/src" />
<delete>
<fileset dir="${output.dir}" includes="**" />
</delete>
<taskdef classname="org.apache.jasper.JspC" name="jasper2" classpathref="jspc.classpath" />
<jasper2 validateXml="false" uriroot="${webapp.path}" addWebXmlMappings="true" webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml" outputDir="${output.dir}" />
</target>
<target name="compile-jspc" depends="jspc, compile" description="generate .class files from .jsp files">
<mkdir dir="${webapp.path}/WEB-INF/classes" />
<javac debug="${java.debug}"
includeantruntime="false"
source="${java.source}" target="${java.target}"
optimize="${java.optimize}"
destdir="${webapp.path}/WEB-INF/classes"
srcdir="${webapp.path}/WEB-INF/src"
>
<classpath>
<path refid="library.classpath" />
<path refid="jspc.classpath" />
<pathelement location="${genepattern.build}" />
</classpath>
</javac>
</target>
</project>