Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2 1311 berkley
<!--
3 4969 daigle
	*   '$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$'
10
	*    '$Date$'
11
	*    '$Revision$'
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 1311 berkley
-->
32 5295 jones
<project name="metacat" default="jar" basedir="."
33
         xmlns:artifact="antlib:org.apache.maven.artifact.ant">
34 4969 daigle
	<property environment="env" />
35
	<property file="build.properties" /><!-- USER SPECIFIC PROPS -->
36 3034 perry
37 1801 tao
38 5295 jones
    <!-- Configure the maven2 ant tasks -->
39
    <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.0.jar" />
40
    <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
41
             uri="antlib:org.apache.maven.artifact.ant"
42
             classpathref="maven-ant-tasks.classpath" />
43 2175 tao
44 5815 leinfelder
	<!-- defining the axis tasks -->
45
	<path id="axis.ant.classpath">
46
		<fileset dir="lib/lsid_lib">
47
			<include name="*.jar" />
48
		</fileset>
49
	</path>
50 6003 cjones
51 5815 leinfelder
	<taskdef resource="axis-tasks.properties"
52
		classpathref="axis.ant.classpath" />
53
54 4969 daigle
	<!-- Determine if ecogrid should be installed-->
55
	<condition property="enable.ecogrid">
56
		<equals arg1="${install.ecogrid}" arg2="true" />
57
	</condition>
58 3034 perry
59 4969 daigle
	<!-- Determine if perl should be built-->
60
	<condition property="build.perl">
61
		<equals arg1="${make.perl.code}" arg2="true" />
62
	</condition>
63 3034 perry
64 5311 daigle
	<available file="${build.tomcat.dir}/common/lib/servlet-api.jar"
65
			property="tomcat.common.exists" />
66 5294 jones
67 5311 daigle
	<target name="config" depends="setTomcatCommon, setTomcatNoCommon">
68 4969 daigle
		<!-- usr for client testing, generally you don't need change-->
69
		<property name="mcuser"
70
			value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org" />
71
		<property name="mcpassword" value="kepler" />
72
		<property name="mcanotheruser"
73
			value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org" />
74
		<property name="mcanotherpassword" value="yourpass" />
75
		<property name="piscouser"
76
			value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org" />
77
		<property name="piscopassword" value="yourpass" />
78
		<property name="lteruser"
79
			value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org" />
80
		<property name="lterpassword" value="yourpass" />
81 4943 costa
82 4969 daigle
		<property name="debug" value="on" />
83
		<property name="morphosourcedir" value="../morpho" />
84
		<property name="utilitiesdir" value="../utilities" />
85
		<property name="installdir"
86
			value="${app.deploy.dir}/${metacat.context}" />
87 1929 brooke
88 4969 daigle
		<echo>*********** set jsdk to ${jsdk}</echo>
89
	</target>
90 5311 daigle
91
	<target name="setTomcatCommon" if="tomcat.common.exists" >
92
		<property name="jsdk"
93
			value="${build.tomcat.dir}/common/lib/servlet-api.jar" />
94
	</target>
95
96
	<target name="setTomcatNoCommon" unless="tomcat.common.exists" >
97
		<property name="jsdk"
98
			value="${build.tomcat.dir}/lib/servlet-api.jar" />
99
	</target>
100
101 4969 daigle
	<target name="init" depends="config">
102
		<path id="compile.classpath">
103
			<pathelement location="${jsdk}" />
104
			<pathelement location="lib" />
105
			<fileset dir="lib">
106
				<include name="*.jar" />
107
			</fileset>
108
			<fileset dir="lib">
109
				<include name="xalan.jar" />
110
			</fileset>
111
			<fileset dir="lib/lsid_lib">
112
				<include name="*.jar" />
113
			</fileset>
114 2343 sgarg
115 4969 daigle
			<!-- Include geoserver, geotools, et. al. -->
116
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
117
				<include name="*.jar" />
118
			</fileset>
119 1487 tao
120 4969 daigle
			<!-- Include OAI-PMH -->
121
			<fileset dir="lib/oaipmh">
122
				<include name="*.jar" />
123
			</fileset>
124 806 jones
125 4969 daigle
		</path>
126 5311 daigle
127
		<path id="test.classpath">
128
			<pathelement location="${jsdk}" />
129
			<pathelement location="lib" />
130
			<fileset dir="lib">
131
				<include name="*.jar" />
132
				<exclude name="maven-ant-tasks-2.1.0.jar" />
133
			</fileset>
134
			<fileset dir="lib">
135
				<include name="xalan.jar" />
136
			</fileset>
137
			<fileset dir="lib/lsid_lib">
138
				<include name="*.jar" />
139
			</fileset>
140 2599 jones
141 5311 daigle
			<!-- Include geoserver, geotools, et. al. -->
142
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
143
				<include name="*.jar" />
144
			</fileset>
145 5829 leinfelder
146 5311 daigle
147
			<!-- Include OAI-PMH -->
148
			<fileset dir="lib/oaipmh">
149
				<include name="*.jar" />
150
			</fileset>
151
152
		</path>
153
154 4969 daigle
		<!-- It is less likely you'll need to make any changes from here down,
155
			but customization is possible -->
156
		<property name="name" value="metacat" />
157
		<property name="Name" value="MetaCat" />
158
		<property name="debugprefix" value="${Name}:" />
159
		<property name="release" value="${metacat.version}" />
160
		<property name="style-common-relpath" value="/style/common" />
161
		<property name="style-shared-relpath" value="/style/shared" />
162
		<property name="schema-relpath" value="/schema" />
163
		<property name="style-common-cvsrelpath"
164
			value="lib${style-common-relpath}" />
165
		<property name="schema-cvsrelpath" value="lib${schema-relpath}" />
166
		<property name="style-skins-relpath" value="/style/skins" />
167
		<property name="util-module" value="utilities" />
168 5809 leinfelder
		<!-- property name="utilities-tag" value="trunk" / -->
169 6096 jones
		<property name="utilities-tag" value="tags/UTILITIES_1_1_0_RC2" />
170 6013 leinfelder
		<property name="seek-tag" value="tags/ECOGRID_1_2_2_RC3" />
171 4969 daigle
		<property name="eml-module" value="eml" />
172
		<property name="eml-version" value="2.0.0beta6" />
173
		<property name="eml-beta-tag"
174
			value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT" />
175
		<property name="eml2_0_0-schema-tag"
176
			value="RELEASE_EML_2_0_0_UPDATE_1" />
177
		<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
178
		<property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0" />
179 5809 leinfelder
		<property name="eml2_1_1-schema-tag" value="RELEASE_EML_2_1_1_RC_2" />
180 6026 leinfelder
		<property name="eml2-style-tag" value="RELEASE_EML_UTILS_1_0_0_RC12" />
181 4969 daigle
		<property name="eml2_0_0namespace"
182
			value="eml://ecoinformatics.org/eml-2.0.0" />
183
		<property name="eml2_0_1namespace"
184
			value="eml://ecoinformatics.org/eml-2.0.1" />
185
		<property name="eml2_1_0namespace"
186
			value="eml://ecoinformatics.org/eml-2.1.0" />
187 5709 leinfelder
		<property name="eml2_1_1namespace"
188
			value="eml://ecoinformatics.org/eml-2.1.1" />
189 4969 daigle
		<property name="stmmlnamespace"
190
			value="http://www.xml-cml.org/schema/stmml" />
191
		<property name="eml-css" value="eml_xsl.css" />
192
		<property name="eml-module.default.css" value="default.css" />
193
		<property name="systemidserver" value="" />
194
		<property name="html-path" value="" />
195 5919 tao
		<property name ="metacat-properties-file" value="build/war/WEB-INF/metacat.properties"/>
196 1311 berkley
197 348 jones
198 4969 daigle
		<!-- Config for registry variables -->
199
		<!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
200
		<property name="scope" value="obfs" />
201
		<property name="responseForm" value="genericResponse.tmpl" />
202
		<property name="entryForm" value="entryForm.tmpl" />
203
		<property name="guide" value="genericGuide.tmpl" />
204
		<property name="loginForm" value="loginForm.tmpl" />
205
		<property name="confirmData" value="confirmData.tmpl" />
206
		<property name="deleteData" value="deleteData.tmpl" />
207
		<property name="genericHeader" value="genericHeader.tmpl" />
208
		<property name="genericFooter" value="genericFooter.tmpl" />
