-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
363 lines (300 loc) · 15.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
<?xml version="1.0"?>
<!-- This is version 16.2-SNAPSHOT -->
<project name="ManhattanViz" default="run" basedir=".">
<description>
Build file for solutions gwava
Notes:
This is a build file for use with the Jakarta Ant build tool version 1.6.5 or higher.
Prerequisites:
jdk-1.6.0 from http://java.sun.com/javase/downloads/
ant-1.6.5 from http://ant.apache.org/
Build Instructions:
To build, run
ant "target"
on the directory where this file is located with the target you want.
Most useful targets:
usage
compile-gwava
test
inst-plugins
test-inst-plugins
webstart
compile-test
junit
transmartwar
Author:
Ami Khandeshi
</description>
<!-- loads tomcat.home and axis.home from this external properties file -->
<property file="build.properties"/>
<property name="project.title" value="GWAVA" />
<property name="project.rep" value="ManhattanViz"/>
<property name="project.name" value="ManhattanViz" />
<property name="project.display.version" value="2.1g" />
<property name="project.version" value="2.1g" />
<property name="webstart.name" value="gwava"/>
<property name="webstart.root" value="http://postgres-demo.transmartfoundation.org/gwava http://postgres-ci.transmartfoundation.org/gwava http://localhost:10080/gwava http://postgres-test.transmartfoundation.org/gwava /"/>
<!-- List of Pfizer instances from older version
http://AMRL2LP3FWFD58:10080/gwava
http://clinux22.pfizer.com
http://amre1al336.pcld.pfizer.com:8080/pfizerWebstart
http://amrndhl693.pfizer.com
http://amrndhl1040.pfizer.com:10080/pfizerWebstart
http://amrndhl1038.pfizer.com:8000/gwava
http://amrndhl1040.pfizer.com:8000/gwava /"
-->
<!-- project modules -->
<property name="gwava.module" value="gwava"/>
<!-- module directories -->
<property name="gwava.dir" location="${basedir}"/>
<!-- cy.jnlp file -->
<property name="jnlpfile" location="${gwava.dir}/scripts/gwava.jnlp"/>
<property name="jnlp1file" location="${gwava.dir}/scripts/resource.jnlp"/>
<property name="webinfdir" location="${gwava.dir}/scripts/WEB-INF"/>
<!-- module src directories -->
<property name="gwava.src.dir" location="${gwava.dir}/src"/>
<!--<property name="gwava.test.dir" location="${gwava.dir}/test"/>-->
<property name="gwava.lib.dir" location="${gwava.dir}/lib"/>
<property name="gwava.image.dir" location="${gwava.dir}/images"/>
<property name="gwava.help.dir" location="${gwava.dir}/help"/>
<property name="gwava.web-app.dir" location="${gwava.dir}/web-app" />
<!-- module classes directories -->
<property name="gwava.docs.dir" location="${gwava.dir}/docs" />
<property name="gwava.docs.api.dir" location="${gwava.docs.dir}/api" />
<property name="gwava.dist.dir" location="${gwava.dir}/dist"/>
<property name="gwava.build.dir" location="${gwava.dir}/builds"/>
<property name="gwava.build.classes.dir" location="${gwava.build.dir}/classes"/>
<property name="gwava.build.image.dir" location="${gwava.build.classes.dir}/images"/>
<property name="gwava.build.help.dir" location="${gwava.build.classes.dir}/help"/>
<property name="gwava.build.dist.dir" location="${gwava.build.dir}/dist"/>
<property name="gwava.build.dist.lib.dir" location="${gwava.build.dist.dir}/lib"/>
<property name="gwava.keystore.dir" location="${gwava.build.dir}/keystore" />
<!-- test reports -->
<property name="gwava.test.report" location="${gwava.build.dir}/reports"/>
<!-- compilation options -->
<property name="compile.debug" value="on"/>
<property name="compile.optimize" value="off"/>
<property name="compile.deprecation" value="on"/>
<property name="compile.verbose" value="off"/>
<property name="keystore" location="${gwava.keystore.dir}"/>
<property name="keystore.alias" value="transmartKeyStore"/>
<property name="keystore.password" value="transmartKey"/>
<!--===================================================================-->
<!--====== Compilation classpath - add all JARs in lib directory ======-->
<!--===================================================================-->
<path id="gwava.classpath">
<fileset dir="${gwava.lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${gwava.lib.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!--unsing Macro -->
<macrodef name="unsignjar">
<attribute name="jar"/>
<sequential>
<!-- Remove any existing signatures from a JAR file. -->
<tempfile prefix="usignjar-" destdir="${java.io.tmpdir}" property="temp.file"/>
<echo message="Removing signatures from JAR: @{jar}"/>
<mkdir dir="${temp.file}"/>
<unjar src="@{jar}" dest="${temp.file}">
<patternset>
<include name="**"/>
<exclude name="META-INF/*.SF"/>
<exclude name="META-INF/*.DSA"/>
<exclude name="META-INF/*.RSA"/>
</patternset>
</unjar>
<delete file="@{jar}" failonerror="true"/>
<!-- Touch it in case the file didn't have a manifest.
Otherwise the JAR task below will fail if the manifest
file doesn't exist. -->
<mkdir dir="${temp.file}/META-INF"/>
<touch file="${temp.file}/META-INF/MANIFEST.MF"/>
<jar destfile="@{jar}"
basedir="${temp.file}"
includes="**"
manifest="${temp.file}/META-INF/MANIFEST.MF"/>
<delete dir="${temp.file}" failonerror="true"/>
</sequential>
</macrodef>
<!--addManifestToLibMacro -->
<macrodef name="addManifestToLibMacro">
<attribute name="jar"/>
<sequential>
<!-- Remove any existing signatures from a JAR file. -->
<tempfile prefix="usignjar-" destdir="${java.io.tmpdir}" property="temp.file"/>
<echo message="Adding manifest to lib JAR: @{jar} placed in ${java.io.tmpdir} as ${temp.file}"/>
<mkdir dir="${temp.file}"/>
<unjar src="@{jar}" dest="${temp.file}">
</unjar>
<delete file="@{jar}" failonerror="true"/>
<!-- Touch it in case the file didn't have a manifest.
Otherwise the JAR task below will fail if the manifest
file doesn't exist. -->
<mkdir dir="${temp.file}/META-INF"/>
<touch file="${temp.file}/META-INF/MANIFEST.MF"/>
<jar destfile="@{jar}"
basedir="${temp.file}"
includes="**">
<!--manifest="${temp.file}/META-INF/MANIFEST.MF">-->
<manifest>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Application-Name" value="${project.title}"/>
<attribute name="Codebase" value="${webstart.root}" />
</manifest>
</jar>
<delete dir="${temp.file}" failonerror="true"/>
</sequential>
</macrodef>
<!--============================================================================-->
<!--============================ Help on usage ================================-->
<!--============================================================================-->
<target name="usage" description="list down all available targets">
<echo message=""/>
<echo message="${project.name} Build file"/>
<echo message="-------------------------------------------------------------"/>
<echo message=" available targets are:"/>
<echo message=" usage/help/? -> displays this message"/>
<echo message=" compile-gwava -> compiles all java files in src and create a ${project.name}-${gwava.module}-${project.display.version}.jar in dist directory"/>
<echo message=" build-plugins -> create a build/plugins folder and copies ${project.name}-${gwava.module}-${project.display.version}.jar and other dependant jars into this folder"/>
<echo message=" test -> executes particular test cases"/>
<echo message=" clean -> cleans up the build directories"/>
<echo message=" all -> it runs cleanup first then it runs inst-plugins and webstart"/>
<echo message=" transmartwar -> creates signed jar files and packages for javastart-delivery war" />
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
</target>
<target name="help" depends="usage"/>
<target name="?" depends="usage"/>
<target name="init" depends="clean">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${gwava.build.dir}"/>
<mkdir dir="${gwava.build.classes.dir}"/>
<mkdir dir="${gwava.build.dist.dir}"/>
<mkdir dir="${gwava.build.dist.lib.dir}"/>
<mkdir dir="${gwava.dist.dir}"/>
<echo message="--------- ${project.title} ${project.display.version} ---------"/>
<echo message="java.home = ${java.home}"/>
<echo message="base.dir = ${basedir}"/>
<echo message="proj.dir = ${basedir}"/>
</target>
<!--=====================================================================-->
<!--======================== compile solutions gwava ====================-->
<!--=====================================================================-->
<target name="compile-gwava" depends="init" description="compile the gwava source">
<!-- Compile the java code from ${gwava.src.dir} into ${gwava.build.classes.dir} -->
<javac srcdir="${gwava.src.dir}"
destdir="${gwava.build.classes.dir}"
debug="${compile.debug}"
optimize="${compile.optimize}"
verbose="${compile.verbose}"
includeantruntime="false"
deprecation="${compile.deprecation}">
<classpath>
<path refid="gwava.classpath"/>
</classpath>
</javac>
<copy todir="${gwava.build.image.dir}">
<fileset dir="${gwava.image.dir}" includes="*.*" />
</copy>
<copy todir="${gwava.build.help.dir}">
<fileset dir="${gwava.help.dir}" includes="*.*" />
</copy>
<!-- Put everything in ${gwava.build.classes.dir} into the ${gwava.dist.dir} /solutions-gwava-1.0.jar file -->
<jar jarfile="${gwava.build.dist.dir}/${project.name}${project.version}.jar" basedir="${gwava.build.classes.dir}">
<manifest>
<attribute name="Specification-Title" value="Solutions gwava Library"/>
<attribute name="Specification-Version" value="${project.version}"/>
<attribute name="Specification-Vendor" value="Pfizer MRBT"/>
<attribute name="Application-Name" value="${project.title}"/>
<attribute name="Trusted-Only" value="true"/>
<attribute name="Trusted-Library" value="false"/>
<attribute name="Codebase" value="${webstart.root}"/>
<attribute name="Permissions" value="all-permissions"/>
<!--<attribute name="Main-Class" value="com.pfizer.mrbt.genomics.Driver"/>
<attribute name="Class-Path" value="gwava.classpath"/>-->
</manifest>
</jar>
<copy todir="${gwava.build.dist.lib.dir}">
<fileset dir="${gwava.lib.dir}" includes="*.jar" />
</copy>
</target>
<!--==================================================================-->
<!--=============== Run GWAVA ========================================-->
<!--==================================================================-->
<target name="run" depends="compile-gwava" description="run GWAVA application" >
<java jar="${gwava.build.dist.dir}/${project.name}${project.version}.jar" fork="true" spawn="false" maxmemory="512m" >
<arg value="-services=transmart"/>
</java>
</target>
<target name="keytool">
<delete file="${keystore}" failonerror="false" />
<genkey alias="${keystore.alias}" storepass="${keystore.password}" keystore="${keystore}" validity="123456">
<dname>
<param name="CN" value="Pfizer RBT"/>
<param name="OU" value="MRBT"/>
<param name="O" value="Translational Bioinformatics"/>
<param name="L" value="Cambridge"/>
<param name="ST" value="MA"/>
<param name="C" value="US"/>
</dname>
</genkey>
</target>
<target name="signJar" depends="addManifestToLib, keytool" >
<signjar keystore="${keystore}" alias="${keystore.alias}" storepass="${keystore.password}" lazy="true" verbose="false"> <!-- from tianhong -->
<path>
<fileset dir="${gwava.build.dist.dir}" includes="${project.name}${project.version}.jar" />
<fileset dir="${gwava.build.dist.lib.dir}" includes="*.jar" />
</path>
</signjar>
</target>
<!--==================================================================-->
<!--===================== create war file ============================-->
<!--==================================================================-->
<target name="copyAdditionalWarContent" depends="init">
<copy todir="${gwava.build.dir}/dist/help">
<fileset dir="${gwava.help.dir}" />
</copy>
<copy file="${gwava.web-app.dir}/index.html" todir="${gwava.build.dir}/dist"/>
</target>
<target name="justwar" depends="signJar,copyAdditionalWarContent">
<jar jarfile="${gwava.dist.dir}/${webstart.name}.war" basedir="${gwava.build.dir}" />
</target>
<target name="transmartwar" depends="signJar,copyAdditionalWarContent">
<jar jarfile="${gwava.dist.dir}/${webstart.name}.war" basedir="${gwava.build.dir}/dist" />
</target>
<!--==================================================================-->
<!--===================== cleans build directory =====================-->
<!--==================================================================-->
<target name="clean" description="clean up" >
<delete dir="${gwava.build.dir}"/>
</target>
<target name="unsignjar" description="call macro to unsign jar">
<for param="file">
<path>
<fileset dir="${gwava.build.dist.lib.dir}" includes="**/*.jar"/> <!-- pvh changed to builds not build -->
</path>
<sequential>
<unsignjar jar="@{file}"/>
</sequential>
</for>
<unsignjar jar="${gwava.build.dist.dir}/${project.name}${project.version}.jar"/> <!-- pvh changed to builds not build -->
</target>
<target name="addManifestToLib" depends="compile-gwava" description="call macro to unjar and add manifest to all library jars">
<echo message="addManifestToLib operating on dir ${gwava.build.dist.lib.dir}" />
<for param="file">
<path>
<fileset dir="${gwava.build.dist.lib.dir}" includes="**/*.jar"/>
</path>
<sequential>
<addManifestToLibMacro jar="@{file}"/>
</sequential>
</for>
</target>
</project>