forked from NCEAS/metacat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workflowscheduler.build.xml
executable file
·431 lines (394 loc) · 16.3 KB
/
workflowscheduler.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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<?xml version="1.0"?>
<!--
* '$RCSfile$'
* Authors: Michael Daigle
* Copyright: 2009 Regents of the University of California and the
* National Center for Ecological Analysis and Synthesis
* For Details: http://www.nceas.ucsb.edu/
*
* '$Author: daigle $'
* '$Date: 2009-07-30 10:31:08 -0700 (Thu, 30 Jul 2009) $'
* '$Revision: 5009 $'
*
* Build file for the Ant cross-platform build system for the
* Workflow Scheduler Application
* See http://jakarta.apache.org for details on Ant
*
* usage: ant [compile|jar|install|jdoc]
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<project name="workflowscheduler" default="jar" basedir=".">
<property environment="env" />
<property file="build.properties" /><!-- USER SPECIFIC PROPS -->
<target name="config">
<property name="jsdk"
value="${build.tomcat.dir}/common/lib/servlet-api.jar" />
<property name="debug" value="on" />
<!-- property name="morphosourcedir" value="../morpho" / -->
<property name="utilitiesdir" value="../utilities" />
<property name="installdir"
value="${app.deploy.dir}/${workflowscheduler.context}" />
<echo>*********** set jsdk to ${jsdk}</echo>
</target>
<target name="init" depends="config">
<path id="compile.classpath">
<pathelement location="${jsdk}" />
<pathelement location="lib" />
<fileset dir="lib">
<include name="cos.jar" />
<include name="postgresql-8.0-312.jar" />
<include name="quartz-1.5.2.jar" />
<include name="utilities.jar" />
<include name="log4j-1.2.12.jar" />
</fileset>
<fileset dir="lib/lsid_lib">
<include name="commons-logging-1.0.4.jar" />
<include name="commons-discovery.jar" />
<include name="commons-discovery-0.2.jar" />
<include name="wsdl4j-1.5.1.jar" />
<include name="saaj.jar" />
<include name="axis.jar" />
<include name="jaxrpc.jar" />
</fileset>
<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
<include name="commons-httpclient-2.0.jar" />
</fileset>
<fileset dir="../seek/projects/ecogrid/build/lib">
<include name="org.ecoinformatics.ecogrid.AuthenticationService-stub.jar" />
<include name="org.ecoinformatics.ecogrid.AuthorizationService-stub.jar" />
</fileset>
</path>
<!-- It is less likely you'll need to make any changes from here down,
but customization is possible -->
<property name="name" value="workflowscheduler" />
<property name="Name" value="workflowscheduler" />
<property name="debugprefix" value="${Name}:" />
<property name="release" value="${metacat.version}" />
<filter token="docrooturl" value="./" />
<filter token="debugprefix" value="${debugprefix}" />
<filter token="build.context" value="${workflowscheduler.context}" />
<property name="srcdir" value="./src" />
<property name="lib.dir" value="./lib" />
<property name="docdir" value="./docs" />
<property name="testdir" value="./test" />
<property name="build.dir" value="./workflowscheduler.build" />
<property name="build.src" value="${build.dir}/src" />
<property name="build.dest" value="${build.dir}/classes" />
<property name="build.samples" value="${build.dir}/samples" />
<property name="build.tests" value="${build.dir}/tests" />
<property name="build.tmp" value="${build.dir}/tmp" />
<property name="build.metacattest"
value="${build.tests}/metacattest" />
<property name="build.metacatnettest"
value="${build.tests}/metacatnettest" />
<property name="build.data" value="${build.dir}/data" />
<property name="build.javadocs" value="${build.dir}/docs/api" />
<property name="build.war" value="${build.dir}/war" />
<property name="dist.dir" value="${name}.dist" />
<property name="ver.dir" value="${dist.dir}/${name}-${release}" />
<property name="ver.src" value="${ver.dir}/src" />
<property name="util.dir" value="${dist.dir}/${util-module}" />
<property name="test.dir" value="${dist.dir}/test" />
<!-- directories for creating a Harvest List Editor distribution -->
<property name="dist.dir.hle" value="disthle" />
<property name="ver.dir.hle"
value="${dist.dir.hle}/harvest-list-editor-${release}" />
<property name="pkg.dir" value="./package" />
<property name="ecogrid.stublib.dir" value="../seek/projects/ecogrid/build/lib" />
<property name="package.home" value="edu/ucsb/nceas/metacat" />
<!-- set up svn -->
<property name="svnant.lib" value="lib" />
<property name="svnant.jar" value="${svnant.lib}/svnant.jar" />
<property name="svnClientAdapter.jar"
value="${svnant.lib}/svnClientAdapter.jar" />
<property name="svnjavahl.jar"
value="${svnant.lib}/svnjavahl.jar" />
<property name="svn.utilitiesUrl"
value="https://code.ecoinformatics.org/code/utilities/tags/${utilities-tag}" />
<property name="svn.ecogridUrl"
value="https://code.ecoinformatics.org/code/seek/trunk/projects/ecogrid/" />
<!-- property name="svn.utilitiesExportPath" value="${knbdir}" / -->
<!-- load the svn task -->
<path id="svn.classpath">
<pathelement location="${svnjavahl.jar}" />
<pathelement location="${svnant.jar}" />
<pathelement location="${svnClientAdapter.jar}" />
</path>
<taskdef resource="svntask.properties"
classpathref="svn.classpath" />
<condition property="utilities.required">
<or>
<not>
<available file="lib/httpclient.jar" />
</not>
<not>
<available file="lib/utilities.jar" />
</not>
<not>
<available file="${utilitiesdir}" type="dir" />
</not>
</or>
</condition>
<!-- peer.utilities.required is used when there is no utilities
directory at ${utilitiesdir} -->
<condition property="peer.utilities.required">
<or>
<not>
<available file="${utilitiesdir}" type="dir" />
</not>
</or>
</condition>
</target>
<target name="prepare" depends="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.src}" />
<mkdir dir="${build.dest}" />
<mkdir dir="${build.javadocs}" />
<mkdir dir="${build.tmp}" />
<copy todir="${build.src}" filtering="yes">
<fileset dir="${srcdir}">
<include name="edu/ucsb/nceas/dbadapter/**" />
<include name="edu/ucsb/nceas/shared/**" />
<include name="edu/ucsb/nceas/metacat/Version.java" />
<include name="edu/ucsb/nceas/metacat/accesscontrol/AccessControlInterface.java" />
<include name="edu/ucsb/nceas/metacat/cart/**" />
<include name="edu/ucsb/nceas/metacat/database/**" />
<include name="edu/ucsb/nceas/metacat/properties/**" />
<exclude name="edu/ucsb/nceas/metacat/properties/SkinPropertyService.java" />
<exclude name="edu/ucsb/nceas/metacat/properties/ConfigurableProperties.java" />
<include name="edu/ucsb/nceas/metacat/scheduler/**" />
<include name="edu/ucsb/nceas/metacat/shared/**" />
<include name="edu/ucsb/nceas/metacat/util/**" />
<exclude name="edu/ucsb/nceas/metacat/util/ConfigurationUtil.java" />
<exclude name="edu/ucsb/nceas/metacat/util/DocumentUtil.java" />
<exclude name="edu/ucsb/nceas/metacat/util/EMLVersionsTransformer.java" />
<exclude name="edu/ucsb/nceas/metacat/util/GeoserverUtil.java" />
<exclude name="edu/ucsb/nceas/metacat/util/OrganizationUtil.java" />
<include name="edu/ucsb/nceas/metacat/AuthInterface.java" />
<include name="edu/ucsb/nceas/metacat/AuthLdap.java" />
<include name="edu/ucsb/nceas/metacat/AuthTLSException.java" />
<include name="edu/ucsb/nceas/metacat/AuthSession.java" />
<include name="edu/ucsb/nceas/metacat/MetacatVersion.java" />
<include name="edu/ucsb/nceas/metacat/service/SessionService.java" />
<include name="edu/ucsb/nceas/metacat/service/ServiceService.java" />
<include name="edu/ucsb/nceas/workflowscheduler/**" />
<include name="org/kepler/executionWS/**" />
<exclude name="**/CVS*" />
<exclude name="**/.#*" />
</fileset>
</copy>
</target>
<taskdef resource="axis-tasks.properties"
classpathref="compile.classpath" />
<target name="generateStubs" depends="prepare">
<echo
message=" Generating stubs for execution service from ${/tmp/KeplerWebService.wsdl}" />
<axis-wsdl2java verbose="true" output="${srcdir}"
url="/tmp/KeplerWebService.wsdl" />
</target>
<target name="compile" depends="prepare, utilities"
description="Compiles java code to build dir, and copies metacat props files there">
<javac srcdir="${build.src}" destdir="${build.dest}"
debug="${debug}"
excludes="**/*.sql **/client/*.java **/harvesterClient/*.java">
<classpath>
<path refid="compile.classpath" />
</classpath>
</javac>
</target>
<target name="jar" depends="compile"
description="Compiles and jars metacat java code to metacat.jar in build dir ">
<delete file="${build.dir}/${name}.jar" />
<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
excludes="**/protocols/ **/harvesterClient/" />
</target>
<target name="utilities" depends="config,getpeerutilities"
if="utilities.required">
<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
<copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
</target>
<target name="getpeerutilities" depends="prepare"
if="peer.utilities.required"
description="Checks utilities out of svn and copies it to your utilitiesdir if it does not already exist">
<echo message="Exporting utiities files from svn repository:" />
<!-- input message="Please enter svn repo username:" addproperty="svn.username" / -->
<!-- input message="Please enter svn repo password:" addproperty="svn.password" / -->
<!-- svn username="${svn.username}" password="${svn.password}" -->
<svn>
<export srcUrl="${svn.utilitiesUrl}"
destPath="${utilitiesdir}" />
</svn>
<!-- ant dir="${utilitiesdir}" inheritAll="false" target="dist" / -->
</target>
<target name="getutilities" depends="prepare"
description="Checks utility out of svn and copies it to your metacat cvs sandbox">
<echo>Enter CVS password:</echo>
<cvs cvsRoot="${cvsroot}" package="${util-module}"
tag="${utilities-tag}" dest="${build.tmp}" />
</target>
<target name="install" depends="init, war"
description="* Full Install For Development *">
<copy file="${dist.dir}/${workflowscheduler.context}.war"
todir="${app.deploy.dir}" />
<delete dir="${app.deploy.dir}/${workflowscheduler.context}" />
<tstamp>
<format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa" />
</tstamp>
<echo>Dev install completed at ${NOW}</echo>
</target>
<target name="war" depends="warPrepare"
description="Create a web archive (WAR) for servlet deployment">
<mkdir dir="${dist.dir}" />
<war destfile="${dist.dir}/${workflowscheduler.context}.war"
webxml="${build.war}/web.xml">
<fileset dir="${war.context}" />
<lib dir="${war.lib}" />
<webinf dir="${war.webinf}" />
</war>
</target>
<target name="warPrepare" depends="jar"
description="Prepare files for creating a web archive (WAR)">
<property name="war.lib" value="${build.war}/lib" />
<property name="war.webinf" value="${build.war}/WEB-INF" />
<property name="war.context"
value="${build.war}/${workflowscheduler.context}" />
<property name="war.webinf.sql" value="${war.webinf}/sql" />
<property name="war.webinf.scripts"
value="${war.webinf}/scripts" />
<mkdir dir="${war.lib}" />
<mkdir dir="${war.webinf}" />
<mkdir dir="${war.context}" />
<mkdir dir="${war.webinf.sql}" />
<copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
<copy todir="${war.lib}" filtering="no">
<fileset dir="lib">
<include name="cos.jar" />
<include name="postgresql-8.0-312.jdbc3.jar" />
<include name="quartz-1.5.2.jar" />
<include name="utilities.jar" />
<include name="log4j-1.2.12.jar" />
<include name="xalan.jar" />
</fileset>
<fileset dir="lib/lsid_lib">
<include name="commons-logging-1.0.4.jar" />
<include name="commons-discovery.jar" />
<include name="commons-discovery-0.2.jar" />
<include name="wsdl4j-1.5.1.jar" />
<include name="saaj.jar" />
<include name="axis.jar" />
<include name="jaxrpc.jar" />
</fileset>
<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
<include name="commons-httpclient-2.0.jar" />
</fileset>
<fileset dir="${ecogrid.stublib.dir}">
<include name="org.ecoinformatics.ecogrid.AuthenticationService-stub.jar" />
<include name="org.ecoinformatics.ecogrid.AuthorizationService-stub.jar" />
</fileset>
</copy>
<!-- MCD added next - Remove the tomcat5 reference-->
<copy file="lib/${name}/${name}.web.xml" tofile="${build.war}/web.xml" />
<copy file="lib/${name}/${name}.properties" todir="${war.webinf}"
filtering="yes" />
<!-- copy file="lib/${name}/${name}.properties.metadata.xml"
todir="${war.webinf}" filtering="no" / -->
<!-- copy file="lib/auth.properties.metadata.xml"
todir="${war.webinf}" filtering="no" / -->
<copy file="lib/log4j.properties" todir="${war.webinf}"
filtering="yes" />
<copy todir="${war.webinf.sql}" filtering="yes">
<fileset dir="src">
<include name="**/*.sql" />
</fileset>
</copy>
<copy todir="${war.webinf.scripts}" filtering="yes">
<fileset dir="src/scripts" />
</copy>
<copy todir="${war.webinf.scripts}"
file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
failonerror="false" />
</target>
<target name="clean" depends="init"
description="deletes build dir and files that can be regenerated form the release">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<target name="localclean" depends="clean"
description="deletes even jars that depend on external sources such as stylesheets and jars">
<delete file="lib/httpclient.jar" />
<delete file="lib/utilities.jar" />
</target>
<target name="fullclean" depends="localclean"
description="deletes code and eml">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${style-common-cvsrelpath}">
<include name="${eml-css}" />
<include name="eml-*/*.xsl" />
<include name="eml-*" />
</fileset>
<fileset dir="${schema-cvsrelpath}">
<include name="eml-*/*.xsd" />
</fileset>
<fileset dir="${ecogrid-dir}">
<include name="build.properties" />
<include name="buildfiles/metacatImpl.xml" />
</fileset>
</delete>
</target>
<target name="jdoc" depends="prepare"
description="generates javadoc documentation">
<javadoc packagenames="edu.ucsb.nceas.*"
sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
version="true" use="true" windowtitle="${Name} API"
doctitle="<h1>${Name}</h1>"
bottom="<i>Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.</i>">
<classpath>
<path refid="compile.classpath" />
</classpath>
</javadoc>
</target>
<target name="dist"
depends="jar,getutilities"
description="prepares a full release distribution">
<mkdir dir="${dist.dir}" />
<delete dir="${ver.dir}" />
<mkdir dir="${ver.dir}" />
<copy todir="${ver.dir}">
<fileset dir="."
excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
</copy>
<copy todir="${ver.dir}" file="build.xml" />
<copy todir="${ver.dir}" file="build.properties" />
<copy todir="${ver.dir}/docs" filtering="yes">
<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
</copy>
<copy todir="${ver.dir}/docs" filtering="no">
<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
</copy>
<copy todir="${ver.dir}/docs/dev">
<fileset dir="${build.dir}/docs" />
</copy>
<copy todir="${ver.dir}/src">
<fileset dir="${build.dir}/src" />
</copy>
<mkdir dir="${ver.dir}/tests/servertestfiles" />
<copy todir="${ver.dir}/test/servertestfiles">
<fileset dir="./test/servertestfiles" />
</copy>
</target>
</project>