JWS-128 patch out log4j references in the compbio.FileUtil class, and corresponding...
[jabaws.git] / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <project default="build-all" name="Build Java Bioinformatics Analysis Web Services" basedir=".">
4
5         <property name="LD_LIBRARY_PATH" value="/gridware/sge/lib/lx-amd64"/>
6         <property name="JAVA_TARGET" value="1.7"/>
7
8         <!-- Distributive file names-->
9         <property name="distdir" value="website/archive"/>
10         <mkdir dir="${distdir}" />
11
12         <!-- projects details -->
13         <property name="project.url" value="http://www.compbio.dundee.ac.uk/jabaws"/>
14         <property name="product" value="Java Bioinformatics Analyses Web Services"/>
15         <property name="author" value="Fabio Madeira, Jim Procter, Alexander Sherstnev, Dan Barton, Peter Troshin"/>
16
17         <!-- dependencies on other compbio projects  -->
18         <property name="compbio-annotation" value="compbio-annotations-1.0.jar"/>
19         <property name="compbio-ga" value="compbio-ga-1.1.jar"/>
20
21         <!-- products -->
22         <property name="jabaws_version" value="2.2.1"/>
23         <property name="core" value="${distdir}/jabaws-core-${jabaws_version}.jar"/>
24         <property name="core-src" value="${distdir}/jabaws-core-src-${jabaws_version}.jar"/>
25         <property name="datamodel" value="${distdir}/datamodel-${jabaws_version}.jar"/>
26         <property name="datamodel-src" value="${distdir}/datamodel-src-${jabaws_version}.jar"/>
27         <property name="min-jabaws-client" value="${distdir}/jabaws-min-client-${jabaws_version}.jar"/>
28         <property name="min-jabaws-client-nolog" value="${distdir}/jabaws-min-client-nolog-${jabaws_version}.jar"/>
29         <property name="jabaws-client-src" value="${distdir}/jabaws-client-src-${jabaws_version}.jar"/>
30         <property name="full-jabaws-client" value="${distdir}/jabaws-full-client-${jabaws_version}.jar"/>
31         <property name="jabaws-source-jar" value="${distdir}/jabaws-src-${jabaws_version}.jar"/>
32         <property name="full-jabaws-client-pack" value="${distdir}/jabaws-full-client-${jabaws_version}-pack.zip"/>
33         <property name="jabaws" value="${distdir}/jabaws.war"/>
34         <property name="jabaws-no-binaries" value="${distdir}/jabaws-no-binaries.war"/>
35         <property name="binaries" value="${distdir}/jabaws-binaries.zip"/>
36         <property name="jabaws-devel-web" value="${distdir}/jabaws-devel-website.zip"/>
37
38         <!--Whole project archive -->
39         <property name="jabaws-project" value="${distdir}/jabaws-project.zip"/>
40
41         <!-- java -->
42         <property name="test.src" location="${basedir}/testsrc" />
43         <property name="classes" location="${basedir}/WEB-INF/classes" />
44         <property name="lib.path" location="${basedir}/lib" />
45         <property name="web.lib.path" location="${basedir}/WEB-INF/lib" />
46         <property name="test.lib.path" location="${basedir}/testsrc/lib" />
47         <property name="activity.log" location="${basedir}/activity.log" />
48
49         <!-- add libraries -->
50         <path id="project.classpath">
51                 <fileset dir="${lib.path}">
52                         <include name="*.jar" />
53                 </fileset>
54                 <fileset dir="${web.lib.path}">
55                         <include name="*.jar" />
56                 </fileset>
57         </path>
58
59         <!-- add test classes -->
60         <path id="test.classpath">
61                 <fileset dir="${test.lib.path}">
62                         <include name="*.jar" />
63                 </fileset>
64                 <pathelement location="${classes}" />
65         </path>
66
67         <fileset dir="${basedir}/WEB-INF/classes/" id="fullclient">
68                 <!-- Datamodel -->
69                 <include name="compbio/data/**"/>
70                 <include name="compbio/metadata/**"/>
71                 <!-- Engines -->
72                 <include name="compbio/engine/**"/>
73                 <!-- Runners -->
74                 <include name="compbio/runner/**"/>
75                 <!-- Logging configuration -->
76         </fileset>
77
78         <!-- Clean temp directories -->
79         <target name="clean">
80                 <delete dir="${classes}" />
81                 <delete dir="${basedir}/logs" />
82                 <delete file="${distdir}/binaries.zip" />
83                 <delete file="${basedir}/activity.log" />
84                 <delete file="${basedir}/derby.log" />
85                 <mkdir dir="${classes}" />
86                 <copy file="${basedir}/log/log4j2.properties" tofile="${classes}/log4j2.properties" />
87         </target>
88
89         <!-- Clean up temp directories and dist directory (all jar, zip, and war files deleted) -->
90         <target name="full-clean" depends="clean">
91                 <delete>
92                         <fileset dir="${distdir}">
93                                 <include name="*.jar"/>
94                                 <include name="*.zip"/>
95                                 <include name="*.war"/>
96                         </fileset>
97                 </delete>
98         </target>
99
100         <target name="clearStatDB" description="Remove all records from statistics database">
101                 <echo>Cleaning Statistics database</echo>
102                 <java classname="compbio.stat.collector.StatDB" fork="true" failonerror="true" classpath="${classes}">
103                         <jvmarg value="-Dlog4j.configurationFile=log/log4j.statdb.properties" />
104                         <classpath refid="project.classpath" />
105                 </java>
106         </target>
107
108         <!--
109         The compilation order is 
110         1. datamodel 
111         2. engine
112         3. runner
113         4. testscr
114         5. webservices
115         Packages of the lower order could not have dependencies on the packages on the next layer. 
116         So runners (layer 3) depends on the engines and the datamodel but engines does not depend on 
117         anything in runners or any other layers above. Testsrc is not allowed to test webservices. 
118         -->
119         <target name="compile" depends="clean" description="Perform a multiple step compilation to ensure layered structure is preserved. Debug enabled.">
120                 <!-- copy files to class path-->
121                 <copy file="${basedir}/log/log4j2.properties" tofile="${classes}/log4j2.properties" />
122                 <javac srcdir="${basedir}/compbio-utils" destdir="${classes}" target="${JAVA_TARGET}" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
123                                         <compilerarg value="-Xlint:unchecked"/>
124                                         <classpath refid="project.classpath" />
125                                 </javac>
126                                 
127                 <!-- Complile the datamodel first -->
128                 <javac srcdir="${basedir}/datamodel" destdir="${classes}" target="${JAVA_TARGET}" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
129                         <compilerarg value="-Xlint:unchecked"/>
130                         <classpath refid="project.classpath" />
131                 </javac>
132                 <!-- Complile the engines -->
133                 <javac srcdir="${basedir}/engine" destdir="${classes}" target="${JAVA_TARGET}" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
134                         <compilerarg value="-Xlint:unchecked"/>
135                         <classpath refid="project.classpath" />
136                 </javac>
137                 <!-- Complile the runners -->
138                 <javac srcdir="${basedir}/runner" destdir="${classes}" target="${JAVA_TARGET}" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
139                         <compilerarg value="-Xlint:unchecked"/>
140                         <classpath refid="project.classpath" />
141                 </javac>
142                 <!-- Complile the webservices -->
143                 <javac srcdir="${basedir}/webservices" destdir="${classes}" target="${JAVA_TARGET}" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
144                         <compilerarg value="-Xlint:unchecked"/>
145                         <classpath refid="project.classpath" />
146                 </javac>
147                 <!-- Complile the tests -->
148                 <javac srcdir="${basedir}/testsrc" destdir="${classes}" target="${JAVA_TARGET}" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
149                         <compilerarg value="-Xlint:unchecked"/>
150                         <classpath refid="project.classpath" />
151                         <classpath refid="test.classpath" />
152                 </javac>
153         </target>
154
155         <!--
156         Compile with optimisation. Do not compile testsrc
157         The compilation order is 
158         1. datamodel 
159         2. engine
160         3. runner
161         4. webservices
162         Packages of the lower order could not have dependencies on the packages on the next layer. 
163         So runners (layer 3) depends on the engines and the datamodel but engines does not depend 
164         on anything in runners or any other layers above.
165         -->
166         <target name="compile_with_debug" depends="clean" description="Perform a multiple step compilation to ensure layered structure is preserved. Debug disabled, optimisation enabled. Tests are not compiled.">
167                 <!-- copy files to class path-->
168                 <copy file="${basedir}/log/log4j2.properties" tofile="${classes}/log4j2.properties" />
169                 <javac srcdir="${basedir}/compbio-utils" destdir="${classes}" target="${JAVA_TARGET}" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
170                                         <compilerarg value="-Xlint:-unchecked" />
171                                         <classpath refid="project.classpath" />
172                                 </javac>
173                 <!-- Complile the datamodel first -->
174                 <javac srcdir="${basedir}/datamodel" destdir="${classes}" target="${JAVA_TARGET}" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
175                         <compilerarg value="-Xlint:-unchecked" />
176                         <classpath refid="project.classpath" />
177                 </javac>
178                 <!-- Complile the engines -->
179                 <javac srcdir="${basedir}/engine" destdir="${classes}" target="${JAVA_TARGET}" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
180                         <compilerarg value="-Xlint:all" />
181                         <compilerarg value="-Xlint:-unchecked" />
182                         <classpath refid="project.classpath" />
183                 </javac>
184                 <!-- Complile the runners -->
185                 <javac srcdir="${basedir}/runner" destdir="${classes}" target="${JAVA_TARGET}" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
186                         <compilerarg value="-Xlint:-unchecked" />
187                         <classpath refid="project.classpath" />
188                 </javac>
189                 <!-- Complile the webservices -->
190                 <javac srcdir="${basedir}/webservices" destdir="${classes}" target="${JAVA_TARGET}" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
191                         <compilerarg value="-Xlint:-unchecked" />
192                         <classpath refid="project.classpath" />
193                 </javac>
194         </target>
195
196         <target name="datamodel-jar" depends="compile" description="Pack data model classes">
197                 <echo>Jar file: Minimal WS client jar</echo>
198                 <delete file="${basedir}/${datamodel}"></delete>
199                 <jar jarfile="${basedir}/${datamodel}">
200                         <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >
201                                 <include name="${compbio-annotation}"/>
202                         </zipgroupfileset>
203                         <fileset dir="${basedir}/WEB-INF/classes/">
204                                 <include name="compbio/util/*.class"/>
205                                 <include name="compbio/data/sequence/*.class"/>
206                                 <include name="compbio/metadata/*.class"/>
207                         </fileset>
208                         <manifest>
209                                 <attribute name="Built-By" value="${author}" />
210                                 <attribute name="Class-Path" value="." />
211                                 <attribute name="Implementation-Title" value="Datamodel for ${product} " />
212                                 <attribute name="Implementation-Vendor" value="${author}" />
213                                 <attribute name="Implementation-URL" value="${project.url}" />
214                         </manifest>
215                 </jar>
216         </target>
217
218         <target name="datamodel-source-jar" depends="compile" description="Pack java sources">
219                 <delete file="${datamodel-src}"></delete>
220                 <jar jarfile="${datamodel-src}">
221                         <fileset dir="${basedir}/datamodel">
222                                 <include name="**"/>
223                         </fileset>
224                         <zipgroupfileset excludes="META-INF/*.MF" dir="${lib.path}/src">
225                                 <include name="**"/>
226                         </zipgroupfileset>
227                         <manifest>
228                                 <attribute name="Built-By" value="${author}" />
229                                 <attribute name="Implementation-Title" value="${product} Datamodel Source Code Archive" />
230                                 <attribute name="Implementation-Vendor" value="${author}" />
231                                 <attribute name="Implementation-URL" value="${project.url}" />
232                         </manifest>
233                 </jar>
234         </target>
235
236         <target name="core-jar" depends="compile" description="Pack jabaws core classes">
237                 <echo>Jar file: JABAWS core jar</echo>
238                 <delete file="${basedir}/${core}"></delete>
239                 <jar jarfile="${basedir}/${core}">
240                         <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >
241                                 <include name="${compbio-annotation}"/>
242                         </zipgroupfileset>
243                         <fileset refid="fullclient"/>
244                         <manifest>
245                                 <attribute name="Built-By" value="${author}" />
246                                 <attribute name="Class-Path" value="." />
247                                 <attribute name="Implementation-Title" value="JABAWS Core for ${product}" />
248                                 <attribute name="Implementation-Vendor" value="${author}" />
249                                 <attribute name="Implementation-URL" value="${project.url}" />
250                         </manifest>
251                 </jar>
252         </target>
253
254         <target name="core-source-jar" depends="compile" description="Pack jabaws core java sources">
255                 <delete file="${core-src}"></delete>
256                 <jar jarfile="${core-src}">
257                         <fileset dir="${basedir}/datamodel">
258                                 <include name="**"/>
259                         </fileset>
260                         <fileset dir="${basedir}/engine">
261                                 <include name="**"/>
262                         </fileset>
263                         <zipgroupfileset excludes="META-INF/*.MF" dir="${lib.path}/src">
264                                 <include name="**"/>
265                         </zipgroupfileset>
266                         <manifest>
267                                 <attribute name="Built-By" value="${author}" />
268                                 <attribute name="Implementation-Title" value="${product} JABAWS Core Source Code Archive" />
269                                 <attribute name="Implementation-Vendor" value="${author}" />
270                                 <attribute name="Implementation-URL" value="${project.url}" />
271                         </manifest>
272                 </jar>
273         </target>
274
275         <target name="jabaws-client-src-jar" depends="datamodel-source-jar" description="Pack metadata, data model, WS interfaces, a simple ws client class">
276                 <echo>Jar file: JABAWS client source</echo>
277                 <delete file="${jabaws-client-src}">
278                 </delete>
279                 <jar jarfile="${jabaws-client-src}">
280                         <zipgroupfileset  excludes="META-INF/*.MF" file="${datamodel-src}"/>
281                         <fileset dir="${basedir}/webservices">
282                                 <!-- This will include JAXWS artifacts. Alternatively they can be generated on the fly. -->
283                                 <include name="compbio/data/msa/**"/>
284                                 <exclude name="compbio/ws/client/ServicesUtil**"/>
285                                 <exclude name="compbio/ws/client/AAConClient**"/>
286                                 <include name="compbio/ws/client/**"/>
287                         </fileset>
288                         <manifest>
289                                 <attribute name="Built-By" value="${author}" />
290                                 <attribute name="Implementation-Title" value="${product} Client Source Code" />
291                                 <attribute name="Implementation-Vendor" value="${author}" />
292                                 <attribute name="Implementation-URL" value="${project.url}" />
293                         </manifest>
294                 </jar>
295         </target>
296
297         <target name="minimal-jabaws-client-jar" depends="compile, datamodel-jar" description="Pack metadata, data model, WS interfaces, a simple ws client class">
298                 <echo>Jar file: Minimal WS client jar</echo>
299                 <delete file="${basedir}/${min-jabaws-client}"></delete>
300                 <jar jarfile="${basedir}/${min-jabaws-client}">
301                         <zipgroupfileset excludes="META-INF/*.SF" dir="" includes="${datamodel}" />
302                         <fileset dir="${basedir}/WEB-INF/classes/">
303                                 <!-- This will include JAXWS artifacts. Alternatively they can be generated on the fly. -->
304                                 <include name="compbio/util/*.class"/>
305                                 <include name="compbio/data/msa/**"/>
306                                 <include name="compbio/ws/client/**"/>
307                                 <include name="compbio/util/**"/>
308                         </fileset>
309                         <zipgroupfileset excludes="META-INF/*" dir="" includes="WEB-INF/lib/log4j-*.jar" />
310                         <manifest>
311                                 <attribute name="Built-By" value="${author}" />
312                                 <attribute name="Main-Class" value="compbio.ws.client.Jws2Client" />
313                                 <attribute name="Class-Path" value="." />
314                                 <attribute name="Implementation-Title" value="Minimal ${product} Client" />
315                                 <attribute name="Implementation-Vendor" value="${author}" />
316                                 <attribute name="Implementation-URL" value="${project.url}" />
317                         </manifest>
318                 </jar>
319                 <delete file="${basedir}/${min-jabaws-client-nolog}"></delete>
320                 <jar jarfile="${basedir}/${min-jabaws-client-nolog}">
321                         <zipgroupfileset excludes="META-INF/*.SF" dir="" includes="${datamodel}" />
322                         <fileset dir="${basedir}/WEB-INF/classes/">
323                                 <!-- This will include JAXWS artifacts. Alternatively they can be generated on the fly. -->
324                                 <include name="compbio/data/msa/**"/>
325                                 <include name="compbio/ws/client/**"/>
326                                 <include name="compbio/util/**"/>
327                                 <include name="compbio/util/*.class"/>
328                         </fileset>
329                         <manifest>
330                                 <attribute name="Built-By" value="${author}" />
331                                 <attribute name="Main-Class" value="compbio.ws.client.Jws2Client" />
332                                 <attribute name="Class-Path" value="." />
333                                 <attribute name="Implementation-Title" value="Minimal ${product} Client" />
334                                 <attribute name="Implementation-Vendor" value="${author}" />
335                                 <attribute name="Implementation-URL" value="${project.url}" />
336                         </manifest>
337                 </jar>
338         </target>
339
340         <target name="full-jabaws-client-jar" depends="compile" description="Pack datamodel, engine and runners">
341                 <echo>Jar file: Full WS client jar</echo>
342                 <delete file="${full-jabaws-client}">
343                 </delete>
344                 <jar jarfile="${full-jabaws-client}">
345                         <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >
346                                 <include name="${compbio-annotation}"/>
347                                 <include name="drmaa.jar"/>
348                         </zipgroupfileset>
349                         <fileset refid="fullclient"/>
350                         <manifest>
351                                 <attribute name="Built-By" value="${author}" />
352                                 <attribute name="Class-Path" value="." />
353                                 <attribute name="Implementation-Title" value="Full ${product} Client" />
354                                 <attribute name="Implementation-Vendor" value="${author}" />
355                                 <attribute name="Implementation-URL" value="${project.url}" />
356                         </manifest>
357                 </jar>
358         </target>
359
360         <target name="full-jabaws-client" depends="full-jabaws-client-jar, pack-binaries" description="Pack binaries with sources and configuration files">
361                 <echo>Packing binaries, and configuration files</echo>
362                 <zip destfile="${full-jabaws-client-pack}" >
363                         <zipgroupfileset file="${binaries}" />
364                         <zipfileset dir="conf" prefix="conf" >
365                                 <exclude name="**/temp/**"/>
366                         </zipfileset>
367                         <fileset file="${full-jabaws-client}" />
368                 </zip>
369         </target>
370
371
372         <target name="source-jar" depends="datamodel-source-jar" description="Pack java sources">
373                 <delete file="${basedir}/${jabaws-source-jar}">
374                 </delete>
375                 <jar jarfile="${basedir}/${jabaws-source-jar}">
376                         <zipgroupfileset  excludes="META-INF/*.MF" file="${datamodel-src}"/>
377                         <fileset dir="${basedir}/runner">
378                                 <include name="**"/>
379                         </fileset>
380                         <fileset dir="${basedir}/engine">
381                                 <include name="**"/>
382                         </fileset>
383                         <fileset dir="${basedir}/webservices/">
384                                 <include name="**"/>
385                         </fileset>
386                         <manifest>
387                                 <attribute name="Built-By" value="${author}" />
388                                 <attribute name="Class-Path" value="." />
389                                 <attribute name="Implementation-Title" value="${product} Source Code Archive" />
390                                 <attribute name="Implementation-Vendor" value="${author}" />
391                                 <attribute name="Implementation-URL" value="${project.url}" />
392                         </manifest>
393                 </jar>
394         </target>
395
396         <target name="full-jabaws-jar" depends="compile" description="Pack datamodel, engine, runners, configuration, binaries and webservices">
397                 <echo>Jar file: Full WS client jar</echo>
398                 <delete file="${full-jabaws-client}">
399                 </delete>
400                 <jar jarfile="${full-jabaws-client}">
401                         <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >
402                                 <include name="log4j-*.jar"/>
403                                 <include name="${compbio-util}"/>
404                                 <include name="${compbio-annotation}"/>
405                                 <include name="drmaa.jar"/>
406                         </zipgroupfileset>
407                         <fileset refid="fullclient">
408                         </fileset>
409                         <fileset dir="${basedir}/WEB-INF/classes/">
410                                 <!-- Statistics web application -->
411                                 <include name="compbio/stat/**"/>
412                                 <!-- Web services-->
413                                 <include name="compbio/ws/**"/>
414                         </fileset>
415                         <!-- Set WSTester as main to help user to test their deployments -->
416                         <manifest>
417                                 <attribute name="Built-By" value="${author}" />
418                                 <attribute name="Class-Path" value="." />
419                                 <attribute name="Main-Class" value="compbio.ws.client.WSTester" />
420                                 <attribute name="Implementation-Title" value="${product}" />
421                                 <attribute name="Implementation-Vendor" value="${author}" />
422                                 <attribute name="Implementation-URL" value="${project.url}" />
423                         </manifest>
424                 </jar>
425         </target>
426
427         <target name="pack-binaries" description="Zip all binary files">
428                 <delete file="${binaries}" failonerror="false"/>
429                 <zip destfile="${binaries}" >
430                         <zipfileset dir="${basedir}/binaries" prefix="binaries" excludes="**/linux*/**"/>
431                 </zip>
432         </target>
433
434         <target name="jabaws-no-binaries" depends="full-jabaws-jar, clearStatDB" description="Prepare JABAWS war file without native binaries">
435                 <echo>Preparing a war file without binaries</echo>
436                 <delete file="${jabaws-no-binaries}">
437                 </delete>
438                 <zip destfile="${jabaws-no-binaries}" whenempty="create">
439                         <zipfileset dir="${basedir}/WEB-INF" prefix="WEB-INF">
440                                 <exclude name="classes"/>
441                                 <!-- These are included into JABA client so exclude the jars -->
442                                 <exclude name="lib/drmaa.jar"/>
443                                 <exclude name="lib/log4j-*.jar"/>
444                                 <exclude name="lib/${compbio-annotation}"/>
445                                 <exclude name="lib/${compbio-util}"/>
446                                 
447                                 <include name="web.xml"/>
448                                 <include name="sun-jaxws.xml"/>
449                                 <include name="lib/*"/>
450                         </zipfileset>
451                         <zipfileset dir="${basedir}/ExecutionStatistic" prefix="ExecutionStatistic" />
452                         <zipfileset dir="${basedir}/website/statpages" prefix="statpages" />
453                         <zipfileset dir="${basedir}/jobsout" prefix="jobsout" excludes="**/*"/>
454                         <zipfileset dir="conf" prefix="conf" >
455                                 <exclude name="**/temp/**"/>
456                         </zipfileset>
457                         <!-- Add JABAWS web site apart from the binary archive -->
458                         <zipfileset dir="${basedir}/website" excludes="archive/**, devel*.html, tests/**, template.html"/>
459                         <!-- Add JABAWS docs apart from the contents of _build -->
460                         <zipfileset dir="${basedir}/docs" excludes="_build/**"/>
461                         <zipfileset dir="." includes="${full-jabaws-client}" fullpath="WEB-INF/lib/jabaws-client.jar"/>
462                         <!-- Put a copy of log4j configuration file where it can be used  -->
463                         <zipfileset dir="log" includes="log4j2.properties" prefix="WEB-INF/classes"/>
464                 </zip>
465         </target>
466
467         <target name="build-devel-website" description="Pack developement related pages, tests, javadoc" >
468                 <echo>Packing data for internal web site</echo>
469                 <delete file="${jabaws-devel-web}">
470                 </delete>
471                 <zip destfile="${jabaws-devel-web}" whenempty="create">
472                         <!-- Add JABAWS web site apart from the binary archive -->
473                         <zipfileset dir="${basedir}/website" excludes="template.html, download.html, index.html, manual.html, howto.html, archive/**, prog_docs/**"/>
474                         <!-- Add JABAWS docs apart from the contents of _build -->
475                         <zipfileset dir="${basedir}/docs" excludes="_build/**"/>
476                 </zip>
477         </target>
478
479         <target name="jabaws-complete" depends="jabaws-no-binaries, pack-binaries" description="Prepare JABAWS war file without runtime dependency - JAXWS jars">
480                 <echo>Preparing a complete war file</echo>
481                 <delete file="${jabaws}">
482                 </delete>
483                 <copy tofile="${jabaws}" file="${jabaws-no-binaries}"/>
484                 <zip destfile="${jabaws}" update="true" >
485                         <zipgroupfileset file="${binaries}" />
486                 </zip>
487         </target>
488
489         <target name="build-all" depends="full-jabaws-client, minimal-jabaws-client-jar, jabaws-no-binaries, jabaws-complete, datamodel-jar, datamodel-source-jar, core-jar, core-source-jar, source-jar, jabaws-client-src-jar" description="Build-all the distributives"/>
490
491         <!-- This task does not really depends on compile, but it is better to make sure that the code is sound -->
492         <target name="archive-project" description="Pack everything in the project for those who do not have access to SVN" depends="compile">
493                 <delete file="${jabaws-project}">
494                 </delete>
495                 <zip destfile="${jabaws-project}" whenempty="create" >
496                         <fileset dir="." excludes="${distdir}/**, jobsout/**, test-output/**, **.svn, dundee-conf/**, TODO.txt, IDEAS.txt, ${activity.log}, **/*.zip, **/*.war"/>
497                         <!-- Add jobsout directory but no content -->
498                         <zipfileset dir="${basedir}/jobsout" prefix="jobsout" excludes="*/**"/>
499                 </zip>
500         </target>
501
502 <!-- ####################################################################################################################################### -->
503 <!-- Test targets -->
504         <taskdef name="testNG" classname="org.testng.TestNGAntTask">
505                 <classpath refid="test.classpath">
506                 </classpath>
507         </taskdef>
508
509         <target name="CustomTest" depends="compile_with_debug">
510                 <delete file="${activity.log}"/>
511                 <testNG haltonfailure="true" enableassert="true" >
512                         <jvmarg value="-server" />
513                         <jvmarg value="-enableassertions" />
514                         <jvmarg value="-Xms1024m" />
515                         <jvmarg value="-Xmx1024m" />
516                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
517                         <classpath refid="test.classpath" />
518                         <classpath refid="project.classpath" />
519                         <xmlfileset dir="." includes="temp-testng-customsuite.xml"/>
520                         <sysproperty key="TestingDataPath" value="${data.src}"/>
521                 </testNG>
522         </target>
523
524         <target name="Run_cluster_dependent_test" depends="compile_with_debug">
525                 <delete file="${activity.log}"/>
526                 <testNG groups="cluster" haltonfailure="true" enableassert="true" parallel="false" verbose="3">
527                         <jvmarg value="-server" />
528                         <jvmarg value="-enableassertions" />
529                         <jvmarg value="-Xms1024m" />
530                         <jvmarg value="-Xmx1024m" />
531                         <classfileset dir="${classes}" includes="**/*.class" />
532                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
533                         <classpath refid="test.classpath" />
534                         <classpath refid="project.classpath" />
535                         <sysproperty key="TestingDataPath" value="${data.src}"/>
536                 </testNG>
537         </target>
538
539         <target name="Test" depends="compile_with_debug">
540                 <delete file="${activity.log}"/>
541                 <testNG haltonfailure="true" enableassert="true" verbose="3" excludedgroups="performance, webservices" >
542                         <jvmarg value="-server" />
543                         <jvmarg value="-enableassertions" />
544                         <jvmarg value="-Xms1024m" />
545                         <jvmarg value="-Xmx1024m" />
546                         <classfileset dir="${classes}" includes="**/*.class" />
547                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
548                         <classpath refid="test.classpath" />
549                         <classpath refid="project.classpath" />
550                         <sysproperty key="TestingDataPath" value="${data.src}"/>
551                 </testNG>
552         </target>
553
554         <target name="Performance_tests" depends="compile_with_debug">
555                 <delete file="${activity.log}"/>
556                 <testNG haltonfailure="true" enableassert="true" verbose="3" groups="performance" >
557                         <jvmarg value="-server" />
558                         <jvmarg value="-enableassertions" />
559                         <jvmarg value="-Xms1024m" />
560                         <jvmarg value="-Xmx1024m" />
561                         <classfileset dir="${classes}" includes="**/*.class" />
562                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
563                         <classpath refid="test.classpath" />
564                         <classpath refid="project.classpath" />
565                         <sysproperty key="TestingDataPath" value="${data.src}"/>
566                 </testNG>
567         </target>
568
569         <target name="Test_runners" depends="compile_with_debug">
570                 <delete file="${activity.log}"/>
571                 <testNG groups="runner" haltonfailure="true" verbose="3" enableassert="true" >
572                         <jvmarg value="-server" />
573                         <jvmarg value="-enableassertions" />
574                         <jvmarg value="-Xms1024m" />
575                         <jvmarg value="-Xmx1024m" />
576                         <classfileset dir="${classes}" includes="**/*.class" />
577                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
578                         <classpath refid="test.classpath" />
579                         <classpath refid="project.classpath" />
580                         <sysproperty key="TestingDataPath" value="${data.src}"/>
581                 </testNG>
582         </target>
583
584         <target name="Test_engines" depends="compile_with_debug">
585                 <delete file="${activity.log}"/>
586                 <testNG groups="engine" haltonfailure="true" verbose="3" enableassert="true" >
587                         <jvmarg value="-server" />
588                         <jvmarg value="-enableassertions" />
589                         <jvmarg value="-Xms1024m" />
590                         <jvmarg value="-Xmx1024m" />
591                         <classfileset dir="${classes}" includes="**/*.class" />
592                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
593                         <classpath refid="test.classpath" />
594                         <classpath refid="project.classpath" />
595                         <sysproperty key="TestingDataPath" value="${data.src}"/>
596                 </testNG>
597         </target>
598
599         <target name="Test_webservices" depends="compile_with_debug">
600                 <delete file="${activity.log}"/>
601                 <testNG groups="webservices" haltonfailure="true" verbose="3" enableassert="true" >
602                         <jvmarg value="-server" />
603                         <jvmarg value="-enableassertions" />
604                         <jvmarg value="-Xms1024m" />
605                         <jvmarg value="-Xmx1024m" />
606                         <classfileset dir="${classes}" includes="**/*.class" />
607                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
608                         <classpath refid="test.classpath" />
609                         <classpath refid="project.classpath" />
610                         <sysproperty key="TestingDataPath" value="${data.src}"/>
611                 </testNG>
612         </target>
613
614         <target name="All_cluster_independent_windows_only_tests" depends="compile_with_debug">
615                 <delete file="${activity.log}" failonerror="false"/>
616                 <testNG excludedgroups="cluster, non_windows" haltonfailure="true" verbose="3" enableassert="true"  >
617                         <jvmarg value="-server" />
618                         <jvmarg value="-enableassertions" />
619                         <jvmarg value="-Xms1024m" />
620                         <jvmarg value="-Xmx1024m" />
621                         <classfileset dir="${classes}" includes="**/*.class" />
622                         <classpath refid="test.classpath" />
623                         <classpath refid="project.classpath" />
624                         <sysproperty key="TestingDataPath" value="${data.src}"/>
625                 </testNG>
626         </target>
627
628         <target name="All_cluster_independent_tests" depends="compile_with_debug">
629                 <delete file="${activity.log}" failonerror="false"/>
630                 <testNG excludedgroups="cluster, performance" haltonfailure="true" verbose="3" enableassert="true"  >
631                         <jvmarg value="-server" />
632                         <jvmarg value="-enableassertions" />
633                         <jvmarg value="-Xms1024m" />
634                         <jvmarg value="-Xmx1024m" />
635                         <classfileset dir="${classes}" includes="**/*.class" />
636                         <classpath refid="test.classpath" />
637                         <classpath refid="project.classpath" />
638                         <sysproperty key="TestingDataPath" value="${data.src}"/>
639                 </testNG>
640         </target>
641
642         <target name="Rerun_failed_tests" depends="compile_with_debug">
643                 <delete file="${activity.log}" failonerror="false"/>
644                 <testNG haltonfailure="true" enableassert="true" verbose="9" >
645                         <jvmarg value="-server" />
646                         <jvmarg value="-enableassertions" />
647                         <jvmarg value="-Xms1024m" />
648                         <jvmarg value="-Xmx1024m" />
649                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
650                         <classpath refid="test.classpath" />
651                         <classpath refid="project.classpath" />
652                         <xmlfileset dir="." includes="test-output/testng-failed.xml"/>
653                         <sysproperty key="TestingDataPath" value="${data.src}"/>
654                 </testNG>
655         </target>
656
657         <target name="TestAll" depends="compile_with_debug">
658                 <delete file="${activity.log}"/>
659                 <testNG haltonfailure="true" enableassert="true" verbose="3" >
660                         <jvmarg value="-server" />
661                         <jvmarg value="-enableassertions" />
662                         <jvmarg value="-Xms1024m" />
663                         <jvmarg value="-Xmx1024m" />
664                         <classfileset dir="${classes}" includes="**/*.class" />
665                         <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
666                         <classpath refid="test.classpath" />
667                         <classpath refid="project.classpath" />
668                         <sysproperty key="TestingDataPath" value="${data.src}"/>
669                 </testNG>
670         </target>
671
672 </project>