209 348 jones
210 4969 daigle
		<filter token="scope" value="${scope}" />
211
		<filter token="responseForm" value="${responseForm}" />
212
		<filter token="entryForm" value="${entryForm}" />
213
		<filter token="guide" value="${guide}" />
214
		<filter token="loginForm" value="${loginForm}" />
215
		<filter token="confirmData" value="${confirmData}" />
216
		<filter token="deleteData" value="${deleteData}" />
217
		<filter token="genericHeader" value="${genericHeader}" />
218
		<filter token="genericFooter" value="${genericFooter}" />
219
		<filter token="adminname" value="${adminname}" />
220
		<filter token="recipient" value="${recipient}" />
221
		<filter token="metacatVersion" value="${metacat.version}" />
222
		<filter token="metacatRC" value="${metacat.releaseCandidate}" />
223
		<filter token="build.context" value="${metacat.context}" />
224
225
		<filter token="docrooturl" value="./" />
226
		<filter token="mcuser" value="${mcuser}" />
227
		<filter token="mcpassword" value="${mcpassword}" />
228
		<filter token="mcanotheruser" value="${mcanotheruser}" />
229
		<filter token="mcanotherpassword" value="${mcanotherpassword}" />
230
		<filter token="eml-css" value="${eml-css}" />
231
		<filter token="style-skins-relpath"
232
			value="${style-skins-relpath}" />
233
		<filter token="style-common-relpath"
234
			value="${style-common-relpath}" />
235
236
		<filter token="eml-version" value="${eml-version}" />
237
		<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}" />
238
		<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}" />
239
		<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}" />
240 5709 leinfelder
		<filter token="eml2_1_1namespace" value="${eml2_1_1namespace}" />
241 4969 daigle
		<filter token="stmmlnamespace" value="${stmmlnamespace}" />
242
		<filter token="debugprefix" value="${debugprefix}" />
243
244
		<filter token="defaultStage" value="${defaultStage}" />
245
		<filter token="defaultHeader" value="${defaultHeader}" />
246
		<filter token="defaultFooter" value="${defaultFooter}" />
247
		<filter token="defaultChangePass" value="${defaultChangePass}" />
248
		<filter token="defaultResetPass" value="${defaultResetPass}" />
249
		<filter token="changePassSuccess" value="${changePassSuccess}" />
250
		<filter token="resetPassSuccess" value="${resetPassSuccess}" />
251
		<filter token="registerFailed" value="${registerFailed}" />
252
		<filter token="registerLter" value="${registerLter}" />
253
		<filter token="registerMatch" value="${registerMatch}" />
254
		<filter token="registerSuccess" value="${registerSuccess}" />
255
		<filter token="register" value="${register}" />
256
		<filter token="searchResults" value="${searchResults}" />
257
		<filter token="ldapMainServerFailure"
258
			value="${ldapMainServerFailure}" />
259
		<filter token="lter-user" value="${lteruser}" />
260
		<filter token="lter-pass" value="${lterpassword}" />
261
		<filter token="pisco-user" value="${piscouser}" />
262
		<filter token="pisco-pass" value="${piscopassword}" />
263
264
265
		<!-- MCD BYE filter token="timedreplication"     value="${timedreplication}" / -->
266
		<!-- MCD BYE filter token="firsttimedreplication" value="${firsttimedreplication}" / -->
267
		<!-- MCD BYE filter token="timedreplicationinterval" value="${timedreplicationinterval}" / -->
268
269
		<property name="srcdir" value="./src" />
270
		<property name="lib.dir" value="./lib" />
271
		<property name="docdir" value="./docs" />
272
		<property name="cgidir" value="./cgi-bin" />
273
		<property name="testdir" value="./test" />
274 6438 leinfelder
		<property name="testtorun" value="HazelcastServiceTest" />
275 4969 daigle
		<property name="junittestsdir"
276
			value="./test/edu/ucsb/nceas/metacattest" />
277
		<property name="junitnettestsdir"
278
			value="./test/edu/ucsb/nceas/metacatnettest" />
279
		<property name="build.dir" value="./build" />
280
		<property name="build.src" value="${build.dir}/src" />
281
		<property name="build.dest" value="${build.dir}/classes" />
282
		<property name="build.samples" value="${build.dir}/samples" />
283
		<property name="build.tests" value="${build.dir}/tests" />
284
		<property name="build.tmp" value="${build.dir}/tmp" />
285
		<property name="build.metacattest"
286
			value="${build.tests}/metacattest" />
287
		<property name="build.metacatnettest"
288
			value="${build.tests}/metacatnettest" />
289
		<property name="build.data" value="${build.dir}/data" />
290
		<property name="build.javadocs" value="${build.dir}/docs/api" />
291
		<property name="build.war" value="${build.dir}/war" />
292
		<property name="dist.dir" value="dist" />
293
		<property name="ver.dir" value="${dist.dir}/${name}-${release}" />
294
		<property name="ver.src" value="${ver.dir}/src" />
295
		<property name="util.dir" value="${dist.dir}/${util-module}" />
296
		<property name="test.dir" value="${dist.dir}/test" />
297
		<!-- directories for creating a Harvest List Editor distribution -->
298
		<property name="dist.dir.hle" value="disthle" />
299
		<property name="ver.dir.hle"
300
			value="${dist.dir.hle}/harvest-list-editor-${release}" />
301
		<property name="pkg.dir" value="./package" />
302
		<property name="deb.pkg.dir" value="${pkg.dir}/debian" />
303
304
		<property name="ecogrid-target-name" value="metacatImpl" />
305
		<property name="ecogrid-module-dest-dir" value=".." />
306
		<property name="ecogrid-module" value="seek/projects/ecogrid" />
307
		<property name="ecogrid-dist-dir"
308
			value="${dist.dir}/${ecogrid-module}" />
309
		<property name="ecogrid-dir"
310
			value="${ecogrid-module-dest-dir}/${ecogrid-module}" />
311
312
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
313
314
		<!-- set up svn -->
315
		<property name="svnant.lib" value="lib" />
316
		<property name="svnant.jar" value="${svnant.lib}/svnant.jar" />
317
		<property name="svnClientAdapter.jar"
318
			value="${svnant.lib}/svnClientAdapter.jar" />
319
		<property name="svnjavahl.jar"
320
			value="${svnant.lib}/svnjavahl.jar" />
321
		<property name="svn.utilitiesUrl"
322 5051 daigle
			value="https://code.ecoinformatics.org/code/utilities/${utilities-tag}" />
323 4969 daigle
		<property name="svn.ecogridUrl"
324 5809 leinfelder
			value="https://code.ecoinformatics.org/code/seek/${seek-tag}/projects/ecogrid/" />
325 5176 daigle
		<property name="svn.emlBetaUrl"
326
			value="https://code.ecoinformatics.org/code/eml/branches/${eml-beta-tag}" />
327
		<property name="svn.eml200SchemaUrl"
328
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_0-schema-tag}" />
329
		<property name="svn.eml201SchemaUrl"
330
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_1-schema-tag}" />
331
		<property name="svn.eml210SchemaUrl"
332
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_0-schema-tag}" />
333 5709 leinfelder
		<property name="svn.eml211SchemaUrl"
334
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_1-schema-tag}" />
335 5176 daigle
		<property name="svn.eml2StyleUrl"
336
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2-style-tag}" />
337 4969 daigle
338
		<!-- load the svn task -->
339
		<path id="svn.classpath">
340
			<pathelement location="${svnjavahl.jar}" />
341
			<pathelement location="${svnant.jar}" />
342
			<pathelement location="${svnClientAdapter.jar}" />
343
		</path>
344
		<taskdef resource="svntask.properties"
345
			classpathref="svn.classpath" />
346
347
		<condition property="utilities.required">
348
			<or>
349
				<not>
350
					<available file="lib/utilities.jar" />
351
				</not>
352
				<not>
353
					<available file="${utilitiesdir}" type="dir" />
354
				</not>
355
			</or>
356
		</condition>
357
		<!-- peer.utilities.required is used when there is no utilities
358
			directory at ${utilitiesdir} -->
359
		<condition property="peer.utilities.required">
360
			<or>
361
				<not>
362
					<available file="${utilitiesdir}" type="dir" />
363
				</not>
364
			</or>
365
		</condition>
366
		<condition property="eml.required">
367
			<or>
368
				<not>
369
					<available file="lib/schema/eml-2.0.1/eml.xsd" />
370
				</not>
371
				<not>
