-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
388 lines (348 loc) · 15.4 KB
/
build.xml
File metadata and controls
388 lines (348 loc) · 15.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<!--
BioAssay Express WAR (Web Archive) build file
(c) 2016-2019 Collaborative Drug Discovery Inc.
All rights reserved
http://collaborativedrug.com
-->
<project name="BAE-WAR" default="pkg" basedir=".">
<description>BAE Web Archive</description>
<!-- set global properties for this build -->
<property name="bax" location="../bax" />
<property name="baseURL" value="http://localhost:8080/bae" />
<target name="init" depends="check,tslint,buildinfo">
<tstamp />
<mkdir dir="web/WEB-INF/classes" />
<mkdir dir="pkg" />
</target>
<!-- BAX: dependent project in ${bax} (see https://github.com/cdd/bioassay-template) -->
<target name="bax" description="compile the Java sources for BAX">
<ant antfile="${bax}/build.xml" dir="${bax}" target="pkg" inheritall="false" />
<ant antfile="${bax}/build.xml" dir="${bax}" target="pkgAPI" inheritall="false" />
</target>
<!-- Java files for current project -->
<target name="bae" depends="init,bax" description="compile the Java sources for BAE">
<javac srcdir="src" destdir="web/WEB-INF/classes" debug="on" source="14" target="14" encoding="8859_1" listfiles="on" includeantruntime="false">
<classpath refid="classpath.main" />
</javac>
<copy todir="web/WEB-INF/classes">
<fileset dir="src">
<include name="**/*.json" />
<include name="**/*.txt" />
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<!-- cross-compile TypeScript source to JavaScript -->
<target name="js" description="compile TypeScript sources">
<exec executable="tsc" dir="ts" failonerror="true" />
</target>
<target name="jstest" description="compile TypeScript test sources">
<exec executable="tsc" dir="tstest" failonerror="true" />
<exec executable="node" dir="tstest" failonerror="true" >
<arg value="app/main.js"/>
<arg value="--console" />
</exec>
</target>
<!-- build everything-included full web app + application server package -->
<target name="war" depends="bae,js" description="web archive: build it into a WAR file">
<!-- add ",js" to depends above to make it always compile the TypeScript files -->
<jar jarfile="pkg/BioAssayExpress.war" basedir="web" includes="**" zip64Mode="as-needed">
<zipfileset src="${bax}/pkg/BioAssayTemplateAPI.jar" prefix="WEB-INF/classes">
<exclude name="*log4j.properties"/>
<exclude name="com/cdd/bao/Main*.class"/>
<exclude name="com/cdd/bao/editor/**"/>
<exclude name="com/cdd/bao/importer/**"/>
</zipfileset>
<zipfileset src="lib/cdk-core-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-fingerprint-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-interfaces-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-ioformats-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-model-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-ctab-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-data-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-standard-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/cdk-isomorphism-2.2-SNAPSHOT.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/guava-28.1-jre.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/vecmath-1.5.2.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/jwnl-1.3.3.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/mongo-java-driver-3.11.0.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/mongodb-driver-3.11.0.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/opennlp-maxent-3.0.3.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/opennlp-tools-1.9.1.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/opennlp-uima-1.9.1.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/poi-3.17.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/poi-ooxml-3.17.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/poi-ooxml-schemas-3.17.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/poi-scratchpad-3.17.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/commons-collections4-4.4.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/commons-exec-1.3.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/commons-text-1.8.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/xmlbeans-2.6.0.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/javax.json-1.1.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/javax.mail-1.6.2.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/activation-1.1.1.jar" prefix="WEB-INF/classes" />
<zipfileset src="lib/commons-email-1.5.jar" prefix="WEB-INF/classes" />
<zipfileset src="${bax}/lib/apache-log4j-extras-1.2.17.jar" prefix="WEB-INF/classes" />
<zipfileset src="${bax}/lib/log4j-1.2.17.jar" prefix="WEB-INF/classes" />
<zipfileset src="${bax}/lib/slf4j-api-1.7.28.jar" prefix="WEB-INF/classes" />
<zipfileset src="${bax}/lib/slf4j-log4j12-1.7.28.jar" prefix="WEB-INF/classes" />
</jar>
</target>
<target name="jar" depends="bae,js" description="console: build it into a JAR file">
<!-- add ",js" to depends above to make it always compile the TypeScript files -->
<mkdir dir="build/classes" />
<jar jarfile="pkg/BioAssayConsole.jar" basedir="build/classes" zip64Mode="as-needed">
<manifest>
<attribute name="Main-Class" value="com.cdd.bae.main.Main" />
</manifest>
<zipfileset dir="${main.build.dir}" includes="**/*.class" />
<zipfileset src="${bax}/pkg/BioAssayTemplateAPI.jar" />
<zipgroupfileset dir="lib" includes="*.jar" />
<zipfileset src="tomcat-libs/servlet-api.jar" />
<fileset dir="src">
<include name="**/*.json" />
<include name="**/*.properties" />
<include name="**/*.txt" />
</fileset>
</jar>
</target>
<target name="pkg" depends="war,jar" description="package everything" />
<!-- unit tests -->
<property name="test.src.dir" value="test" />
<property name="test.build.dir" value="build/test" />
<property name="selenium.src.dir" value="selenium" />
<property name="selenium.build.dir" value="build/selenium" />
<property name="main.build.dir" value="web/WEB-INF/classes" />
<path id="classpath.main">
<pathelement location="${bax}/pkg/BioAssayTemplateAPI.jar" />
<pathelement location="lib/cdk-core-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-ctab-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-data-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-fingerprint-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-interfaces-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-ioformats-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-isomorphism-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-model-2.2-SNAPSHOT.jar" />
<pathelement location="lib/cdk-standard-2.2-SNAPSHOT.jar" />
<pathelement location="lib/commons-collections4-4.4.jar" />
<pathelement location="lib/commons-exec-1.3.jar" />
<pathelement location="lib/commons-text-1.8.jar" />
<pathelement location="lib/guava-28.1-jre.jar" />
<pathelement location="lib/javax.json-1.1.jar" />
<pathelement location="lib/jwnl-1.3.3.jar" />
<pathelement location="lib/mongo-java-driver-3.11.0.jar" />
<pathelement location="lib/opennlp-maxent-3.0.3.jar" />
<pathelement location="lib/opennlp-tools-1.9.1.jar" />
<pathelement location="lib/opennlp-uima-1.9.1.jar" />
<pathelement location="lib/poi-3.17.jar" />
<pathelement location="lib/poi-ooxml-3.17.jar" />
<pathelement location="lib/poi-ooxml-schemas-3.17.jar" />
<pathelement location="lib/poi-scratchpad-3.17.jar" />
<pathelement location="lib/vecmath-1.5.2.jar" />
<pathelement location="lib/xmlbeans-2.6.0.jar" />
<pathelement location="tomcat-libs/servlet-api.jar" />
<pathelement location="tomcat-libs/jsp-api.jar" />
<pathelement location="tomcat-libs/annotations-api.jar" />
<pathelement location="lib/javax.json-1.1.jar" />
<pathelement location="lib/javax.mail-1.6.2.jar" />
<pathelement location="lib/activation-1.1.1.jar" />
<pathelement location="lib/commons-email-1.5.jar" />
<pathelement location="lib/antlr-2.7.7.jar" />
<pathelement location="lib/api-all-1.0.3.jar" />
<pathelement location="lib/commons-collections-3.2.2.jar" />
<pathelement location="lib/mina-core-2.0.21.jar" />
</path>
<!-- copy the junit-platform jars to ant-s lib directory -->
<path id="classpath.junit">
<pathelement location="lib/ant-junitlauncher.jar" />
<pathelement location="lib/apiguardian-api-1.1.0.jar" />
<pathelement location="lib/junit-jupiter-api-5.5.2.jar" />
<pathelement location="lib/junit-jupiter-engine-5.5.2.jar" />
<pathelement location="lib/junit-platform-commons-1.5.2.jar" />
<pathelement location="lib/junit-platform-engine-1.5.2.jar" />
<pathelement location="lib/junit-platform-launcher-1.5.2.jar" />
<pathelement location="lib/opentest4j-1.2.0.jar" />
</path>
<path id="classpath.common.test">
<pathelement location="lib/byte-buddy-1.10.18.jar" />
<pathelement location="lib/byte-buddy-agent-1.10.18.jar" />
<pathelement location="lib/hamcrest-2.1.jar" />
<pathelement location="lib/mockito-core-3.6.0.jar" />
</path>
<path id="classpath.test">
<pathelement location="lib/mongo-java-server-1.20.0.jar" />
<pathelement location="lib/mongo-java-server-core-1.20.0.jar" />
<pathelement location="lib/mongo-java-server-memory-backend-1.20.0.jar" />
<pathelement location="lib/netty-all-4.1.42.Final.jar" />
<pathelement location="lib/objenesis-3.0.1.jar" />
<pathelement location="${main.build.dir}" />
</path>
<path id="classpath.selenium">
<pathelement location="lib/objenesis-3.0.1.jar" />
<pathelement location="lib/selenium-client-3.141.5.jar" />
<pathelement location="lib/okhttp-3.14.3.jar" />
<pathelement location="lib/okio-1.17.4.jar" />
<pathelement location="lib/commons-exec-1.3.jar" />
<pathelement location="lib/commons-compress-1.8.jar" />
<pathelement location="lib/mongo-java-server-1.15.0.jar" />
<pathelement location="lib/mongo-java-server-core-1.15.0.jar" />
<pathelement location="lib/mongo-java-server-memory-backend-1.15.0.jar" />
<pathelement location="lib/netty-all-4.1.36.Final.jar" />
<pathelement location="${main.build.dir}" />
</path>
<target name="test-compile" depends="bae">
<mkdir dir="${test.build.dir}" />
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" includeantruntime="false" debug="on">
<classpath>
<path refid="classpath.main" />
<path refid="classpath.junit" />
<path refid="classpath.common.test" />
<path refid="classpath.test" />
</classpath>
</javac>
<copy todir="${test.build.dir}">
<fileset dir="test">
<include name="log4j.properties" />
<include name="testData/**" />
<include name="mockito-extensions/**" />
</fileset>
</copy>
</target>
<target name="junit" depends="test-compile" description="run junit">
<junitlauncher printsummary="false" haltonfailure="yes">
<classpath>
<path refid="classpath.main" />
<path refid="classpath.junit" />
<path refid="classpath.common.test" />
<path refid="classpath.test" />
<pathelement location="${test.build.dir}" />
</classpath>
<testclasses>
<fileset dir="${test.build.dir}">
<include name="**/*Test.*" />
</fileset>
<listener classname="com.cdd.testutil.AntJUnit5Listener" resultFile="TEST-unit-results.txt" />
</testclasses>
</junitlauncher>
</target>
<target name="selenium-compile" depends="bae">
<mkdir dir="${selenium.build.dir}" />
<javac srcdir="${selenium.src.dir}" destdir="${selenium.build.dir}" includeantruntime="false" debug="on">
<classpath>
<path refid="classpath.main" />
<path refid="classpath.junit" />
<path refid="classpath.common.test" />
<path refid="classpath.selenium" />
</classpath>
</javac>
<copy todir="${selenium.build.dir}">
<fileset dir="selenium">
<!-- <include name="testData/**" /> -->
</fileset>
</copy>
</target>
<!-- ???
<script language="javascript">
<![CDATA[
var imports = new JavaImporter(java.lang.System);
imports.System.setProperty('baseURL', baseURL)
imports.System.setProperty('headless', '1')
]]>
</script>-->
<target name="selenium" depends="selenium-compile" description="run selenium">
<junitlauncher printsummary="false" haltonfailure="yes">
<classpath>
<path refid="classpath.main" />
<path refid="classpath.junit" />
<path refid="classpath.common.test" />
<path refid="classpath.selenium" />
<pathelement location="${selenium.build.dir}" />
</classpath>
<testclasses>
<fileset dir="${selenium.build.dir}">
<include name="**/*Test.*" />
</fileset>
<listener classname="com.cdd.testutil.SeleniumAntJUnit5Listener" resultFile="TEST-selenium-results.txt" />
</testclasses>
</junitlauncher>
</target>
<target name="clean" description="clean up">
<delete dir="bin" />
<delete dir="build" />
<delete dir="pkg" />
<delete dir="web/WEB-INF/classes" />
</target>
<!-- checkstyle configuration -->
<property name="check.config" location="check/bae_checks.xml" />
<path id="path.check">
<pathelement location="check/checkstyle-8.25-patch.jar" />
<pathelement location="check/checkstyle-8.25-all.jar" />
</path>
<path id="project.sourcepath">
<fileset dir="src">
<include name="**/*" />
</fileset>
<fileset dir="test">
<include name="**/*" />
</fileset>
<fileset dir="selenium">
<include name="**/*" />
</fileset>
</path>
<pathconvert property="classpath.check" refid="path.check" />
<target name="check">
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask" classpath="${classpath.check}" />
<!-- Use failOnViolation="false" to make style violations warning only -->
<checkstyle config="${check.config}">
<path refid="project.sourcepath" />
<classpath path="${classpath.check}" />
<formatter type="plain" />
</checkstyle>
</target>
<target name="tslint">
<exec executable="npm" failonerror="true">
<arg value="run"/> <arg value="eslint"/>
</exec>
<exec executable="npm" failonerror="true">
<arg value="run"/> <arg value="eslinttest"/>
</exec>
<exec executable="npm" failonerror="true">
<arg value="run"/> <arg value="tslint"/>
</exec>
<exec executable="npm" failonerror="true">
<arg value="run"/> <arg value="tslinttest"/>
</exec>
</target>
<target name="buildinfo">
<tstamp>
<format property="buildtime" pattern="yyyy/MM/dd hh:mm aa" timezone="America/New_York" />
</tstamp>
<exec executable="git" resultproperty="git.rc" outputproperty="git.revision" failifexecutionfails="false">
<arg line="rev-parse HEAD" />
</exec>
<condition property="gitrevision" value="git failure">
<not>
<equals arg1="${git.rc}" arg2="0"/>
</not>
</condition>
<condition property="gitrevision" value="${git.revision}">
<equals arg1="${git.rc}" arg2="0"/>
</condition>
<exec executable="git" resultproperty="git.rc" outputproperty="git.branch" failifexecutionfails="false">
<arg line="rev-parse --abbrev-ref HEAD" />
</exec>
<condition property="gitbranch" value="git failure">
<not>
<equals arg1="${git.rc}" arg2="0"/>
</not>
</condition>
<condition property="gitbranch" value="${git.branch}">
<equals arg1="${git.rc}" arg2="0"/>
</condition>
<propertyfile file="src/com/cdd/bae/buildinfo.properties" comment="This file is automatically generated - DO NOT EDIT">
<entry key="buildtime" value="${buildtime}" />
<entry key="gitrevision" value="${gitrevision}" />
<entry key="gitbranch" value="${gitbranch}" />
</propertyfile>
</target>
</project>