1
|
<?xml version="1.0"?>
|
2
|
<!--
|
3
|
* '$RCSfile$'
|
4
|
* Authors: Matt Jones, Chad Berkley, Jivka Bojilova
|
5
|
* Copyright: 2000 Regents of the University of California and the
|
6
|
* National Center for Ecological Analysis and Synthesis
|
7
|
* For Details: http://www.nceas.ucsb.edu/
|
8
|
*
|
9
|
* '$Author: daigle $'
|
10
|
* '$Date: 2008-07-22 09:15:45 -0700 (Tue, 22 Jul 2008) $'
|
11
|
* '$Revision: 4147 $'
|
12
|
*
|
13
|
* Build file for the Ant cross-platform build system for metacat
|
14
|
* See http://jakarta.apache.org for details on Ant
|
15
|
*
|
16
|
* usage: ant [compile|jar|install|jdoc]
|
17
|
*
|
18
|
* This program is free software; you can redistribute it and/or modify
|
19
|
* it under the terms of the GNU General Public License as published by
|
20
|
* the Free Software Foundation; either version 2 of the License, or
|
21
|
* (at your option) any later version.
|
22
|
*
|
23
|
* This program is distributed in the hope that it will be useful,
|
24
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
25
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
26
|
* GNU General Public License for more details.
|
27
|
*
|
28
|
* You should have received a copy of the GNU General Public License
|
29
|
* along with this program; if not, write to the Free Software
|
30
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
31
|
-->
|
32
|
<project name="metacat" default="jar" basedir=".">
|
33
|
<property environment="env"/>
|
34
|
<property file="build.properties"/> <!-- USER SPECIFIC PROPS -->
|
35
|
|
36
|
|
37
|
|
38
|
<!-- Determine if installed ecogrid -->
|
39
|
<condition property="enable.ecogrid">
|
40
|
<equals arg1="${install.ecogrid}" arg2="true" />
|
41
|
</condition>
|
42
|
|
43
|
<target name="config">
|
44
|
<property name="jsdk" value="${build.tomcat.dir}/common/lib/servlet-api.jar"/>
|
45
|
<!-- usr for client testing, generally you don't need change-->
|
46
|
<property name="mcuser" value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
|
47
|
<property name="mcpassword" value="kepler"/>
|
48
|
<property name="mcanotheruser" value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
|
49
|
<property name="mcanotherpassword" value="yourpass"/>
|
50
|
<property name="piscouser" value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org"/>
|
51
|
<property name="piscopassword" value="yourpass"/>
|
52
|
<property name="lteruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
|
53
|
<property name="lterpassword" value="yourpass"/>
|
54
|
|
55
|
<property name="debug" value="on" />
|
56
|
<property name="debuglevel" value="55" />
|
57
|
|
58
|
<property name="morphosourcedir" value="../morpho" />
|
59
|
<property name="defaultcontenttype" value="application/octet-stream" />
|
60
|
<property name="utilitiesdir" value="../utilities" />
|
61
|
|
62
|
<echo>*********** set jsdk to ${jsdk}</echo>
|
63
|
</target>
|
64
|
|
65
|
<target name="init" depends="config">
|
66
|
<path id="compile.classpath">
|
67
|
<pathelement location="${jsdk}"/>
|
68
|
<pathelement location="lib"/>
|
69
|
<fileset dir="lib">
|
70
|
<include name="*.jar"/>
|
71
|
</fileset>
|
72
|
<fileset dir="lib">
|
73
|
<include name="xalan.jar"/>
|
74
|
</fileset>
|
75
|
<fileset dir="lib/lsid_lib">
|
76
|
<include name="*.jar"/>
|
77
|
</fileset>
|
78
|
|
79
|
<!-- Include geoserver, geotools, et. al. -->
|
80
|
<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
|
81
|
<include name="*.jar"/>
|
82
|
</fileset>
|
83
|
<pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
|
84
|
|
85
|
</path>
|
86
|
|
87
|
<!-- It is less likely you'll need to make any changes from here down,
|
88
|
but customization is possible -->
|
89
|
<property name="name" value="metacat"/>
|
90
|
<property name="Name" value="MetaCat"/>
|
91
|
<property name="debugprefix" value="${Name}:"/>
|
92
|
<property name="release" value="${metacat.version}"/>
|
93
|
<property name="style-common-relpath" value="/style/common"/>
|
94
|
<property name="style-shared-relpath" value="/style/shared"/>
|
95
|
<property name="schema-relpath" value="/schema"/>
|
96
|
<property name="style-common-cvsrelpath" value="lib${style-common-relpath}"/>
|
97
|
<property name="schema-cvsrelpath" value="lib${schema-relpath}"/>
|
98
|
<property name="style-skins-relpath" value="/style/skins"/>
|
99
|
<property name="util-module" value="utilities" />
|
100
|
<property name="eml-module" value="eml" />
|
101
|
<property name="eml-version" value="2.0.0beta6" />
|
102
|
<property name="eml-tag" value="EML_2_0_0_BETA_6_FOR_METACAT" />
|
103
|
<property name="eml2_0_0-tag" value="RELEASE_EML_2_0_0_UPDATE_1" />
|
104
|
<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
|
105
|
<property name="eml2_0_1-style-tag" value="RELEASE_EML_2_0_1_UPDATE_6" />
|
106
|
<property name="eml2_0_0namespace" value="eml://ecoinformatics.org/eml-2.0.0" />
|
107
|
<property name="eml2_0_1namespace" value="eml://ecoinformatics.org/eml-2.0.1" />
|
108
|
<property name="eml2_1_0namespace" value="eml://ecoinformatics.org/eml-2.1.0" />
|
109
|
<property name="stmmlnamespace" value="http://www.xml-cml.org/schema/stmml" />
|
110
|
<property name="eml-css" value="eml_xsl.css"/>
|
111
|
<property name="eml-module.default.css"
|
112
|
value="default.css"/>
|
113
|
|
114
|
<!-- Config for registry variables -->
|
115
|
<!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
|
116
|
<property name="scope" value="obfs"/>
|
117
|
<property name="responseForm" value="genericResponse.tmpl"/>
|
118
|
<property name="entryForm" value="entryForm.tmpl"/>
|
119
|
<property name="guide" value="genericGuide.tmpl"/>
|
120
|
<property name="loginForm" value="loginForm.tmpl"/>
|
121
|
<property name="confirmData" value="confirmData.tmpl"/>
|
122
|
<property name="deleteData" value="deleteData.tmpl"/>
|
123
|
<property name="genericHeader" value="genericHeader.tmpl"/>
|
124
|
<property name="genericFooter" value="genericFooter.tmpl"/>
|
125
|
|
126
|
<filter token="scope" value="${scope}"/>
|
127
|
<filter token="responseForm" value="${responseForm}"/>
|
128
|
<filter token="entryForm" value="${entryForm}"/>
|
129
|
<filter token="guide" value="${guide}"/>
|
130
|
<filter token="loginForm" value="${loginForm}"/>
|
131
|
<filter token="confirmData" value="${confirmData}"/>
|
132
|
<filter token="deleteData" value="${deleteData}"/>
|
133
|
<filter token="genericHeader" value="${genericHeader}"/>
|
134
|
<filter token="genericFooter" value="${genericFooter}"/>
|
135
|
<filter token="adminname" value="${adminname}"/>
|
136
|
<filter token="recipient" value="${recipient}"/>
|
137
|
<filter token="metacatVersion" value="${metacat.version}"/>
|
138
|
|
139
|
<filter token="docrooturl" value="./" />
|
140
|
<filter token="mcuser" value="${mcuser}"/>
|
141
|
<filter token="mcpassword" value="${mcpassword}"/>
|
142
|
<filter token="mcanotheruser" value="${mcanotheruser}"/>
|
143
|
<filter token="mcanotherpassword" value="${mcanotherpassword}"/>
|
144
|
<filter token="eml-css" value="${eml-css}"/>
|
145
|
<filter token="style-skins-relpath" value="${style-skins-relpath}"/>
|
146
|
<filter token="style-common-relpath" value="${style-common-relpath}"/>
|
147
|
|
148
|
<filter token="eml-version" value="${eml-version}"/>
|
149
|
<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
|
150
|
<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
|
151
|
<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
|
152
|
<filter token="stmmlnamespace" value="${stmmlnamespace}"/>
|
153
|
<filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
|
154
|
<filter token="debuglevel" value="${debuglevel}" />
|
155
|
<filter token="defaultcontenttype" value="${defaultcontenttype}" />
|
156
|
<filter token="debugprefix" value="${debugprefix}"/>
|
157
|
<filter token="indexPaths" value="${indexPaths}"/>
|
158
|
|
159
|
<filter token="defaultStage" value="${defaultStage}"/>
|
160
|
<filter token="defaultHeader" value="${defaultHeader}"/>
|
161
|
<filter token="defaultFooter" value="${defaultFooter}"/>
|
162
|
<filter token="defaultChangePass" value="${defaultChangePass}"/>
|
163
|
<filter token="defaultResetPass" value="${defaultResetPass}"/>
|
164
|
<filter token="changePassSuccess" value="${changePassSuccess}"/>
|
165
|
<filter token="resetPassSuccess" value="${resetPassSuccess}"/>
|
166
|
<filter token="registerFailed" value="${registerFailed}"/>
|
167
|
<filter token="registerLter" value="${registerLter}"/>
|
168
|
<filter token="registerMatch" value="${registerMatch}"/>
|
169
|
<filter token="registerSuccess" value="${registerSuccess}"/>
|
170
|
<filter token="register" value="${register}"/>
|
171
|
<filter token="searchResults" value="${searchResults}"/>
|
172
|
<filter token="ldapMainServerFailure" value="${ldapMainServerFailure}"/>
|
173
|
<filter token="lter-user" value="${lteruser}"/>
|
174
|
<filter token="lter-pass" value="${lterpassword}"/>
|
175
|
<filter token="pisco-user" value="${piscouser}"/>
|
176
|
<filter token="pisco-pass" value="${piscopassword}"/>
|
177
|
|
178
|
|
179
|
<filter token="timedreplication" value="${timedreplication}" />
|
180
|
<filter token="firsttimedreplication" value="${firsttimedreplication}" />
|
181
|
<filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
|
182
|
|
183
|
<property name="srcdir" value="./src" />
|
184
|
<property name="lib.dir" value="./lib" />
|
185
|
<property name="docdir" value="./docs" />
|
186
|
<property name="testdir" value="./test" />
|
187
|
<property name="testtorun" value="BuildIndexTest" />
|
188
|
<property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
|
189
|
<property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
|
190
|
<property name="build.dir" value="./build"/>
|
191
|
<property name="build.src" value="${build.dir}/src"/>
|
192
|
<property name="build.dest" value="${build.dir}/classes"/>
|
193
|
<property name="build.samples" value="${build.dir}/samples"/>
|
194
|
<property name="build.tests" value="${build.dir}/tests"/>
|
195
|
<property name="build.tmp" value="${build.dir}/tmp"/>
|
196
|
<property name="build.metacattest" value="${build.tests}/metacattest"/>
|
197
|
<property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
|
198
|
<property name="build.data" value="${build.dir}/data"/>
|
199
|
<property name="build.javadocs" value="${build.dir}/docs/api"/>
|
200
|
<property name="build.war" value="${build.dir}/war"/>
|
201
|
<property name="dist.dir" value="dist"/>
|
202
|
<property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
|
203
|
<property name="ver.src" value="${ver.dir}/src"/>
|
204
|
<property name="util.dir" value="${dist.dir}/${util-module}"/>
|
205
|
<!-- directories for creating a Harvest List Editor distribution -->
|
206
|
<property name="dist.dir.hle" value="disthle"/>
|
207
|
<property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
|
208
|
|
209
|
<property name="ecogrid-target-name" value="metacatImpl"/>
|
210
|
<property name="ecogrid-module-dest-dir" value =".."/>
|
211
|
<property name="ecogrid-module" value="seek/projects/ecogrid"/>
|
212
|
<property name="ecogrid-dist-dir" value="${dist.dir}/${ecogrid-module}"/>
|
213
|
<property name="ecogrid-dir" value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
|
214
|
|
215
|
<property name="package.home" value="edu/ucsb/nceas/metacat" />
|
216
|
<condition property="utilities.required">
|
217
|
<or>
|
218
|
<not><available file="lib/httpclient.jar"/></not>
|
219
|
<not><available file="lib/utilities.jar"/></not>
|
220
|
</or>
|
221
|
</condition>
|
222
|
<condition property="eml.required">
|
223
|
<or>
|
224
|
<not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
|
225
|
<not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
|
226
|
<not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
|
227
|
</or>
|
228
|
</condition>
|
229
|
|
230
|
<condition property="ecogrid.required">
|
231
|
<or>
|
232
|
<not><available file="${ecogrid-dir}/build.properties"/></not>
|
233
|
<not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
|
234
|
</or>
|
235
|
</condition>
|
236
|
|
237
|
</target>
|
238
|
|
239
|
<target name="prepare" depends="init">
|
240
|
<mkdir dir="${build.dir}"/>
|
241
|
<mkdir dir="${build.src}"/>
|
242
|
<mkdir dir="${build.dest}"/>
|
243
|
<mkdir dir="${build.javadocs}"/>
|
244
|
<mkdir dir="${build.tmp}"/>
|
245
|
|
246
|
<copy todir="${build.src}" filtering="yes">
|
247
|
<fileset dir="${srcdir}">
|
248
|
<include name="edu/**"/>
|
249
|
<include name="com/**"/>
|
250
|
<include name="org/**"/>
|
251
|
<include name="**/*.sql"/>
|
252
|
<exclude name="**/CVS*"/>
|
253
|
<exclude name="**/.#*"/>
|
254
|
</fileset>
|
255
|
</copy>
|
256
|
<available file="lib/style/common/emlb6toeml2" type="dir"
|
257
|
property="styles.not.needed"/>
|
258
|
</target>
|
259
|
|
260
|
<target name="compile" depends="prepare,utilities"
|
261
|
description="Compiles java code to build dir, and copies metacat props files there">
|
262
|
|
263
|
<javac srcdir="${build.src}"
|
264
|
destdir="${build.dest}"
|
265
|
debug="${debug}"
|
266
|
excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
|
267
|
<classpath>
|
268
|
<path refid="compile.classpath"/>
|
269
|
</classpath>
|
270
|
</javac>
|
271
|
</target>
|
272
|
|
273
|
<target name="jar" depends="compile,geteml"
|
274
|
description="Compiles and jars metacat java code to metacat.jar in build dir">
|
275
|
|
276
|
<delete file="${build.dir}/${name}.jar" />
|
277
|
<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
|
278
|
excludes="**/protocols/ **/harvesterClient/" />
|
279
|
</target>
|
280
|
|
281
|
<target name="protocol" depends="compile"
|
282
|
description="Compiles and jars protocol java code to protocol.jar in build dir">
|
283
|
<delete file="${build.dir}/protocol.jar" />
|
284
|
<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
|
285
|
includes="**/protocols/" />
|
286
|
</target>
|
287
|
|
288
|
<target name="utilities" depends="config" if="utilities.required">
|
289
|
<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
|
290
|
<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
|
291
|
<copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
|
292
|
<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
|
293
|
</target>
|
294
|
|
295
|
<target name="getutilities" depends="prepare"
|
296
|
description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
|
297
|
<echo>Enter CVS password: </echo>
|
298
|
<cvs cvsRoot="${cvsroot}"
|
299
|
package="${util-module}"
|
300
|
dest="${build.tmp}" />
|
301
|
</target>
|
302
|
|
303
|
<target name="client" depends="utilities, prepare"
|
304
|
description="Compiles metacat-client java code to build dir">
|
305
|
<javac srcdir="${build.src}"
|
306
|
destdir="${build.dest}"
|
307
|
includes="edu/ucsb/nceas/metacat/client/*">
|
308
|
<classpath>
|
309
|
<path refid="compile.classpath"/>
|
310
|
</classpath>
|
311
|
</javac>
|
312
|
</target>
|
313
|
|
314
|
<target name="clientjar" depends="client"
|
315
|
description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
|
316
|
<delete file="${build.dir}/${name}-client.jar" />
|
317
|
<jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
|
318
|
includes="**/metacat/client/" />
|
319
|
</target>
|
320
|
|
321
|
<target name="advancedsearchjar" depends="compile"
|
322
|
description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
|
323
|
<delete file="${build.dir}/advancedsearch.jar" />
|
324
|
<jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
|
325
|
includes="**/metacat/advancedsearch/" />
|
326
|
</target>
|
327
|
|
328
|
<target name="harvester" depends="client"
|
329
|
description="Compiles harvester java code to build dir">
|
330
|
<javac srcdir="${build.src}"
|
331
|
destdir="${build.dest}"
|
332
|
includes="edu/ucsb/nceas/metacat/harvesterClient/*">
|
333
|
<classpath>
|
334
|
<path refid="compile.classpath"/>
|
335
|
</classpath>
|
336
|
</javac>
|
337
|
</target>
|
338
|
|
339
|
<target name="harvesterjar" depends="harvester"
|
340
|
description="Compiles and jars harvester java code to harvester.jar in build dir">
|
341
|
<delete file="${build.dir}/harvester.jar" />
|
342
|
<jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
|
343
|
includes="**/metacat/harvesterClient/" />
|
344
|
</target>
|
345
|
|
346
|
<target name="harvestListEditorDist" depends="harvesterjar"
|
347
|
description="Prepares a distribution of the Harvest List Editor tool">
|
348
|
<mkdir dir="${dist.dir.hle}"/>
|
349
|
<delete dir="${ver.dir.hle}" />
|
350
|
<mkdir dir="${ver.dir.hle}"/>
|
351
|
<copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
|
352
|
<copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
|
353
|
<copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
|
354
|
<copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
|
355
|
<copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
|
356
|
<delete file="./harvest-list-editor-${release}.zip"/>
|
357
|
<zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
|
358
|
<delete file="./harvest-list-editor-${release}.tar.gz" />
|
359
|
<tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
|
360
|
<gzip zipfile="./harvest-list-editor-${release}.tar.gz"
|
361
|
src="./harvest-list-editor-${release}.tar"/>
|
362
|
<delete file="./harvest-list-editor-${release}.tar" />
|
363
|
</target>
|
364
|
|
365
|
<target name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
|
366
|
description="Calls getemlpre2 and geteml2+ targets" />
|
367
|
|
368
|
<target name="getemlpre2" depends="prepare" if="eml.required"
|
369
|
description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
|
370
|
<echo>Enter CVS password: </echo>
|
371
|
<cvs cvsRoot="${cvsroot}"
|
372
|
package="${eml-module}"
|
373
|
tag="${eml-tag}"
|
374
|
dest="${build.tmp}/eml_${eml-tag}" />
|
375
|
<mkdir dir="lib/dtd" />
|
376
|
<copy todir="lib/dtd" filtering="yes">
|
377
|
<fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
|
378
|
<include name="*.dtd"/>
|
379
|
</fileset>
|
380
|
<mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
|
381
|
</copy>
|
382
|
|
383
|
<copy todir="${style-common-cvsrelpath}" filtering="yes">
|
384
|
<fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
|
385
|
<include name="**/*.xsl"/>
|
386
|
</fileset>
|
387
|
</copy>
|
388
|
</target>
|
389
|
|
390
|
<target name="geteml2+" depends="prepare" if="eml.required"
|
391
|
description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
|
392
|
<echo>Enter CVS password: </echo>
|
393
|
<cvs cvsRoot="${cvsroot}"
|
394
|
package="${eml-module}"
|
395
|
tag="${eml2_0_0-tag}"
|
396
|
dest="${build.tmp}/eml_${eml2_0_0-tag}" />
|
397
|
<mkdir dir="lib/schema/eml-2.0.0" />
|
398
|
<copy todir="lib/schema/eml-2.0.0" filtering="yes">
|
399
|
<fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
|
400
|
<include name="*.xsd"/>
|
401
|
</fileset>
|
402
|
|
403
|
<!-- shouldn't we have a mapper here like this??
|
404
|
<mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
|
405
|
|
406
|
Jing's code didn't nave one - does it need to be added?
|
407
|
NOTE that eml-version is set to beta 6, so this would need changing -->
|
408
|
|
409
|
</copy>
|
410
|
<!-- <antcall target="copyxsl">
|
411
|
<param name="cvs.tagname" value="${eml2_0_0-tag}" />
|
412
|
<param name="dirname" value="eml-2.0.0" />
|
413
|
</antcall> -->
|
414
|
|
415
|
<!-- Checkout eml201 for given schema tag-->
|
416
|
<echo>Enter CVS password: </echo>
|
417
|
<cvs cvsRoot="${cvsroot}"
|
418
|
package="${eml-module}"
|
419
|
tag="${eml2_0_1-schema-tag}"
|
420
|
dest="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
|
421
|
<mkdir dir="lib/schema/eml-2.0.1" />
|
422
|
<copy todir="lib/schema/eml-2.0.1" filtering="yes">
|
423
|
<fileset dir="${build.tmp}/eml_${eml2_0_1-schema-tag}/${eml-module}">
|
424
|
<include name="*.xsd"/>
|
425
|
</fileset>
|
426
|
</copy>
|
427
|
|
428
|
<!-- Checkout eml201 again for given style sheet tag-->
|
429
|
<echo>Enter CVS password: </echo>
|
430
|
<cvs cvsRoot="${cvsroot}"
|
431
|
package="${eml-module}"
|
432
|
tag="${eml2_0_1-style-tag}"
|
433
|
dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
|
434
|
<antcall target="copyxsl">
|
435
|
<param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
|
436
|
<param name="dirname" value="eml-2.0.1" />
|
437
|
</antcall>
|
438
|
</target>
|
439
|
|
440
|
<target name="copyxsl"
|
441
|
description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
|
442
|
|
443
|
<delete file="${style-common-cvsrelpath}/${eml-css}"/>
|
444
|
|
445
|
<copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
|
446
|
<fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
|
447
|
<include name="**/*.xsl"/>
|
448
|
</fileset>
|
449
|
</copy>
|
450
|
|
451
|
|
452
|
<!-- now copy default css from eml module and put it in style-common-path
|
453
|
dir with a new name, so other skin-specific css can import it if reqd -->
|
454
|
<copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
|
455
|
tofile="${style-common-cvsrelpath}/${eml-css}" />
|
456
|
|
457
|
</target>
|
458
|
|
459
|
<target name="correctEML201Docs" depends="jar"
|
460
|
description="Uses the ant task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
|
461
|
<copy todir="${build.dir}" file="lib/metacat.properties" filtering="yes"/>
|
462
|
<java classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector" >
|
463
|
<classpath>
|
464
|
<path refid="compile.classpath"/>
|
465
|
<fileset dir="${build.dir}">
|
466
|
<include name="${name}.jar"/>
|
467
|
</fileset>
|
468
|
</classpath>
|
469
|
</java>
|
470
|
</target>
|
471
|
|
472
|
<target name="install-spatial" depends="jar,clientjar,harvesterjar"
|
473
|
description="Installs spatial option for metacat">
|
474
|
|
475
|
<property name="spatial.dir" value="./lib/spatial"/>
|
476
|
<property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
|
477
|
<property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
|
478
|
|
479
|
<!-- Copy geoserver libs into ${war.lib} -->
|
480
|
<copy todir="${war.lib}" filtering="no">
|
481
|
<fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
|
482
|
<include name="**"/>
|
483
|
</fileset>
|
484
|
</copy>
|
485
|
|
486
|
<!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
|
487
|
<copy todir="${war.webinf}" filtering="no">
|
488
|
<fileset dir="${spatial.geoserver.dir}/WEB-INF">
|
489
|
<exclude name="lib/**"/>
|
490
|
<exclude name="web.xml"/>
|
491
|
</fileset>
|
492
|
</copy>
|
493
|
|
494
|
<!-- Copy the rest of the geoserver codebase into ${war.context} -->
|
495
|
<copy todir="${war.context}" filtering="no">
|
496
|
<fileset dir="${spatial.geoserver.dir}">
|
497
|
<exclude name="WEB-INF/**"/>
|
498
|
<exclude name="index.jsp"/>
|
499
|
</fileset>
|
500
|
</copy>
|
501
|
|
502
|
<!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat -->
|
503
|
<copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
|
504
|
tofile="${war.context}/geoserver.jsp"
|
505
|
overwrite="true"
|
506
|
filtering="no"/>
|
507
|
|
508
|
<!-- Copy the rest of the modified geoserver web-inf files
|
509
|
<copy todir="${war.webinf}" filtering="no">
|
510
|
<fileset dir="${spatial.webinf-mods}">
|
511
|
<exclude name="web.xml.combined"/>
|
512
|
</fileset>
|
513
|
</copy> -->
|
514
|
|
515
|
</target>
|
516
|
|
517
|
<target name="dev-install" depends="clean, install-ecogrid" description="* Full Install For Development *">
|
518
|
<copy file="${dist.dir}/${metacat.context}.war" todir="${dev.deploy.dir}"/>
|
519
|
<delete dir="${dev.deploy.dir}/${metacat.context}" />
|
520
|
<tstamp>
|
521
|
<format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa"/>
|
522
|
</tstamp>
|
523
|
<echo>Dev install completed at ${NOW}</echo>
|
524
|
</target>
|
525
|
|
526
|
<!--
|
527
|
<target name="install" depends="install-ecogrid" description="* Full Install *">
|
528
|
<mkdir dir="${datafilepath}" />
|
529
|
<mkdir dir="${inlinedatafilepath}" />
|
530
|
<chmod dir="${datafilepath}" perm="ug+w" />
|
531
|
<mkdir dir="${temp-dir}"/>
|
532
|
<chmod dir="${temp-dir}" perm="ug+w" />
|
533
|
<copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
|
534
|
<echo>If you enable ecogrid installation, please run "ant deploy-ecogrid" when installation or upgrade is done</echo>
|
535
|
</target>
|
536
|
-->
|
537
|
|
538
|
<target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
|
539
|
description="Install Ecogrid Compentent">
|
540
|
<copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
|
541
|
<ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
|
542
|
<property name="context" value="${metacat.context}"/>
|
543
|
<property name="target" value="${ecogrid-target-name}"/>
|
544
|
<property name="metacat.dir" value="${metacat.dir}"/>
|
545
|
</ant>
|
546
|
<ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
|
547
|
<property name="context" value="${metacat.context}"/>
|
548
|
<property name="target" value="${ecogrid-target-name}"/>
|
549
|
<property name="metacat.dir" value="${metacat.dir}"/>
|
550
|
</ant>
|
551
|
<war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
|
552
|
<webinf dir="${ecogrid-dir}/lib">
|
553
|
<include name="server-config.wsdd"/>
|
554
|
</webinf>
|
555
|
</war>
|
556
|
<copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
|
557
|
|
558
|
|
559
|
</target>
|
560
|
|
561
|
<target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
|
562
|
<echo>Enter CVS password: </echo>
|
563
|
<cvs cvsRoot="${cvsroot}"
|
564
|
package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
|
565
|
</target>
|
566
|
|
567
|
<target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
|
568
|
<ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
|
569
|
<property name="context" value="${metacat.context}"/>
|
570
|
<property name="target" value="${ecogrid-target-name}"/>
|
571
|
<property name="metacat.dir" value="${metacat.dir}"/>
|
572
|
<property name="hostname" value="localhost"/>
|
573
|
<property name="port" value="${config.port}"/>
|
574
|
</ant>
|
575
|
</target>
|
576
|
|
577
|
<target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
|
578
|
<delete file="${dev.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
|
579
|
</target>
|
580
|
|
581
|
<target name="install-registry" depends="init,getConversionXSL"
|
582
|
description="Install Registry">
|
583
|
|
584
|
<mkdir dir="${inst.cgi.dir}" />
|
585
|
<copy file="${srcdir}/perl/register-dataset.cgi"
|
586
|
todir="${inst.cgi.dir}"/>
|
587
|
<chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
|
588
|
|
589
|
<!-- TODO SCW: set the permissions on this folder to be writable by the apache user -->
|
590
|
<mkdir dir="${temp-dir}" />
|
591
|
<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
|
592
|
used in readDocumentFromMetacat -->
|
593
|
<copy todir="${temp-dir}" filtering="yes">
|
594
|
<fileset dir="lib/style/common/emlb6toeml2">
|
595
|
<include name="*.xsl"/>
|
596
|
<include name="*.xml"/>
|
597
|
</fileset>
|
598
|
</copy>
|
599
|
|
600
|
<echo message="Install Registry completed." />
|
601
|
</target>
|
602
|
|
603
|
<target name="install-ldap" depends="init"
|
604
|
description="Install Metacat LDAP Access">
|
605
|
|
606
|
<mkdir dir="${inst.cgi.dir}" />
|
607
|
<copy file="${srcdir}/perl/ldapweb.cgi"
|
608
|
todir="${inst.cgi.dir}" />
|
609
|
<chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
|
610
|
<mkdir dir="${templates.dir}" />
|
611
|
<copy todir="${templates.dir}">
|
612
|
<fileset dir="lib/style/common/templates">
|
613
|
<!-- SCW: Copy all files -->
|
614
|
</fileset>
|
615
|
</copy>
|
616
|
<echo message="ldapweb install complete." />
|
617
|
</target>
|
618
|
|
619
|
|
620
|
<target name="install-skin" depends="init"
|
621
|
description="Install a Skin">
|
622
|
|
623
|
<input message="Please enter name of the skin"
|
624
|
addproperty="skin-name"/>
|
625
|
|
626
|
<mkdir dir="${installdir}/style/skins/${skin-name}" />
|
627
|
<copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
|
628
|
<fileset dir="lib/style/skins/${skin-name}">
|
629
|
<exclude name="**/*.png"/>
|
630
|
<exclude name="**/*.gif"/>
|
631
|
<exclude name="**/*.jpg"/>
|
632
|
<exclude name="**/CVS*"/>
|
633
|
<exclude name="**/.#*"/>
|
634
|
</fileset>
|
635
|
</copy>
|
636
|
<copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
|
637
|
<fileset dir="lib/style/skins/${skin-name}">
|
638
|
<include name="**/*.png"/>
|
639
|
<include name="**/*.gif"/>
|
640
|
<include name="**/*.jpg"/>
|
641
|
<exclude name="**/CVS*"/>
|
642
|
<exclude name="**/.#*"/>
|
643
|
</fileset>
|
644
|
</copy>
|
645
|
<copy todir="${installdir}/style/common" filtering="yes">
|
646
|
<fileset dir="lib/style/common">
|
647
|
<include name="*.js"/>
|
648
|
<include name="*.jsp"/>
|
649
|
<include name="*.css"/>
|
650
|
<exclude name="*.png"/>
|
651
|
<exclude name="*.gif"/>
|
652
|
<exclude name="*.jpg"/>
|
653
|
<exclude name="**/CVS*"/>
|
654
|
<exclude name="**/.#*"/>
|
655
|
</fileset>
|
656
|
</copy>
|
657
|
<!--
|
658
|
<mkdir dir="${installdir}/style/skins/${skin-name}/images" />
|
659
|
<copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
|
660
|
<fileset dir="lib/style/skins/${skin-name}/images">
|
661
|
<include name="*.png"/>
|
662
|
<include name="*.gif"/>
|
663
|
<include name="*.jpg"/>
|
664
|
</fileset>
|
665
|
</copy>
|
666
|
-->
|
667
|
|
668
|
<echo message="Install Skin completed." />
|
669
|
</target>
|
670
|
|
671
|
<target name="war" depends="warPrepare,install-spatial"
|
672
|
description="Create a web archive (WAR) for servlet deployment">
|
673
|
<mkdir dir="${dist.dir}" />
|
674
|
<war destfile="${dist.dir}/${metacat.context}.war"
|
675
|
webxml="${build.war}/web.xml">
|
676
|
<fileset dir="${war.context}"/>
|
677
|
<lib dir="${war.lib}"/>
|
678
|
<webinf dir="${war.webinf}"/>
|
679
|
</war>
|
680
|
</target>
|
681
|
|
682
|
|
683
|
|
684
|
<target name="warPrepare" depends="jar,clientjar,harvesterjar"
|
685
|
description="Prepare files for creating a web archive (WAR)">
|
686
|
|
687
|
<property name="war.lib" value="${build.war}/lib" />
|
688
|
<property name="war.webinf" value="${build.war}/WEB-INF" />
|
689
|
<property name="war.context" value="${build.war}/${metacat.context}" />
|
690
|
<property name="war.webinf.sql" value="${war.webinf}/sql" />
|
691
|
<property name="war.context.docs" value="${war.context}/docs" />
|
692
|
<mkdir dir="${war.lib}" />
|
693
|
<mkdir dir="${war.webinf}" />
|
694
|
<mkdir dir="${war.context}" />
|
695
|
<mkdir dir="${war.webinf.sql}" />
|
696
|
<mkdir dir="${war.context.docs}" />
|
697
|
|
698
|
<!--copy file="${lib.dir}/${jdbc.lib.oracle}" todir="${war.lib}" / -->
|
699
|
<!--copy file="${lib.dir}/${jdbc.lib.postgres}" todir="${war.lib}" / -->
|
700
|
<!--copy file="${lib.dir}/${jdbc.lib.sqlserver1}" todir="${war.lib}" / -->
|
701
|
<!--copy file="${lib.dir}/${jdbc.lib.sqlserver2}" todir="${war.lib}" / -->
|
702
|
<!--copy file="${lib.dir}/${jdbc.lib.sqlserver3}" todir="${war.lib}" / -->
|
703
|
<copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
|
704
|
<copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
|
705
|
<copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
|
706
|
<copy todir="${war.lib}" filtering="no">
|
707
|
<fileset dir="lib">
|
708
|
<!--
|
709
|
<not>
|
710
|
<filename name="${jdbc-jar-name}"/>
|
711
|
</not>
|
712
|
-->
|
713
|
<include name="*.jar"/>
|
714
|
</fileset>
|
715
|
<fileset dir="lib">
|
716
|
<include name="xalan.jar"/>
|
717
|
<include name="gwt*.jar"/>
|
718
|
</fileset>
|
719
|
</copy>
|
720
|
<!-- MCD copy file="lib/web.xml.${tomcatversion}"
|
721
|
tofile="${build.war}/web.xml" / -->
|
722
|
<!-- MCD added next - Remove the tomcat5 reference-->
|
723
|
<copy file="lib/web.xml.tomcat5"
|
724
|
tofile="${build.war}/web.xml"/>
|
725
|
<copy file="lib/metacat.properties" todir="${war.webinf}"
|
726
|
filtering="yes" />
|
727
|
<copy file="lib/metacat.properties.metadata.xml" todir="${war.webinf}"
|
728
|
filtering="no" />
|
729
|
<copy file="lib/org.properties.metadata.xml" todir="${war.webinf}"
|
730
|
filtering="no" />
|
731
|
<copy todir="${war.webinf}" filtering="yes">
|
732
|
<fileset dir="lib">
|
733
|
<include name="skin.configs/**"/>
|
734
|
</fileset>
|
735
|
</copy>
|
736
|
<copy file="lib/log4j.properties" todir="${war.webinf}"
|
737
|
filtering="yes" />
|
738
|
<copy todir="${war.context}" filtering="no">
|
739
|
<fileset dir="lib">
|
740
|
<include name="**/*.jpg"/>
|
741
|
<include name="**/*.png"/>
|
742
|
<include name="**/*.gif"/>
|
743
|
<include name="LiveMap_30/**"/>
|
744
|
</fileset>
|
745
|
</copy>
|
746
|
<copy todir="${war.context}" filtering="yes">
|
747
|
<fileset dir="lib">
|
748
|
<exclude name="*.jar"/>
|
749
|
<exclude name="*.properties"/>
|
750
|
<exclude name="*.metadata.xml"/>
|
751
|
<exclude name="web.xml"/>
|
752
|
<exclude name="**/*.jpg"/>
|
753
|
<exclude name="**/*.png"/>
|
754
|
<exclude name="**/*.gif"/>
|
755
|
<exclude name="lsid_lib/**"/>
|
756
|
<exclude name="lsid_conf/**"/>
|
757
|
<exclude name="LiveMap_30/**"/>
|
758
|
<exclude name="skin.configs/**"/>
|
759
|
<exclude name="spatial/geoserver/**"/>
|
760
|
<exclude name="spatial/WEB-INF/**"/>
|
761
|
</fileset>
|
762
|
</copy>
|
763
|
<copy todir="${war.context.docs}" filtering="yes">
|
764
|
<fileset dir="docs">
|
765
|
<include name="user/**"/>
|
766
|
</fileset>
|
767
|
</copy>
|
768
|
<copy todir="${war.webinf.sql}" filtering="yes">
|
769
|
<fileset dir="src">
|
770
|
<include name="**/*.sql"/>
|
771
|
</fileset>
|
772
|
</copy>
|
773
|
</target>
|
774
|
|
775
|
<target name="getConversionXSL" depends="prepare"
|
776
|
unless="styles.not.needed"
|
777
|
description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
|
778
|
|
779
|
<echo>Enter CVS password: </echo>
|
780
|
<cvs cvsRoot="${cvsroot}"
|
781
|
package="${eml-module}"
|
782
|
tag="${eml2_0_1-style-tag}"
|
783
|
dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
|
784
|
|
785
|
<mkdir dir="lib/style/common/emlb6toeml2" />
|
786
|
<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
|
787
|
<fileset dir="${build.tmp}/eml_${eml2_0_1-style-tag}/${eml-module}/lib/beta6toeml2/xsl">
|
788
|
<include name="*.xsl"/>
|
789
|
<include name="*.xml"/>
|
790
|
</fileset>
|
791
|
</copy>
|
792
|
</target>
|
793
|
|
794
|
<target name="testprep" depends="jar,clientjar,harvesterjar">
|
795
|
<mkdir dir="${build.tests}"/>
|
796
|
<copy todir="${build.tests}" filtering="yes">
|
797
|
<fileset dir="${testdir}">
|
798
|
<include name="edu/**"/>
|
799
|
</fileset>
|
800
|
</copy>
|
801
|
<copy todir="${build.tests}" file="lib/metacat.properties" filtering="yes"/>
|
802
|
<copy todir="${build.tests}" file="lib/metacat.properties.metadata.xml" filtering="yes"/>
|
803
|
<copy todir="${build.tests}" file="lib/org.properties.metadata.xml" filtering="yes"/>
|
804
|
|
805
|
<!-- copy and compile the tests into a jar file -->
|
806
|
<javac srcdir="${build.tests}"
|
807
|
destdir="${build.tests}"
|
808
|
debug="on"
|
809
|
includes="**/*.java">
|
810
|
<classpath>
|
811
|
<path refid="compile.classpath"/>
|
812
|
<fileset dir="${build.dir}">
|
813
|
<include name="${name}.jar"/>
|
814
|
<include name="${name}-client.jar"/>
|
815
|
<include name="harvester.jar"/>
|
816
|
</fileset>
|
817
|
</classpath>
|
818
|
</javac>
|
819
|
|
820
|
<jar jarfile="${build.dir}/${name}-junittests.jar"
|
821
|
basedir="${build.tests}"
|
822
|
includes="**/*.class" />
|
823
|
</target>
|
824
|
|
825
|
<target name="test" depends="testprep"
|
826
|
description="Uses the ant junit task to run all JUnit tests">
|
827
|
|
828
|
<!-- use the ant "junit" task to run JUnit tests. -->
|
829
|
<junit printsummary="yes" haltonfailure="no" fork="yes"
|
830
|
haltonerror="no">
|
831
|
<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
|
832
|
<classpath>
|
833
|
<path refid="compile.classpath"/>
|
834
|
<fileset dir="${build.dir}">
|
835
|
<include name="${name}.jar"/>
|
836
|
<include name="${name}-client.jar"/>
|
837
|
<include name="harvester.jar"/>
|
838
|
<include name="${name}-junittests.jar"/>
|
839
|
</fileset>
|
840
|
</classpath>
|
841
|
|
842
|
<formatter type="plain" />
|
843
|
|
844
|
<batchtest fork="yes" todir="${build.dir}">
|
845
|
<fileset dir="${build.tests}">
|
846
|
<include name="**/*.class" />
|
847
|
<exclude name="**/MCTestCase.class" />
|
848
|
</fileset>
|
849
|
</batchtest>
|
850
|
</junit>
|
851
|
</target>
|
852
|
|
853
|
<target name="runonetest" depends="testprep"
|
854
|
description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
|
855
|
|
856
|
<echo>testtorun: ${testtorun}</echo>
|
857
|
|
858
|
<!-- use the ant "junit" task to run JUnit tests. -->
|
859
|
<junit printsummary="yes" haltonfailure="no" fork="yes"
|
860
|
haltonerror="no" showoutput="yes">
|
861
|
<!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
|
862
|
<classpath>
|
863
|
<path refid="compile.classpath"/>
|
864
|
<fileset dir="${build.dir}">
|
865
|
<include name="${name}.jar"/>
|
866
|
<include name="${name}-client.jar"/>
|
867
|
<include name="harvester.jar"/>
|
868
|
<include name="${name}-junittests.jar"/>
|
869
|
</fileset>
|
870
|
</classpath>
|
871
|
|
872
|
<formatter type="plain" />
|
873
|
|
874
|
<batchtest fork="yes" todir="${build.dir}">
|
875
|
<fileset dir="${build.tests}">
|
876
|
<include name="**/${testtorun}.class" />
|
877
|
</fileset>
|
878
|
</batchtest>
|
879
|
</junit>
|
880
|
</target>
|
881
|
|
882
|
<target name="testharvester"
|
883
|
depends="testprep"
|
884
|
description="Uses the ant junit task to test only the Harvester code">
|
885
|
<junit printsummary="yes"
|
886
|
haltonfailure="off"
|
887
|
fork="yes"
|
888
|
haltonerror="off">
|
889
|
<classpath>
|
890
|
<path refid="compile.classpath"/>
|
891
|
<fileset dir="${build.dir}">
|
892
|
<include name="${name}.jar"/>
|
893
|
<include name="${name}-client.jar"/>
|
894
|
<include name="harvester.jar"/>
|
895
|
<include name="${name}-junittests.jar"/>
|
896
|
</fileset>
|
897
|
</classpath>
|
898
|
<formatter type="plain" />
|
899
|
<batchtest fork="yes" todir="${build.dir}">
|
900
|
<fileset dir="${build.tests}">
|
901
|
<include name="**/harvesterClient/*.class" />
|
902
|
</fileset>
|
903
|
</batchtest>
|
904
|
</junit>
|
905
|
</target>
|
906
|
|
907
|
<target name="gethttpclient" depends="prepare"
|
908
|
description="checks out and compiles morpho httpclient code">
|
909
|
<!--mkdir dir="${morphosourcedir}" -->
|
910
|
<cvs cvsRoot="${cvsroot}"
|
911
|
package="morpho"
|
912
|
dest="." />
|
913
|
<ant dir="${morphosourcedir}" inheritAll="false" target="jar" />
|
914
|
</target>
|
915
|
|
916
|
<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
|
917
|
<target name="nettest" depends="dev-install"
|
918
|
description="compiles and runs the metacatnettest code">
|
919
|
|
920
|
<echo>***********************************
|
921
|
Please run ant gethttpclient first!
|
922
|
***********************************
|
923
|
</echo>
|
924
|
<!-- copy and compile the tests into a jar file -->
|
925
|
<mkdir dir="${build.metacatnettest}"/>
|
926
|
<javac srcdir="${junitnettestsdir}"
|
927
|
destdir="${build.metacatnettest}"
|
928
|
includes="**/*.java">
|
929
|
<classpath>
|
930
|
<path refid="compile.classpath"/>
|
931
|
<fileset dir="${build.dir}">
|
932
|
<include name="${name}.jar"/>
|
933
|
</fileset>
|
934
|
</classpath>
|
935
|
</javac>
|
936
|
|
937
|
<jar jarfile="${build.dir}/${name}-junitnettests.jar"
|
938
|
basedir="${build.metacatnettest}"
|
939
|
includes="**/*.class" />
|
940
|
|
941
|
<!-- use the ant "junit" task to run JUnit tests. -->
|
942
|
<junit printsummary="yes" haltonfailure="no" fork="yes"
|
943
|
haltonerror="no">
|
944
|
<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
|
945
|
<classpath>
|
946
|
<path refid="compile.classpath"/>
|
947
|
<fileset dir="${build.dir}">
|
948
|
<include name="${name}.jar"/>
|
949
|
<include name="${name}-junitnettests.jar"/>
|
950
|
</fileset>
|
951
|
</classpath>
|
952
|
|
953
|
<formatter type="plain" />
|
954
|
|
955
|
<batchtest fork="yes" todir="${build.dir}">
|
956
|
<fileset dir="${build.metacatnettest}">
|
957
|
<include name="**/*.class" />
|
958
|
</fileset>
|
959
|
</batchtest>
|
960
|
</junit>
|
961
|
</target>
|
962
|
|
963
|
<target name="cleanweb" depends="clean"
|
964
|
description="deletes tomcat web context dir and all its contents">
|
965
|
<delete dir="${installdir}" />
|
966
|
</target>
|
967
|
|
968
|
|
969
|
<target name="clean" depends="init"
|
970
|
description="deletes build dir and files that can be regenerated form the release">
|
971
|
<delete dir="${build.dir}" />
|
972
|
<delete dir="${dist.dir}" />
|
973
|
</target>
|
974
|
|
975
|
<target name="localclean" depends="clean"
|
976
|
description="deletes even jars that depend on external sources such as stylesheets and jars">
|
977
|
<delete file="lib/httpclient.jar" />
|
978
|
<delete file="lib/utilities.jar" />
|
979
|
</target>
|
980
|
|
981
|
<target name="fullclean" depends="localclean"
|
982
|
description="deletes code and eml">
|
983
|
<delete includeEmptyDirs="true" failonerror="false">
|
984
|
<fileset dir="${style-common-cvsrelpath}">
|
985
|
<include name="${eml-css}" />
|
986
|
<include name="eml-*/*.xsl" />
|
987
|
<include name="eml-*" />
|
988
|
</fileset>
|
989
|
<fileset dir="${schema-cvsrelpath}">
|
990
|
<include name="eml-*/*.xsd" />
|
991
|
</fileset>
|
992
|
</delete>
|
993
|
</target>
|
994
|
|
995
|
<target name="jdoc" depends="prepare"
|
996
|
description="generates javadoc documentation">
|
997
|
<javadoc packagenames="edu.ucsb.nceas.*"
|
998
|
sourcepath="${build.src}"
|
999
|
destdir="${build.javadocs}"
|
1000
|
author="true"
|
1001
|
version="true"
|
1002
|
use="true"
|
1003
|
windowtitle="${Name} API"
|
1004
|
doctitle="<h1>${Name}</h1>"
|
1005
|
bottom="<i>Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.</i>">
|
1006
|
<classpath>
|
1007
|
<path refid="compile.classpath"/>
|
1008
|
</classpath>
|
1009
|
</javadoc>
|
1010
|
</target>
|
1011
|
|
1012
|
<target name="dist"
|
1013
|
depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
|
1014
|
description="prepares a full release distribution">
|
1015
|
<mkdir dir="${dist.dir}"/>
|
1016
|
<delete dir="${ver.dir}" />
|
1017
|
<mkdir dir="${ver.dir}"/>
|
1018
|
<copy todir="${ver.dir}">
|
1019
|
<fileset dir="."
|
1020
|
excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
|
1021
|
</copy>
|
1022
|
<copy todir="${ver.dir}" file="build.xml"/>
|
1023
|
<copy todir="${ver.dir}" file="build.properties"/>
|
1024
|
|
1025
|
<copy todir="${ver.dir}/docs" filtering="yes">
|
1026
|
<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
|
1027
|
</copy>
|
1028
|
<copy todir="${ver.dir}/docs" filtering="no">
|
1029
|
<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
|
1030
|
</copy>
|
1031
|
<copy todir="${ver.dir}/docs/dev">
|
1032
|
<fileset dir="${build.dir}/docs"/>
|
1033
|
</copy>
|
1034
|
<copy todir="${ver.dir}/src">
|
1035
|
<fileset dir="${build.dir}/src"/>
|
1036
|
</copy>
|
1037
|
<!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
|
1038
|
<!-- copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/ -->
|
1039
|
<!-- copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/ -->
|
1040
|
<!--
|
1041
|
<delete dir="./${ver.dir}/${build.dir}"/>
|
1042
|
<delete dir="./${ver.dir}/dist"/>
|
1043
|
-->
|
1044
|
<delete file="./${name}-${release}.zip"/>
|
1045
|
<zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
|
1046
|
<delete file="./${name}-${release}.tar.gz" />
|
1047
|
<tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
|
1048
|
<gzip zipfile="./${name}-${release}.tar.gz"
|
1049
|
src="./${name}-${release}.tar"/>
|
1050
|
<delete file="./${name}-${release}.tar" />
|
1051
|
</target>
|
1052
|
|
1053
|
<target name="distsrc" depends="dist"
|
1054
|
description="prepares a source distribution">
|
1055
|
<mkdir dir="${ver.src}"/>
|
1056
|
<copy todir="${ver.src}">
|
1057
|
<fileset dir="./src"/>
|
1058
|
</copy>
|
1059
|
<mkdir dir="${util.dir}"/>
|
1060
|
<copy todir="${util.dir}">
|
1061
|
<fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
|
1062
|
</copy>
|
1063
|
|
1064
|
<mkdir dir="${ecogrid-dist-dir}"/>
|
1065
|
<copy todir="${ecogrid-dist-dir}">
|
1066
|
<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
|
1067
|
</copy>
|
1068
|
|
1069
|
<delete file="${ver.dir}/lib/utilities.jar"/>
|
1070
|
|
1071
|
<delete file="./${name}-src-${release}.zip"/>
|
1072
|
<zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
|
1073
|
<delete file="./${name}-src-${release}.tar.gz" />
|
1074
|
<tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
|
1075
|
<gzip zipfile="./${name}-src-${release}.tar.gz"
|
1076
|
src="./${name}-src-${release}.tar"/>
|
1077
|
<delete file="./${name}-src-${release}.tar" />
|
1078
|
<delete dir="${dist.dir}"/>
|
1079
|
</target>
|
1080
|
|
1081
|
<target name="stylesheettest">
|
1082
|
<xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
|
1083
|
<param name="displaymodule" expression="${displaymodule}"/>
|
1084
|
<param name="docid" expression="${input}"/>
|
1085
|
<param name="entitytype" expression="${entitytype}"/>
|
1086
|
<param name="entityindex" expression="${entityindex}"/>
|
1087
|
<outputproperty name="method" value="html"/>
|
1088
|
<outputproperty name="standalone" value="yes"/>
|
1089
|
<outputproperty name="encoding" value="iso8859_1"/>
|
1090
|
<outputproperty name="indent" value="yes"/>
|
1091
|
</xslt>
|
1092
|
</target>
|
1093
|
|
1094
|
|
1095
|
<target name="compilewebclient" depends="prepare">
|
1096
|
<javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
|
1097
|
</target>
|
1098
|
|
1099
|
<target name="runwebclient" depends="compilewebclient">
|
1100
|
<java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
|
1101
|
dir="${build.dest}" fork="yes"
|
1102
|
classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
|
1103
|
<arg value="${serviceUrl}"/>
|
1104
|
<arg value="${docid}"/>
|
1105
|
</java>
|
1106
|
</target>
|
1107
|
|
1108
|
<target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
|
1109
|
|
1110
|
<echo message="Compiling the metatcat shapefile creator"/>
|
1111
|
<echo message="using the shapelib at: ${shapelib.dir}"/>
|
1112
|
<exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
|
1113
|
<arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
|
1114
|
</exec>
|
1115
|
|
1116
|
<exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
|
1117
|
<arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
|
1118
|
</exec>
|
1119
|
</target>
|
1120
|
|
1121
|
<!-- LSID Authority support -->
|
1122
|
<patternset id="lsid.jars">
|
1123
|
<include name="axis.jar" />
|
1124
|
<include name="commons-discovery-0.2.jar" />
|
1125
|
<include name="jaxrpc.jar" />
|
1126
|
<include name="lsid-client-1.1.1.jar" />
|
1127
|
<include name="lsid-server-1.1.1.jar" />
|
1128
|
<include name="saaj.jar" />
|
1129
|
<include name="wsdl4j-1.5.1.jar" />
|
1130
|
<include name="activation.jar" />
|
1131
|
<include name="castor-0.9.5.jar" />
|
1132
|
<include name="dnsjava-1.3.2.jar" />
|
1133
|
<include name="mail.jar" />
|
1134
|
<include name="commons-logging-1.0.4.jar" />
|
1135
|
<!-- These jars may be needed but seem to not actually be,
|
1136
|
so leaving them out for now
|
1137
|
<include name="axis-ant.jar" />
|
1138
|
-->
|
1139
|
<!--<include name="GenCastor.class" />-->
|
1140
|
</patternset>
|
1141
|
<patternset id="lib.jars">
|
1142
|
<include name="httpclient.jar" />
|
1143
|
<include name="log4j-1.2.12.jar" />
|
1144
|
<include name="utilities.jar" />
|
1145
|
<include name="xercesImpl.jar" />
|
1146
|
<include name="xalan.jar" />
|
1147
|
<include name="xml-apis.jar" />
|
1148
|
</patternset>
|
1149
|
|
1150
|
<path id="lsid.classpath">
|
1151
|
<fileset dir="${lsid.lib.dir}">
|
1152
|
<patternset refid="lsid.jars"/>
|
1153
|
</fileset>
|
1154
|
<fileset dir="${lib.dir}">
|
1155
|
<patternset refid="lsid.jars"/>
|
1156
|
</fileset>
|
1157
|
<fileset dir="${lib.dir}">
|
1158
|
<include name="xalan.jar" />
|
1159
|
<include name="xml-apis.jar" />
|
1160
|
</fileset>
|
1161
|
<fileset dir="${build.dir}">
|
1162
|
<include name="metacat-client.jar" />
|
1163
|
</fileset>
|
1164
|
</path>
|
1165
|
|
1166
|
<filterset id="configFilters">
|
1167
|
<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
|
1168
|
value="${config.hostname}" / -->
|
1169
|
<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
|
1170
|
value="${config.port}" / -->
|
1171
|
<!-- MCD BYE filter token="METADATA_LABELS"
|
1172
|
value="${config.metadataLabelLsid}" / -->
|
1173
|
<!-- MCD BYE filter token="METACAT_SERVER"
|
1174
|
value="${config.metacatserver}" / -->
|
1175
|
<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
|
1176
|
value="${config.lsidauthority}" / -->
|
1177
|
</filterset>
|
1178
|
|
1179
|
<target name="prepare-lsid"
|
1180
|
depends="prepare,utilities,clientjar"
|
1181
|
description="Configure files prior to compilation">
|
1182
|
<mkdir dir="${lsid.build.dir}" />
|
1183
|
<!-- Copy the properties file into the build -->
|
1184
|
<copy file="${conf.dir}/metacat-lsid.properties"
|
1185
|
tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
|
1186
|
overwrite="true">
|
1187
|
<filterset refid="configFilters" />
|
1188
|
</copy>
|
1189
|
<copy file="${conf.dir}/log4j.properties"
|
1190
|
tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
|
1191
|
overwrite="true">
|
1192
|
<filterset refid="configFilters" />
|
1193
|
</copy>
|
1194
|
<!-- Copy config files into the build -->
|
1195
|
<copy todir="${lsid.build.dir}/WEB-INF">
|
1196
|
<fileset dir="${webinf.dir}"
|
1197
|
includes="**/*.wsdd" />
|
1198
|
</copy>
|
1199
|
<!-- Copy the metadata configuration files into the build -->
|
1200
|
<mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
|
1201
|
<copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
|
1202
|
<fileset dir="${conf.dir}"
|
1203
|
includes="**/*.xml" />
|
1204
|
<fileset dir="${conf.dir}"
|
1205
|
includes="**/*.xslt" />
|
1206
|
<filterset refid="configFilters" />
|
1207
|
</copy>
|
1208
|
<!-- Copy services files into the build -->
|
1209
|
<mkdir dir="${lsid.build.dir}/services" />
|
1210
|
<copy todir="${lsid.build.dir}/services">
|
1211
|
<fileset dir="${services.dir}" />
|
1212
|
<filterset refid="configFilters" />
|
1213
|
</copy>
|
1214
|
<!-- Copy axis files into the build -->
|
1215
|
<mkdir dir="${lsid.build.dir}" />
|
1216
|
<copy todir="${lsid.build.dir}">
|
1217
|
<fileset dir="${conf.dir}/axis"
|
1218
|
excludes="*.properties"/>
|
1219
|
</copy>
|
1220
|
<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
|
1221
|
<copy todir="${lsid.build.dir}/WEB-INF/classes">
|
1222
|
<fileset dir="${conf.dir}/axis"
|
1223
|
includes="*.properties"/>
|
1224
|
</copy>
|
1225
|
</target>
|
1226
|
|
1227
|
<target name="compile-lsid"
|
1228
|
depends="prepare-lsid"
|
1229
|
description="Compile Java sources">
|
1230
|
<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
|
1231
|
<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
|
1232
|
destdir="${lsid.build.dir}/WEB-INF/classes"
|
1233
|
debug="${compile.debug}"
|
1234
|
deprecation="${compile.deprecation}"
|
1235
|
optimize="${compile.optimize}">
|
1236
|
<classpath refid="lsid.classpath" />
|
1237
|
</javac>
|
1238
|
</target>
|
1239
|
|
1240
|
<target name="war-lsid"
|
1241
|
depends="compile-lsid"
|
1242
|
description="Create a war file for the application">
|
1243
|
<mkdir dir="${dist.dir}" />
|
1244
|
<war destfile="${dist.dir}/${authority.context}.war"
|
1245
|
webxml="${webinf.dir}/web.xml">
|
1246
|
<fileset dir="${lsid.build.dir}" />
|
1247
|
<lib dir="${lsid.lib.dir}">
|
1248
|
<patternset refid="lsid.jars"/>
|
1249
|
</lib>
|
1250
|
<lib dir="${lib.dir}">
|
1251
|
<patternset refid="lib.jars"/>
|
1252
|
</lib>
|
1253
|
<lib dir="${lib.dir}">
|
1254
|
<include name="xalan.jar" />
|
1255
|
<include name="xml-apis.jar" />
|
1256
|
</lib>
|
1257
|
<lib dir="${build.dir}">
|
1258
|
<include name="metacat-client.jar" />
|
1259
|
</lib>
|
1260
|
</war>
|
1261
|
</target>
|
1262
|
|
1263
|
<target name="deploy-lsid"
|
1264
|
depends="war-lsid"
|
1265
|
description="Deploy LSID war to servlet container">
|
1266
|
<delete dir="${dev.deploy.dir}/${authority.context}" />
|
1267
|
<delete file="${dev.deploy.dir}/${authority.context}.war" />
|
1268
|
<mkdir dir="${dev.deploy.dir}" />
|
1269
|
<copy todir="${dev.deploy.dir}">
|
1270
|
<fileset dir="${dist.dir}" />
|
1271
|
</copy>
|
1272
|
</target>
|
1273
|
</project>
|