372
					<available file="lib/schema/eml-2.0.0/eml.xsd" />
373
				</not>
374
				<not>
375
					<available file="lib/schema/eml-2.1.0/eml.xsd" />
376
				</not>
377
				<not>
378
					<available
379
						file="lib/dtd/eml-dataset-2.0.0beta6.dtd" />
380
				</not>
381
			</or>
382
		</condition>
383
384
		<condition property="ecogrid.required">
385
			<or>
386
				<not>
387
					<available file="${ecogrid-dir}/build.properties" />
388
				</not>
389
				<not>
390
					<available
391
						file="${ecogrid-dir}/buildfiles/metacatImpl.xml" />
392
				</not>
393
			</or>
394
		</condition>
395
396
	</target>
397
398
	<target name="prepare" depends="init">
399
		<mkdir dir="${build.dir}" />
400
		<mkdir dir="${build.src}" />
401
		<mkdir dir="${build.dest}" />
402
		<mkdir dir="${build.javadocs}" />
403
		<mkdir dir="${build.tmp}" />
404
405
		<copy todir="${build.src}" filtering="yes">
406
			<fileset dir="${srcdir}">
407
				<include name="edu/**" />
408
				<include name="com/**" />
409
				<include name="org/**" />
410
				<!-- include name="java/**" / -->
411
				<include name="**/*.sql" />
412
				<exclude name="**/CVS*" />
413
				<exclude name="**/.#*" />
414 5034 daigle
				<exclude name="edu/ucsb/nceas/workflowscheduler/**" />
415 4969 daigle
			</fileset>
416
		</copy>
417
		<available file="lib/style/common/emlb6toeml2" type="dir"
418
			property="styles.not.needed" />
419
	</target>
420
421 4962 leinfelder
	<target name="generateStubs" depends="prepare">
422 4969 daigle
		<echo
423
			message=" Generating stubs for execution service from ${/tmp/KeplerWebService.wsdl}" />
424
		<axis-wsdl2java verbose="true" output="${srcdir}"
425
			url="/tmp/KeplerWebService.wsdl" />
426 4962 leinfelder
	</target>
427 1939 brooke
428 6438 leinfelder
	<target name="compile" depends="prepare,utilities"
429 4969 daigle
		description="Compiles java code to build dir, and copies metacat props files there">
430 113 jones
431 4969 daigle
		<javac srcdir="${build.src}" destdir="${build.dest}"
432
			debug="${debug}"
433 6053 leinfelder
			excludes="**/*.sql **/client/*.java **/harvesterClient/*.java">
434 4969 daigle
			<classpath>
435
				<path refid="compile.classpath" />
436
			</classpath>
437
		</javac>
438
	</target>
439 1939 brooke
440 6438 leinfelder
	<target name="jar" depends="compile,geteml"
441 4969 daigle
		description="Compiles and jars metacat java code to metacat.jar in build dir ">
442 1311 berkley
443 4969 daigle
		<delete file="${build.dir}/${name}.jar" />
444
		<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
445
			excludes="**/protocols/ **/harvesterClient/" />
446
	</target>
447 113 jones
448 4969 daigle
	<target name="protocol" depends="compile"
449
		description="Compiles and jars protocol java code to protocol.jar in build dir">
450
		<delete file="${build.dir}/protocol.jar" />
451
		<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
452
			includes="**/protocols/" />
453
	</target>
454 4959 daigle
455 4969 daigle
	<target name="utilities" depends="config,getpeerutilities"
456
		if="utilities.required">
457
		<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
458
		<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
459
		<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
460
	</target>
461 1780 jones
462 4969 daigle
	<target name="getpeerutilities" depends="prepare"
463
		if="peer.utilities.required"
464
		description="Checks utilities out of svn and copies it to your utilitiesdir if it does not already exist">
465 5176 daigle
		<echo message="Exporting utilities files from svn repository:" />
466 4969 daigle
		<svn>
467
			<export srcUrl="${svn.utilitiesUrl}"
468
				destPath="${utilitiesdir}" />
469
		</svn>
470 2461 sgarg
471 4969 daigle
		<!--  ant dir="${utilitiesdir}" inheritAll="false"  target="dist" / -->
472
	</target>
473 1780 jones
474 4969 daigle
	<target name="getutilities" depends="prepare"
475 5176 daigle
		description="Checks utility out of svn and copies it to your metacat sandbox">
476 5051 daigle
		<svn>
477
			<export srcUrl="${svn.utilitiesUrl}"
478 5866 leinfelder
				destPath="${utilitiesdir}" force="true" />
479 5051 daigle
		</svn>
480 4969 daigle
	</target>
481 1780 jones
482 4969 daigle
	<target name="client" depends="utilities, prepare"
483
		description="Compiles metacat-client java code to build dir">
484
		<javac srcdir="${build.src}" destdir="${build.dest}"
485
			includes="edu/ucsb/nceas/metacat/client/*">
486
			<classpath>
487
				<path refid="compile.classpath" />
488
			</classpath>
489
		</javac>
490
	</target>
491 2748 costa
492 4969 daigle
	<target name="clientjar" depends="client"
493
		description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
494
		<delete file="${build.dir}/${name}-client.jar" />
495
		<jar jarfile="${build.dir}/${name}-client.jar"
496
			basedir="${build.dest}" includes="**/metacat/client/" />
497
	</target>
498 1950 costa
499 4969 daigle
	<target name="advancedsearchjar" depends="compile"
500
		description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
501
		<delete file="${build.dir}/advancedsearch.jar" />
502
		<jar jarfile="${build.dir}/advancedsearch.jar"
503
			basedir="${build.dest}" includes="**/metacat/advancedsearch/" />
504
	</target>
505 1950 costa
506 4969 daigle
	<target name="harvester" depends="client"
507
		description="Compiles harvester java code to build dir">
508
		<javac srcdir="${build.src}" destdir="${build.dest}"
509
			includes="edu/ucsb/nceas/metacat/harvesterClient/*">
510
			<classpath>
511
				<path refid="compile.classpath" />
512
			</classpath>
513
		</javac>
514
	</target>
515 6003 cjones
516 4969 daigle
	<target name="harvesterjar" depends="harvester"
517
		description="Compiles and jars harvester java code to harvester.jar in build dir">
518
		<delete file="${build.dir}/harvester.jar" />
519
		<jar jarfile="${build.dir}/harvester.jar"
520
			basedir="${build.dest}" includes="**/metacat/harvesterClient/" />
521
	</target>
522 2228 sgarg
523 4969 daigle
	<target name="harvestListEditorDist" depends="harvesterjar"
524
		description="Prepares a distribution of the Harvest List Editor tool">
525
		<mkdir dir="${dist.dir.hle}" />
526
		<delete dir="${ver.dir.hle}" />
527
		<mkdir dir="${ver.dir.hle}" />
528
		<copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar" />
529
		<copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar" />
530
		<copy todir="${ver.dir.hle}"
531
			file="lib/harvester/harvestList.xsd" />
532
		<copy todir="${ver.dir.hle}"
533
			file="lib/harvester/harvestListEditor.bat" />
534
		<copy todir="${ver.dir.hle}"
535
			file="lib/harvester/harvestListEditor.sh" />
536
		<delete file="./harvest-list-editor-${release}.zip" />
537
		<zip zipfile="./harvest-list-editor-${release}.zip"
538
			basedir="${ver.dir.hle}" />
539
		<delete file="./harvest-list-editor-${release}.tar.gz" />
540
		<tar tarfile="./harvest-list-editor-${release}.tar"
541
			basedir="${ver.dir.hle}" />
542
		<gzip zipfile="./harvest-list-editor-${release}.tar.gz"
543
			src="./harvest-list-editor-${release}.tar" />
544
		<delete file="./harvest-list-editor-${release}.tar" />
545
	</target>
546 1939 brooke
547 4969 daigle
	<target name="geteml" depends="getemlpre2,geteml2+,getConversionXSL"
548
		if="eml.required" description="Calls getemlpre2 and geteml2+ targets" />
549 2175 tao
550 4969 daigle
	<target name="getemlpre2" depends="prepare" if="eml.required"
551 5176 daigle
		description="Checks EML-beta6 out of svn and copies dtds and xsl to your metacat sandbox">
552
		<svn>
553
			<export srcUrl="${svn.emlBetaUrl}"
554
				destPath="${build.tmp}/eml_${eml-beta-tag}" />
