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