-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
363 lines (294 loc) · 17.1 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
<project name="orchem.project" default="help" basedir=".">
<property name="app.name" value="orchem"/>
<property name="compile.debug" value="true"/>
<property name="project.root" value="."/>
<property name="src.dir" value="${project.root}/src"/>
<property name="web.dir" value="${project.root}/public_html"/>
<property name="test.dir" value="${project.root}/test"/>
<property name="build.classes" value="${web.dir}/WEB-INF/classes"/>
<property name="lib.dir" value="${web.dir}/WEB-INF/lib"/>
<property name="lib.prefix" value="public_html/WEB-INF/lib"/>
<property name="war.dir" value="${project.root}/deploy"/>
<property name="dist.dir" value="${project.root}/dist"/>
<!-- Build working classpath -->
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement path="${build.classes}"/>
<pathelement path="${src.dir}"/>
</path>
<!-- =================================-->
<!-- Prints usuage -->
<!-- =====+++++=======================-->
<target name="help">
<echo message="***************************************************************************"/>
<echo message="The following ANT targets are available in the build.xml:"/>
<echo message="clean - delete all build directories, as well as /build files "/>
<echo message="compile - compile core classes"/>
<echo message="war - clean, compile, and create WAR file (tested Tomcat6) "/>
<echo message="dist - make a tar.gz for OrChem releases "/>
<echo message="***************************************************************************"/>
</target>
<!-- =================================================================== -->
<!-- Clean the build directories and war file -->
<!-- =================================================================== -->
<target name="clean">
<echo message="Cleaning up compiled classes and other temp data in ${web.dir}"/>
<delete>
<fileset dir="${build.classes}" includes="**/orchem*.*"/>
</delete>
<delete dir="${build.classes}/.jsps" />
<delete dir="${build.classes}/.tags" />
<delete dir="${build.classes}/.wlLibs"/>
<delete dir="${build.classes}/uk" />
<delete dir="${build.classes}/org" />
<echo message="Deleting old war file.."/>
<delete file="${war.dir}/*.war"/>
<delete file="${build.classes}/webapp.properties"/>
<delete file="${build.classes}/unittest.properties"/>
</target>
<!-- =================================================================== -->
<!-- Compile -->
<!-- =================================================================== -->
<target name="compile">
<!-- compile the Java classes -->
<javac srcdir="${src.dir}" destdir="${build.classes}" source="1.5" target="1.5">
<classpath refid="project.classpath"/>
<include name="**/*.java"/>
<exclude name="**/PubChemImport.java"/>
<exclude name="**/ImageServlet.java"/>
</javac>
<copy file="${project.root}/properties/my_local_copies/unittest.properties" tofile="${build.classes}/unittest.properties" overwrite="true"/>
<copy file="${project.root}/properties/my_local_copies/webapp.properties" tofile="${build.classes}/webapp.properties" overwrite="true"/>
</target>
<!-- =================================================================== -->
<!-- Compile WAR -->
<!-- =================================================================== -->
<target name="compile-war">
<!-- compile the Java classes -->
<javac srcdir="${src.dir}" destdir="${build.classes}">
<classpath refid="project.classpath"/>
<include name="**/*.java"/>
<exclude name="**/PubChemImport.java"/>
</javac>
<copy file="${project.root}/properties/my_local_copies/unittest.properties" tofile="${build.classes}/unittest.properties" overwrite="true"/>
<copy file="${project.root}/properties/my_local_copies/webapp.properties" tofile="${build.classes}/webapp.properties" overwrite="true"/>
</target>
<!-- =================================================================== -->
<!-- Make WAR -->
<!-- =================================================================== -->
<target name="war" depends="clean,compile-war">
<echo message="Making WAR file"/>
<mkdir dir="${war.dir}"/>
<!-- we have several web.xml versions. make sure the tomcat version is copied to web.xml before jar runs -->
<copy file="${web.dir}/WEB-INF/web.tomcat6.xml" tofile="${web.dir}/WEB-INF/web.xml" overwrite="true"/>
<jar jarfile="${war.dir}/${app.name}.war" basedir="${web.dir}"
includes="**" excludes="**/junit.jar **/cdk-1.1.2.jar **/*servlet*.jar **/lucene*.jar **/jgrapht*.jar **/vecmath.jar **/old " />
<!-- put the default webXXXxml back in place -->
<copy file="${web.dir}/WEB-INF/web.jdev11.xml" tofile="${web.dir}/WEB-INF/web.xml" overwrite="true"/>
</target>
<!-- =================================================================== -->
<!-- Generate code for QSAR descriptors -->
<!-- =================================================================== -->
<target name="dev.qsar.codegen" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" Generating QSAR descriptors Java and SQL source "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<java dir="${project.root}" maxmemory="1024m" classname="uk.ac.ebi.orchem.codegen.QSARGenerator" fork="true">
<classpath refid="project.classpath" />
</java>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Unittest substructure searching -->
<!-- =================================================================== -->
<target name="test.substr" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" JUnit test: substructure searching "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<!-- easiest way to make this work is to put junit.jar in the ANT_HOME/lib dir. But see also ant manual .. -->
<echo message="$project.classpath"/>
<junit maxmemory="1024m" fork="no">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<!--formatter type="xml" usefile="false" /-->
<test name="uk.ac.ebi.orchem.test.TestSubstructureSearch" />
</junit>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Unittest similarity searching -->
<!-- =================================================================== -->
<target name="test.simsrch" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" JUnit test: similarity searching "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<!-- easiest way to make this work is to put junit.jar in the ANT_HOME/lib dir. But see also ant manual .. -->
<!--junit jvm="/usr/java/jdk1.6.0_14/bin/java" fork="on"-->
<junit maxmemory="1024m" fork="yes">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<test name="uk.ac.ebi.orchem.test.TestSimilaritySearch" />
</junit>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Unittest Smartie pants searching -->
<!-- =================================================================== -->
<target name="test.smartsrch" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" JUnit test: SMARTS searching "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<junit maxmemory="1024m" fork="yes">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<test name="uk.ac.ebi.orchem.test.TestSMARTSSearch" />
</junit>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Unittest convert -->
<!-- =================================================================== -->
<target name="test.conv" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" JUnit test: convert "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<!-- easiest way to make this work is to put junit.jar in the ANT_HOME/lib dir. But see also ant manual .. -->
<junit maxmemory="1024m" fork="yes">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<test name="uk.ac.ebi.orchem.test.TestConvert" />
</junit>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Unittest qsar descriptors -->
<!-- =================================================================== -->
<target name="test.qsar" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" JUnit test: qsar "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<!-- easiest way to make this work is to put junit.jar in the ANT_HOME/lib dir. But see also ant manual .. -->
<junit maxmemory="1024m" fork="yes">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<test name="uk.ac.ebi.orchem.test.TestQSAR" />
</junit>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Unittest RGroup queries -->
<!-- =================================================================== -->
<target name="test.rgroup" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" JUnit test: RGroup queries "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<junit maxmemory="1024m" fork="yes">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<test name="uk.ac.ebi.orchem.test.TestRgroupQuery" />
</junit>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Unittest propert calculation descriptors -->
<!-- =================================================================== -->
<target name="test.calc" depends="compile">
<echo />
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo message=" JUnit test: calculation of mass/charge/formula etc "/>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<junit maxmemory="1024m" fork="yes">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<test name="uk.ac.ebi.orchem.test.TestCalculation" />
</junit>
<echo message="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>
<echo />
</target>
<!-- =================================================================== -->
<!-- Make a tarball for people to download and install OrChem. -->
<!-- Not all classes are required, just the 'core' set that go into DB -->
<!-- =================================================================== -->
<target name="dist" depends="compile">
<echo message="Making a distro"/>
<delete dir="${dist.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/sql"/>
<!-- Copy the DDL create scripts we need -->
<copy todir="${dist.dir}/sql">
<fileset dir="${project.root}/sql">
<include name="**/*.sql"/>
<include name="**/*.plsql"/>
<exclude name="**/drop.sql"/>
</fileset>
</copy>
<!-- For user convenience, remove the sql*plus "exit;" commands (put there for step1.pl in Unit testing) -->
<replace dir="${dist.dir}/sql" token="exit 1;" value=" ">
<include name="**/*.sql"/>
<include name="**/*.plsql"/>
</replace>
<!-- Put required OrChem classes in a temporary jar -->
<jar jarfile="${lib.dir}/${app.name}.jar" basedir="${build.classes}"
includes="**/uk/ac/ebi/orchem/bean/*
**/uk/ac/ebi/orchem/search/*
**/uk/ac/ebi/orchem/load/*
**/uk/ac/ebi/orchem/fingerprint/*
**/uk/ac/ebi/orchem/fingerprint/bitpos/*
**/uk/ac/ebi/orchem/shared/AtomsBondsCounter.class
**/uk/ac/ebi/orchem/shared/MoleculeCreator.class
**/uk/ac/ebi/orchem/Utils.class
**/uk/ac/ebi/orchem/test/VerifyOrchem.class
**/uk/ac/ebi/orchem/SimpleMail.class
**/uk/ac/ebi/orchem/db/OrChemParameters.class
**/uk/ac/ebi/orchem/singleton/FingerPrinterAgent.class
**/uk/ac/ebi/orchem/temp/*
**/uk/ac/ebi/orchem/isomorphism/*
**/uk/ac/ebi/orchem/convert/*
**/uk/ac/ebi/orchem/calc/*
**/uk/ac/ebi/orchem/isomorphism/*
**/uk/ac/ebi/orchem/convert/*
**/uk/ac/ebi/orchem/qsar/*
**/uk/ac/ebi/orchem/tautomers/*
" />
<!-- Put all required jar files and DDL in a tar file -->
<tar destfile="${dist.dir}/${app.name}.tar">
<tarfileset dir="${lib.dir}" prefix="/orchem/lib/">
<include name="vecmath.jar"/>
<include name="commons-collections-3.2.1.jar"/>
<include name="jgrapht-0.6.0.jar"/>
<include name="log4j-1.2.15.jar"/>
<include name="cdk.jar"/>
<include name="jcp.jar"/>
<include name="inchi103.jar"/>
<include name="nestedVm.jar"/>
<include name="jama-1.0.2.jar"/>
<include name="ambit2.smarts.jar"/>
<include name="${app.name}.jar"/>
</tarfileset>
<tarfileset dir="${dist.dir}/sql" prefix="/orchem/sql/">
<include name="*.sql"/>
<include name="*.plsql"/>
</tarfileset>
</tar>
<gzip zipfile="${dist.dir}/${app.name}.tar.gz" src="${dist.dir}/${app.name}.tar" />
<delete file="${dist.dir}/${app.name}.tar"/>
<delete dir="${dist.dir}/sql"/>
</target>
</project>