555
		</svn>
556 4969 daigle
		<mkdir dir="lib/dtd" />
557
		<copy todir="lib/dtd" filtering="yes">
558
			<fileset
559 5176 daigle
				dir="${build.tmp}/eml_${eml-beta-tag}">
560 4969 daigle
				<include name="*.dtd" />
561
			</fileset>
562
			<mapper type="glob" from="eml-*.dtd"
563
				to="eml-*-${eml-version}.dtd" />
564
		</copy>
565 2175 tao
566 4969 daigle
		<copy todir="${style-common-cvsrelpath}" filtering="yes">
567
			<fileset
568 5176 daigle
				dir="${build.tmp}/eml_${eml-beta-tag}/style">
569 4969 daigle
				<include name="**/*.xsl" />
570
			</fileset>
571
		</copy>
572
	</target>
573 2175 tao
574 4969 daigle
	<target name="geteml2+" depends="prepare" if="eml.required"
575 5176 daigle
		description="Checks eml-2 out of svn and copies schema and xsl to your metacat sandbox">
576
		<svn>
577
			<export srcUrl="${svn.eml200SchemaUrl}"
578
				destPath="${build.tmp}/eml_${eml2_0_0-schema-tag}" />
579
		</svn>
580 4969 daigle
		<mkdir dir="lib/schema/eml-2.0.0" />
581
		<copy todir="lib/schema/eml-2.0.0" filtering="yes">
582
			<fileset
583 5176 daigle
				dir="${build.tmp}/eml_${eml2_0_0-schema-tag}">
584 4969 daigle
				<include name="*.xsd" />
585
			</fileset>
586 1939 brooke
587 4969 daigle
			<!-- shouldn't we have a mapper here like this??
588
				<mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
589
590
				Jing's code didn't nave one - does it need to be added?
591
				NOTE that eml-version is set to beta 6, so this would need changing -->
592 4080 daigle
593 4969 daigle
		</copy>
594
		<!-- <antcall target="copyxsl">
595
			<param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
596
			<param name="dirname" value="eml-2.0.0" />
597
			</antcall> -->
598 2175 tao
599 4969 daigle
		<!-- Checkout eml201 for given schema tag-->
600 5176 daigle
		<svn>
601
			<export srcUrl="${svn.eml201SchemaUrl}"
602
				destPath="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
603
		</svn>
604 4969 daigle
		<mkdir dir="lib/schema/eml-2.0.1" />
605
		<copy todir="lib/schema/eml-2.0.1" filtering="yes">
606
			<fileset
607 5176 daigle
				dir="${build.tmp}/eml_${eml2_0_1-schema-tag}">
608 4969 daigle
				<include name="*.xsd" />
609
			</fileset>
610
		</copy>
611 1939 brooke
612 4969 daigle
		<!-- Checkout eml201 again for given style sheet tag-->
613
		<!-- echo>Enter CVS password: </echo>
614
			<cvs cvsRoot="${cvsroot}"
615
			package="${eml-module}"
616
			tag="${eml2_0_1-style-tag}"
617
			dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
618
			<antcall target="copyxsl">
619
			<param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
620
			<param name="dirname" value="eml-2.0.1" />
621
			</antcall -->
622 2175 tao
623 4969 daigle
		<!-- Checkout eml210 for given schema tag-->
624 5176 daigle
		<svn>
625
			<export srcUrl="${svn.eml210SchemaUrl}"
626
				destPath="${build.tmp}/eml_${eml2_1_0-schema-tag}" />
627
		</svn>
628 4969 daigle
		<mkdir dir="lib/schema/eml-2.1.0" />
629
		<copy todir="lib/schema/eml-2.1.0" filtering="yes">
630
			<fileset
631 5176 daigle
				dir="${build.tmp}/eml_${eml2_1_0-schema-tag}">
632 4969 daigle
				<include name="*.xsd" />
633
			</fileset>
634
		</copy>
635 1612 tao
636 4969 daigle
		<!-- Checkout eml210 for given style sheet tag-->
637 5176 daigle
		<svn>
638
			<export srcUrl="${svn.eml2StyleUrl}"
639
				destPath="${build.tmp}/eml_${eml2-style-tag}" />
640
		</svn>
641 4969 daigle
		<antcall target="copyxsl">
642
			<param name="cvs.tagname" value="${eml2-style-tag}" />
643
			<!-- param name="dirname" value="eml-2.1.0" / -->
644
			<param name="dirname" value="eml-2" />
645
		</antcall>
646 5709 leinfelder
647
		<!-- Checkout eml210 for given schema tag-->
648
		<svn>
649
			<export srcUrl="${svn.eml211SchemaUrl}"
650
				destPath="${build.tmp}/eml_${eml2_1_1-schema-tag}" />
651
		</svn>
652
		<mkdir dir="lib/schema/eml-2.1.1" />
653
		<copy todir="lib/schema/eml-2.1.1" filtering="yes">
654
			<fileset
655
				dir="${build.tmp}/eml_${eml2_1_1-schema-tag}">
656
				<include name="*.xsd" />
657
			</fileset>
658
		</copy>
659 4969 daigle
	</target>
660 2353 sgarg
661 4969 daigle
	<target name="copyxsl"
662 5176 daigle
		description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
663 3034 perry
664 4969 daigle
		<delete file="${style-common-cvsrelpath}/${eml-css}" />
665 3034 perry
666 4969 daigle
		<copy todir="${style-common-cvsrelpath}/${dirname}"
667
			filtering="yes">
668
			<fileset
669 5176 daigle
				dir="${build.tmp}/eml_${cvs.tagname}/style/eml">
670 4969 daigle
				<include name="**/*.xsl" />
671
			</fileset>
672
		</copy>
673 3034 perry
674
675 4969 daigle
		<!-- now copy default css from eml module and put it in style-common-path
676
			dir with a new name, so other skin-specific css can import it if reqd -->
677
		<copy
678 5176 daigle
			file="${build.tmp}/eml_${cvs.tagname}/${eml-module.default.css}"
679 4969 daigle
			tofile="${style-common-cvsrelpath}/${eml-css}" />
680 3034 perry
681 4969 daigle
	</target>
682 3034 perry
683 4969 daigle
	<target name="correctEML201Docs" depends="jar"
684
		description="Uses the ant  task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
685
		<copy todir="${build.dir}" file="lib/metacat.properties"
686
			filtering="yes" />
687
		<java
688
			classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector">
689
			<classpath>
690
				<path refid="compile.classpath" />
691
				<fileset dir="${build.dir}">
692
					<include name="${name}.jar" />
693
				</fileset>
694
			</classpath>
695
		</java>
696
	</target>
697 3034 perry
698 4969 daigle
	<target name="install-spatial" depends="jar,clientjar,harvesterjar"
699
		description="Installs spatial option for metacat">
700 3034 perry
701 4969 daigle
		<property name="spatial.dir" value="./lib/spatial" />
702
		<property name="spatial.geoserver.dir"
703
			value="${spatial.dir}/geoserver" />
704
		<property name="spatial.webinf-mods"
705
			value="${spatial.dir}/WEB-INF" />
706 3034 perry
707 4969 daigle
		<!-- Copy geoserver libs into ${war.lib} -->
708
		<copy todir="${war.lib}" filtering="no">
709
			<fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
710
				<include name="**" />
711
			</fileset>
712
		</copy>
713 5872 leinfelder
714
		<copy todir="${dist.dir}">
715
			<fileset dir="./lib/spatial/geoserver" includes="*.war" />
716
		</copy>
717 1952 jones
718 4969 daigle
	</target>
719 4080 daigle
720 4969 daigle
	<target name="install" depends="build-metacat"
721
		description="* Full Install For Development *">
722
		<copy file="${dist.dir}/${metacat.context}.war"
723
			todir="${app.deploy.dir}" />
724 5347 berkley
               <!-- <copy file="${dist.dir}/${metacat.context}.war"
725
                        todir="${app.deploy.dir2}" />-->
726 4969 daigle
		<delete dir="${app.deploy.dir}/${metacat.context}" />
727 5347 berkley
		<!--<delete dir="${app.deploy.dir2}/${metacat.context}" />-->
728 5872 leinfelder
		<copy file="${dist.dir}/geoserver.war"
729
					todir="${app.deploy.dir}" />
730 4969 daigle
		<tstamp>
731
			<format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa" />
732
		</tstamp>
733
		<echo>Dev install completed at ${NOW}</echo>
734
	</target>
735 2343 sgarg
736 5872 leinfelder
	<target name="build-metacat" depends="install-ecogrid, install-spatial"
737 4969 daigle
		description="Build Metacat">
738
	</target>
739 2343 sgarg
740 4969 daigle
	<target name="install-ecogrid" depends="warPrepare, get-ecogrid"
741
		if="enable.ecogrid" description="Install Ecogrid Compentent">
742
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="clean"
743
			inheritall="false">
744
			<property name="context" value="${metacat.context}" />
745
			<property name="target" value="${ecogrid-target-name}" />
746
		</ant>
747
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="war"
748
			inheritall="false">
749
			<property name="context" value="${metacat.context}" />
750
			<property name="target" value="${ecogrid-target-name}" />
751 5473 berkley
			<property name="metacat.dir" value="${basedir}"/>
752 4969 daigle
		</ant>
753
		<!-- war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
754
			<webinf dir="${ecogrid-dir}/lib">
755
			<include name="server-config.wsdd"/>
756
			</webinf>
757
			</war -->
758
		<copy file="${ecogrid-dir}/build/${metacat.context}.war"
759
			todir="${dist.dir}" overwrite="true" />
760 2052 sgarg
761
762 4969 daigle
	</target>
763 2052 sgarg
764 4969 daigle
	<target name="get-ecogrid" depends="init"
765
		description="Check out ecogrid module" if="ecogrid.required">
766
		<svn>
767 5709 leinfelder
			<export srcUrl="${svn.ecogridUrl}" force="true"
768 4969 daigle
				destPath="${ecogrid-dir}" />
769
		</svn>
770
	</target>
771 2052 sgarg
772 4969 daigle
	<!-- target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
773
		<ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
774
		<property name="context" value="${metacat.context}"/>
775
		<property name="target" value="${ecogrid-target-name}"/>
776
		<property name="metacat.dir" value="."/>
777
		<property name="hostname" value="${ecogrid.hostname}"/>
778
		<property name="port" value="${config.port}"/>
779
		</ant>
780
		</target -->
781 1952 jones
782 4969 daigle
	<target name="clean-ecogrid-server-config-wsdd" depends="init"
783
		description="Automately generate wsdd for ecogrid service">
784
		<delete
785
			file="${app.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd" />
786
	</target>
787
788
	<target name="install-skin" depends="init"
789
		description="Install a Skin">
790
791
		<input message="Please enter name of the skin"
792
			addproperty="skin-name" />
793
794
		<mkdir dir="${installdir}/style/skins/${skin-name}" />
795
		<copy todir="${installdir}/style/skins/${skin-name}"
796
			filtering="yes">
797
			<fileset dir="lib/style/skins/${skin-name}">
798
				<exclude name="**/*.png" />
799
				<exclude name="**/*.gif" />
800
				<exclude name="**/*.jpg" />
801
				<exclude name="**/CVS*" />
802
				<exclude name="**/.#*" />
803
			</fileset>
804
		</copy>
805
		<copy todir="${installdir}/style/skins/${skin-name}"
806
			filtering="no">
807
			<fileset dir="lib/style/skins/${skin-name}">
808
				<include name="**/*.png" />
809
				<include name="**/*.gif" />
810
				<include name="**/*.jpg" />
811
				<exclude name="**/CVS*" />
812
				<exclude name="**/.#*" />
813
			</fileset>
814
		</copy>
815
		<copy todir="${installdir}/style/common" filtering="yes">
816
			<fileset dir="lib/style/common">
817
				<include name="*.js" />
818
				<include name="*.jsp" />
819
				<include name="*.css" />
820
				<exclude name="*.png" />
821
				<exclude name="*.gif" />
822
				<exclude name="*.jpg" />
823
				<exclude name="**/CVS*" />
824
				<exclude name="**/.#*" />
825
			</fileset>
826
		</copy>
827
		<!--
828
			<mkdir dir="${installdir}/style/skins/${skin-name}/images" />
829
			<copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
830
			<fileset dir="lib/style/skins/${skin-name}/images">
831
			<include name="*.png"/>
832
			<include name="*.gif"/>
833
			<include name="*.jpg"/>
834
			</fileset>
835
			</copy>
836
		-->
837
838
		<echo message="Install Skin completed." />
839
	</target>
840
841
	<target name="war" depends="warPrepare,install-spatial"
842
		description="Create a web archive (WAR) for servlet deployment">
843
		<mkdir dir="${dist.dir}" />
844
		<war destfile="${dist.dir}/${metacat.context}.war"
845
			webxml="${build.war}/web.xml">
846
			<fileset dir="${war.context}" />
847
			<lib dir="${war.lib}" />
848
			<webinf dir="${war.webinf}" />
849
		</war>
850
	</target>
851
852
	<target name="warPrepare"
853
		depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare"
854
		description="Prepare files for creating a web archive (WAR)">
855
856
		<property name="war.lib" value="${build.war}/lib" />
857
		<property name="war.webinf" value="${build.war}/WEB-INF" />
858
		<property name="war.context"
859
			value="${build.war}/${metacat.context}" />
860
		<property name="war.webinf.sql" value="${war.webinf}/sql" />
861
		<property name="war.webinf.scripts"
862
			value="${war.webinf}/scripts" />
863
		<property name="war.context.cgi" value="${war.context}/cgi-bin" />
864
		<property name="war.context.docs" value="${war.context}/docs" />
865
		<property name="war.context.temp" value="${war.context}/temp" />
866
		<property name="war.context.templates"
867
			value="${war.context}${style-common-relpath}/templates" />
868
		<mkdir dir="${war.lib}" />
869
		<mkdir dir="${war.webinf}" />
870
		<mkdir dir="${war.context}" />
871
		<mkdir dir="${war.webinf.sql}" />
872
		<mkdir dir="${war.context.cgi}" />
873
		<mkdir dir="${war.context.docs}" />
874
		<mkdir dir="${war.context.temp}" />
875
		<mkdir dir="${war.context.templates}" />
876
877
		<!--copy file="${lib.dir}/${jdbc.lib.postgres}" todir="${war.lib}" / -->
878
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver1}" todir="${war.lib}" / -->
879
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver2}" todir="${war.lib}" / -->
880
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver3}" todir="${war.lib}" / -->
881
		<copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
882
		<copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
883
		<copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
884
		<copy todir="${war.lib}" filtering="no">
885
			<fileset dir="lib">
886
				<!--
887
					<not>
888
					<filename name="${jdbc-jar-name}"/>
889
					</not>
890
				-->
891
				<include name="*.jar" />
892 5297 jones
				<exclude name="maven-ant-tasks*.jar" />
893 4969 daigle
			</fileset>
894
			<fileset dir="lib">
895
				<include name="xalan.jar" />
896
				<include name="gwt*.jar" />
897
			</fileset>
898
			<fileset dir="lib/oaipmh">
899
				<include name="oaicat.jar" />
900
			</fileset>
901
		</copy>
902
		<!-- MCD copy file="lib/web.xml.${tomcatversion}"
903
			tofile="${build.war}/web.xml" / -->
904
		<!-- MCD added next - Remove the tomcat5 reference-->
905
		<copy file="lib/web.xml.tomcat5" tofile="${build.war}/web.xml" />
906
		<copy file="lib/metacat.properties" todir="${war.webinf}"
907
			filtering="yes" />
908
		<copy file="lib/metacat.properties.metadata.xml"
909
			todir="${war.webinf}" filtering="no" />
910
		<copy file="lib/org.properties.metadata.xml"
911
			todir="${war.webinf}" filtering="no" />
912
		<copy file="lib/auth.properties.metadata.xml"
913
			todir="${war.webinf}" filtering="no" />
914
		<copy todir="${war.webinf}" filtering="yes">
915
			<fileset dir="lib">
916
				<include name="skin.configs/**" />
917
			</fileset>
918
		</copy>
919
		<copy file="lib/log4j.properties" todir="${war.webinf}"
920
			filtering="yes" />
921
		<copy todir="${war.context}" filtering="no">
922
			<fileset dir="lib">
923
				<include name="**/*.jpg" />
924
				<include name="**/*.png" />
925
				<include name="**/*.gif" />
926
				<include name="LiveMap_30/**" />
927
				<include name="oaipmh/**" />
928
			</fileset>
929
		</copy>
930
		<copy todir="${war.context}" filtering="yes">
931
			<fileset dir="lib">
932
				<exclude name="*.jar" />
933
				<exclude name="*.properties" />
934
				<exclude name="*.metadata.xml" />
935
				<exclude name="web.xml" />
936
				<exclude name="**/*.jpg" />
937
				<exclude name="**/*.png" />
938
				<exclude name="**/*.gif" />
939
				<exclude name="lsid_lib/**" />
940
				<exclude name="lsid_conf/**" />
941
				<exclude name="LiveMap_30/**" />
942
				<exclude name="oaipmh/**" />
943
				<exclude name="skin.configs/**" />
944 5865 leinfelder
				<exclude name="spatial/geoserver/**" />
945 4969 daigle
			</fileset>
946
		</copy>
947 5865 leinfelder
		<copy todir="${war.context}" filtering="no">
948
			<fileset dir="lib">
949
				<include name="spatial/geoserver/data/**" />
950
			</fileset>
951
		</copy>
952 4969 daigle
		<copy todir="${war.context.docs}" filtering="yes">
953
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
954
		</copy>
955
		<copy todir="${war.context.docs}" filtering="no">
956
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
957
		</copy>
958
		<copy todir="${war.webinf.sql}" filtering="yes">
959
			<fileset dir="src">
960
				<include name="**/*.sql" />
961
			</fileset>
962
		</copy>
963
		<copy todir="${war.webinf.scripts}" filtering="yes">
964
			<fileset dir="src/scripts" />
965
		</copy>
966
		<copy todir="${war.webinf.scripts}"
967
			file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
968
			failonerror="false" />
969
970
		<copy file="src/perl/register-dataset.cgi"
971
			todir="${war.context.cgi}" />
972
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
973
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
974
975
		<!-- registry cgi section -->
976
		<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
977
			used in readDocumentFromMetacat -->
978
		<!-- TODO MCD copy temp files to actual location using config util?? -->
979
		<copy todir="${war.context.temp}" filtering="yes">
980
			<fileset dir="lib/style/common/emlb6toeml2">
981
				<include name="*.xsl" />
982
				<include name="*.xml" />
983
			</fileset>
984
		</copy>
985
		<available file="lib/style/common/emlb6toeml2" type="dir"
986
			property="styles.not.needed" />
987
988
		<!-- ldap cgi section -->
989
		<copy todir="${war.context.templates}">
990
			<fileset dir="lib/style/common/templates">
991
				<!-- SCW: Copy all files -->
992
			</fileset>
993
		</copy>
994
	</target>
995
996
	<target name="cgiPrepare" if="build.perl">
997
		<exec dir="src/perl/Metacat/" executable="make">
998 4820 daigle
			<arg value="clean" />
999 4969 daigle
		</exec>
1000
		<exec dir="src/perl/Metacat/" executable="perl">
1001 4369 daigle
			<arg value="Makefile.PL" />
1002
		</exec>
1003 4820 daigle
		<exec dir="src/perl/Metacat/" executable="make" />
1004 4369 daigle
	</target>
1005 4969 daigle
1006 4550 daigle
	<target name="testPrepare"
1007 4435 daigle
		description="Copies test files into the war directories">
1008
		<echo>in testPrepare</echo>
1009 4969 daigle
		<property name="war.context.test"
1010
			value="${build.war}/${metacat.context}/test" />
1011 4435 daigle
		<mkdir dir="${war.context.test}" />
1012 4969 daigle
		<copy todir="${war.context.test}" filtering="yes">
1013
			<fileset dir="test/servertestfiles">
1014
				<include name="*/**" />
1015
			</fileset>
1016 4435 daigle
		</copy>
1017
	</target>
1018 1929 brooke
1019 4969 daigle
	<target name="getConversionXSL" depends="prepare"
1020
		unless="styles.not.needed"
1021
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1022 2497 sgarg
1023 5176 daigle
		<svn>
1024
			<export srcUrl="${svn.eml2StyleUrl}"
1025
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1026
		</svn>
1027 2343 sgarg
1028 4969 daigle
		<mkdir dir="lib/style/common/emlb6toeml2" />
1029
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1030
			<fileset
1031 5176 daigle
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1032 4969 daigle
				<include name="*.xsl" />
1033
				<include name="*.xml" />
1034
			</fileset>
1035
		</copy>
1036
	</target>
1037 1929 brooke
1038 4969 daigle
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1039
		<mkdir dir="${build.tests}" />
1040 5753 leinfelder
		<copy todir="${build.tests}" encoding="UTF-8">
1041 4969 daigle
			<fileset dir="${testdir}">
1042
				<include name="edu/**" />
1043
			</fileset>
1044
		</copy>
1045 5753 leinfelder
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1046 4121 daigle
1047 6003 cjones
		<path id="test.classpath">
1048
			<path refid="compile.classpath" />
1049
			<fileset dir="${build.dir}">
1050
				<include name="${name}.jar" />
1051
				<include name="${name}-client.jar" />
1052
				<include name="harvester.jar" />
1053
			</fileset>
1054
		</path>
1055
1056
		<pathconvert pathsep="${line.separator}|  |--"
1057
		             property="echo.test.classpath"
1058
		             refid="test.classpath">
1059
		</pathconvert>
1060
		<echo message="|--test classpath" />
1061
		<echo message="|  |" />
1062
		<echo message="|  |-- ${echo.test.classpath}" />
1063
1064 4969 daigle
		<!-- copy and compile the tests into a jar file -->
1065
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1066 5753 leinfelder
			debug="on" includes="**/*.java" encoding="UTF-8">
1067 6003 cjones
			<classpath refid="test.classpath" />
1068 4969 daigle
		</javac>
1069 204 jones
1070 4969 daigle
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1071
			basedir="${build.tests}" includes="**/*.class" />
1072 6003 cjones
1073 4969 daigle
	</target>
1074 971 tao
1075 4969 daigle
	<target name="test" depends="testprep"
1076
		description="Uses the ant junit task to run all JUnit tests">
1077 1822 jones
1078 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1079
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1080
			haltonerror="no">
1081 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1082 4969 daigle
			<classpath>
1083 5311 daigle
				<path refid="test.classpath" />
1084 4969 daigle
				<fileset dir="${build.dir}">
1085
					<include name="${name}.jar" />
1086
					<include name="${name}-client.jar" />
1087
					<include name="harvester.jar" />
1088
					<include name="${name}-junittests.jar" />
1089
				</fileset>
1090
			</classpath>
1091 971 tao
1092 4969 daigle
			<formatter type="plain" />
1093 971 tao
1094 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1095
				<fileset dir="${build.tests}">
1096 5009 daigle
					<include name="**/*.class" />
1097 4969 daigle
					<exclude name="**/MCTestCase.class" />
1098
					<exclude name="**/ClientViewHelperTest.class" />
1099 6363 leinfelder
					<!-- these are not test cases -->
1100
					<exclude name="**/MockCNode.class" />
1101
					<exclude name="**/D1NodeServiceTest.class" />
1102 4969 daigle
				</fileset>
1103
			</batchtest>
1104
		</junit>
1105
	</target>
1106 1103 tao
1107 4969 daigle
	<target name="runonetest" depends="testprep"
1108
		description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1109 1500 tao
1110 4969 daigle
		<echo>testtorun: ${testtorun}</echo>
1111 1939 brooke
1112 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1113
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1114
			haltonerror="no" showoutput="yes">
1115 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1116 4969 daigle
			<classpath>
1117 5311 daigle
				<path refid="test.classpath" />
1118 4969 daigle
				<fileset dir="${build.dir}">
1119
					<include name="${name}.jar" />
1120
					<include name="${name}-client.jar" />
1121
					<include name="harvester.jar" />
1122
					<include name="${name}-junittests.jar" />
1123
				</fileset>
1124
			</classpath>
1125 1500 tao
1126 4969 daigle
			<formatter type="plain" />
1127 1500 tao
1128 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1129
				<fileset dir="${build.tests}">
1130
					<include name="**/${testtorun}.class" />
1131
				</fileset>
1132
			</batchtest>
1133
		</junit>
1134
	</target>
1135 1500 tao
1136 4969 daigle
	<target name="testharvester" depends="testprep"
1137
		description="Uses the ant junit task to test only the Harvester code">
1138
		<junit printsummary="yes" haltonfailure="off" fork="yes"
1139
			haltonerror="off">
1140
			<classpath>
1141
				<path refid="compile.classpath" />
1142
				<fileset dir="${build.dir}">
1143
					<include name="${name}.jar" />
1144
					<include name="${name}-client.jar" />
1145
					<include name="harvester.jar" />
1146
					<include name="${name}-junittests.jar" />
1147
				</fileset>
1148
			</classpath>
1149
			<formatter type="plain" />
1150
			<batchtest fork="yes" todir="${build.dir}">
1151
				<fileset dir="${build.tests}">
1152
					<include name="**/harvesterClient/*.class" />
1153
				</fileset>
1154
			</batchtest>
1155
		</junit>
1156
	</target>
1157 2135 costa
1158 4969 daigle
	<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1159
	<target name="nettest" depends="install"
1160
		description="compiles and runs the metacatnettest code">
1161 2175 tao
1162 4969 daigle
		<echo>
1163
			*********************************** Please run ant
1164
			gethttpclient first! ***********************************
1165
		</echo>
1166
		<!-- copy and compile the tests into a jar file -->
1167
		<mkdir dir="${build.metacatnettest}" />
1168
		<javac srcdir="${junitnettestsdir}"
1169
			destdir="${build.metacatnettest}" includes="**/*.java">
1170
			<classpath>
1171
				<path refid="compile.classpath" />
1172
				<fileset dir="${build.dir}">
1173
					<include name="${name}.jar" />
1174
				</fileset>
1175
			</classpath>
1176
		</javac>
1177 1103 tao
1178 4969 daigle
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1179
			basedir="${build.metacatnettest}" includes="**/*.class" />
1180 1103 tao
1181 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1182
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1183
			haltonerror="no">
1184
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1185
			<classpath>
1186
				<path refid="compile.classpath" />
1187
				<fileset dir="${build.dir}">
1188
					<include name="${name}.jar" />
1189
					<include name="${name}-junitnettests.jar" />
1190
				</fileset>
1191
			</classpath>
1192 1103 tao
1193 4969 daigle
			<formatter type="plain" />
1194 1103 tao
1195 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1196
				<fileset dir="${build.metacatnettest}">
1197
					<include name="**/*.class" />
1198
				</fileset>
1199
			</batchtest>
1200
		</junit>
1201
	</target>
1202 1103 tao
1203 4969 daigle
	<target name="cleanweb" depends="clean"
1204
		description="deletes tomcat web context dir and all its contents">
1205
		<delete dir="${installdir}" />
1206
	</target>
1207 1522 berkley
1208
1209 4969 daigle
	<target name="clean" depends="init"
1210
		description="deletes build dir and files that can be regenerated form the release">
1211
		<delete dir="${build.dir}" />
1212
		<delete dir="${dist.dir}" />
1213
	</target>
1214 2320 jones
1215 4098 daigle
	<target name="localclean" depends="clean"
1216 4969 daigle
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1217
		<delete file="lib/utilities.jar" />
1218
	</target>
1219 113 jones
1220 4969 daigle
	<target name="fullclean" depends="localclean"
1221
		description="deletes code and eml">
1222
		<delete includeEmptyDirs="true" failonerror="false">
1223
			<fileset dir="${style-common-cvsrelpath}">
1224
				<include name="${eml-css}" />
1225
				<include name="eml-*/*.xsl" />
1226
				<include name="eml-*" />
1227
			</fileset>
1228
			<fileset dir="${schema-cvsrelpath}">
1229
				<include name="eml-*/*.xsd" />
1230
			</fileset>
1231 5841 tao
			<fileset dir="${ecogrid-dir}"/>
1232 5809 leinfelder
			<fileset dir="lib/style/common/emlb6toeml2"/>
1233
			<fileset dir="lib/dtd"/>
1234
			<fileset dir="lib/schema"/>
1235 6184 tao
			<fileset dir="${utilitiesdir}"/>
1236 4969 daigle
		</delete>
1237
	</target>
1238 113 jones
1239 4969 daigle
	<target name="jdoc" depends="prepare"
1240
		description="generates javadoc documentation">
1241
		<javadoc packagenames="edu.ucsb.nceas.*"
1242
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1243
			version="true" use="true" windowtitle="${Name} API"
1244
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1245
			bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1246
			<classpath>
1247
				<path refid="compile.classpath" />
1248
			</classpath>
1249
		</javadoc>
1250
	</target>
1251 882 jones
1252 4969 daigle
	<target name="dist"
1253 6438 leinfelder
		depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1254 4969 daigle
		description="prepares a full release distribution">
1255
		<mkdir dir="${dist.dir}" />
1256
		<delete dir="${ver.dir}" />
1257
		<mkdir dir="${ver.dir}" />
1258
		<copy todir="${ver.dir}">
1259
			<fileset dir="."
1260
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1261
		</copy>
1262
		<copy todir="${ver.dir}" file="build.xml" />
1263
		<copy todir="${ver.dir}" file="build.properties" />
1264 806 jones
1265 4969 daigle
		<copy todir="${ver.dir}/docs" filtering="yes">
1266
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1267
		</copy>
1268
		<copy todir="${ver.dir}/docs" filtering="no">
1269
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1270
		</copy>
1271
		<copy todir="${ver.dir}/docs/dev">
1272
			<fileset dir="${build.dir}/docs" />
1273
		</copy>
1274
		<copy todir="${ver.dir}/src">
1275
			<fileset dir="${build.dir}/src" />
1276
		</copy>
1277
1278
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1279
		<copy todir="${ver.dir}/test/servertestfiles">
1280
			<fileset dir="./test/servertestfiles" />
1281
		</copy>
1282
	</target>
1283
1284
	<target name="distbin" depends="build-metacat,war-lsid"
1285
		description="prepares a binary distribution">
1286 4372 daigle
		<copy todir="${dist.dir}">
1287 4969 daigle
			<fileset dir="./src/scripts" />
1288
		</copy>
1289 4372 daigle
		<delete file="./${name}-bin-${release}.zip" />
1290 4969 daigle
		<zip zipfile="./${name}-bin-${release}.zip"
1291
			basedir="${dist.dir}" excludes="metacat-*/**" />
1292 4372 daigle
		<delete file="./${name}-bin-${release}.tar.gz" />
1293 4969 daigle
		<tar tarfile="./${name}-bin-${release}.tar"
1294
			basedir="${dist.dir}" excludes="metacat-*/**" />
1295
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1296
			src="./${name}-bin-${release}.tar" />
1297 4372 daigle
		<delete file="./${name}-bin-${release}.tar" />
1298
	</target>
1299 806 jones
1300 4969 daigle
	<target name="distsrc" depends="dist"
1301
		description="prepares a source distribution">
1302
		<mkdir dir="${ver.src}" />
1303
		<copy todir="${ver.src}">
1304
			<fileset dir="./src" />
1305
		</copy>
1306
		<mkdir dir="${util.dir}" />
1307
		<copy todir="${util.dir}">
1308
			<fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1309
		</copy>
1310 3131 perry
1311 4969 daigle
		<mkdir dir="${ecogrid-dist-dir}" />
1312
		<copy todir="${ecogrid-dist-dir}">
1313
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1314
		</copy>
1315 806 jones
1316 4969 daigle
		<delete file="${ver.dir}/lib/utilities.jar" />
1317 2175 tao
1318 4969 daigle
		<delete file="./${name}-src-${release}.zip" />
1319
		<zip zipfile="./${name}-src-${release}.zip"
1320
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1321
		<delete file="./${name}-src-${release}.tar.gz" />
1322
		<tar tarfile="./${name}-src-${release}.tar"
1323
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1324
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1325
			src="./${name}-src-${release}.tar" />
1326
		<delete file="./${name}-src-${release}.tar" />
1327
		<!--delete dir="${dist.dir}"/ -->
1328
	</target>
1329 2175 tao
1330 4969 daigle
	<target name="deb-package" depends="distbin"
1331
		description="create a debian installation package">
1332
		<delete dir="${deb.pkg.dir}" />
1333
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1334
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1335
			<fileset dir="./src/scripts/debian"
1336
				includes="control postinst" />
1337
		</copy>
1338 2598 harris
1339 4969 daigle
		<mkdir
1340
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1341
		<copy
1342
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1343
			filtering="yes">
1344
			<fileset dir="./src/scripts/debian"
1345
				excludes="control postinst" />
1346
		</copy>
1347
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1348 2598 harris
1349 4969 daigle
		<copy file="${dist.dir}/knb.war"
1350
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1351
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1352
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1353 2737 jones
1354 4969 daigle
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1355
			failonerror="true">
1356
			<arg line="--build debian" />
1357
		</exec>
1358 2737 jones
1359 4969 daigle
		<move file="${pkg.dir}/debian.deb"
1360
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1361
	</target>
1362
1363
	<target name="stylesheettest">
1364
		<xslt in="${input}" out="eml.html"
1365
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1366
			<param name="displaymodule" expression="${displaymodule}" />
1367
			<param name="docid" expression="${input}" />
1368
			<param name="entitytype" expression="${entitytype}" />
1369
			<param name="entityindex" expression="${entityindex}" />
1370
			<outputproperty name="method" value="html" />
1371
			<outputproperty name="standalone" value="yes" />
1372
			<outputproperty name="encoding" value="iso8859_1" />
1373
			<outputproperty name="indent" value="yes" />
1374
		</xslt>
1375
	</target>
1376
1377
	<target name="spatial_option" depends="prepare"
1378
		description=" -- compiles code for the spatial option">
1379
1380
		<echo message="Compiling the metatcat shapefile creator" />
1381
		<echo message="using the shapelib at: ${shapelib.dir}" />
1382
		<exec dir="." executable="g++" os="Linux, Unix"
1383
			failonerror="true">
1384
			<arg
1385
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1386
		</exec>
1387
1388
		<exec dir="." executable="g++" os="Linux, Unix"
1389
			failonerror="true">
1390
			<arg
1391
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1392
		</exec>
1393
	</target>
1394
1395
	<!-- LSID Authority support -->
1396
	<patternset id="lsid.jars">
1397
		<include name="axis.jar" />
1398
		<include name="commons-discovery-0.2.jar" />
1399
		<include name="jaxrpc.jar" />
1400
		<include name="lsid-client-1.1.1.jar" />
1401
		<include name="lsid-server-1.1.1.jar" />
1402
		<include name="saaj.jar" />
1403
		<include name="wsdl4j-1.5.1.jar" />
1404
		<include name="activation.jar" />
1405
		<include name="castor-0.9.5.jar" />
1406
		<include name="dnsjava-1.3.2.jar" />
1407
		<include name="mail.jar" />
1408
		<include name="commons-logging-1.0.4.jar" />
1409
		<!-- These jars may be needed but seem to not actually be,
1410
			so leaving them out for now
1411
			<include name="axis-ant.jar" />
1412
		-->
1413
		<!--<include name="GenCastor.class" />-->
1414
	</patternset>
1415
	<patternset id="lib.jars">
1416
		<include name="log4j-1.2.12.jar" />
1417
		<include name="utilities.jar" />
1418 5866 leinfelder
		<include name="xerces*.jar" />
1419
		<include name="xalan*.jar" />
1420 4969 daigle
		<include name="xml-apis.jar" />
1421
	</patternset>
1422
1423
	<path id="lsid.classpath">
1424
		<fileset dir="${lsid.lib.dir}">
1425
			<patternset refid="lsid.jars" />
1426
		</fileset>
1427
		<fileset dir="${lib.dir}">
1428 5866 leinfelder
			<patternset refid="lib.jars" />
1429 4969 daigle
		</fileset>
1430
		<fileset dir="${build.dir}">
1431
			<include name="metacat-client.jar" />
1432 5866 leinfelder
			<include name="metacat.jar" />
1433 4969 daigle
		</fileset>
1434
	</path>
1435
1436
	<filterset id="configFilters">
1437
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1438
			value="${config.hostname}" / -->
1439
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1440
			value="${config.port}" / -->
1441
		<!-- MCD BYE filter token="METADATA_LABELS"
1442
			value="${config.metadataLabelLsid}" / -->
1443
		<!-- MCD BYE filter token="METACAT_SERVER"
1444
			value="${config.metacatserver}" / -->
1445
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1446
			value="${config.lsidauthority}" / -->
1447
	</filterset>
1448
1449
	<target name="prepare-lsid" depends="prepare,utilities,clientjar"
1450
		description="Configure files prior to compilation">
1451
		<mkdir dir="${lsid.build.dir}" />
1452
		<!-- Copy the properties file into the build -->
1453
		<copy file="${conf.dir}/metacat-lsid.properties"
1454
			tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1455
			overwrite="true">
1456
			<filterset refid="configFilters" />
1457
		</copy>
1458
		<copy file="${conf.dir}/log4j.properties"
1459
			tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1460
			overwrite="true">
1461
			<filterset refid="configFilters" />
1462
		</copy>
1463
		<!-- Copy config files into the build -->
1464
		<copy todir="${lsid.build.dir}/WEB-INF">
1465
			<fileset dir="${webinf.dir}" includes="**/*.wsdd" />
1466
		</copy>
1467
		<!-- Copy the metadata configuration files into the build -->
1468
		<mkdir
1469
			dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1470
		<copy
1471
			todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1472
			<fileset dir="${conf.dir}" includes="**/*.xml" />
1473
			<fileset dir="${conf.dir}" includes="**/*.xslt" />
1474
			<filterset refid="configFilters" />
1475
		</copy>
1476
		<!-- Copy services files into the build -->
1477
		<mkdir dir="${lsid.build.dir}/services" />
1478
		<copy todir="${lsid.build.dir}/services">
1479
			<fileset dir="${services.dir}" />
1480
			<filterset refid="configFilters" />
1481
		</copy>
1482
		<!-- Copy axis files into the build -->
1483
		<mkdir dir="${lsid.build.dir}" />
1484
		<copy todir="${lsid.build.dir}">
1485
			<fileset dir="${conf.dir}/axis" excludes="*.properties" />
1486
		</copy>
1487
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1488
		<copy todir="${lsid.build.dir}/WEB-INF/classes">
1489
			<fileset dir="${conf.dir}/axis" includes="*.properties" />
1490
		</copy>
1491
	</target>
1492
1493
	<target name="compile-lsid" depends="prepare-lsid"
1494
		description="Compile Java sources">
1495
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1496
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1497
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1498
			deprecation="${compile.deprecation}"
1499
			optimize="${compile.optimize}">
1500
			<classpath refid="lsid.classpath" />
1501
		</javac>
1502
	</target>
1503
1504
	<target name="war-lsid" depends="compile-lsid"
1505
		description="Create a war file for the application">
1506
		<mkdir dir="${dist.dir}" />
1507
		<war destfile="${dist.dir}/${authority.context}.war"
1508
			webxml="${webinf.dir}/web.xml">
1509
			<fileset dir="${lsid.build.dir}" />
1510
			<lib dir="${lsid.lib.dir}">
1511
				<patternset refid="lsid.jars" />
1512
			</lib>
1513
			<lib dir="${lib.dir}">
1514
				<patternset refid="lib.jars" />
1515
			</lib>
1516
			<lib dir="${lib.dir}">
1517
				<include name="xalan.jar" />
1518
				<include name="xml-apis.jar" />
1519
			</lib>
1520
			<lib dir="${build.dir}">
1521
				<include name="metacat-client.jar" />
1522
			</lib>
1523
		</war>
1524
	</target>
1525
1526
	<target name="deploy-lsid" depends="war-lsid"
1527
		description="Deploy LSID war to servlet container">
1528
		<delete dir="${app.deploy.dir}/${authority.context}" />
1529
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1530
		<mkdir dir="${app.deploy.dir}" />
1531
		<copy todir="${app.deploy.dir}">
1532
			<fileset dir="${dist.dir}" />
1533
		</copy>
1534
	</target>
1535 5919 tao
1536
	<target name="change-metacat-properties" depends="warPrepare"
1537
        description="Chage some default values of metacat.properties">
1538 5924 tao
       <echo file="${metacat-properties-file}" append="true">
1539
		   configutil.propertiesConfigured=true
1540
		   configutil.authConfigured=true
1541
           configutil.skinsConfigured=true
1542
		   configutil.databaseConfigured=true
1543
		   configutil.geoserverConfigured=true
1544
	   </echo>
1545 6003 cjones
  </target>
1546 5919 tao
1547 5925 tao
	<!-- This target will use default values in svn metacat.properties to build a configured
1548
		metacat (except configuti.* properties, they will be set true). Those default settings
1549
		are for a test machine. It may not work on your system-->
1550 5924 tao
	<target name="install-configured-metacat" depends="change-metacat-properties, install"
1551 5919 tao
        description="Install a metacat by the default value in metacat.properties without additional configutaion">
1552
    </target>
1553
1554 113 jones
</project>