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 6486 leinfelder
		<property name="testtorun" value="CNodeServiceTest" />
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 6486 leinfelder
		<copy file="lib/hazelcast.xml" todir="${war.webinf}"
922
			filtering="yes" />
923 4969 daigle
		<copy todir="${war.context}" filtering="no">
924
			<fileset dir="lib">
925
				<include name="**/*.jpg" />
926
				<include name="**/*.png" />
927
				<include name="**/*.gif" />
928
				<include name="LiveMap_30/**" />
929
				<include name="oaipmh/**" />
930
			</fileset>
931
		</copy>
932
		<copy todir="${war.context}" filtering="yes">
933
			<fileset dir="lib">
934
				<exclude name="*.jar" />
935
				<exclude name="*.properties" />
936
				<exclude name="*.metadata.xml" />
937
				<exclude name="web.xml" />
938
				<exclude name="**/*.jpg" />
939
				<exclude name="**/*.png" />
940
				<exclude name="**/*.gif" />
941
				<exclude name="lsid_lib/**" />
942
				<exclude name="lsid_conf/**" />
943
				<exclude name="LiveMap_30/**" />
944
				<exclude name="oaipmh/**" />
945
				<exclude name="skin.configs/**" />
946 5865 leinfelder
				<exclude name="spatial/geoserver/**" />
947 4969 daigle
			</fileset>
948
		</copy>
949 5865 leinfelder
		<copy todir="${war.context}" filtering="no">
950
			<fileset dir="lib">
951
				<include name="spatial/geoserver/data/**" />
952
			</fileset>
953
		</copy>
954 4969 daigle
		<copy todir="${war.context.docs}" filtering="yes">
955
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
956
		</copy>
957
		<copy todir="${war.context.docs}" filtering="no">
958
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
959
		</copy>
960
		<copy todir="${war.webinf.sql}" filtering="yes">
961
			<fileset dir="src">
962
				<include name="**/*.sql" />
963
			</fileset>
964
		</copy>
965
		<copy todir="${war.webinf.scripts}" filtering="yes">
966
			<fileset dir="src/scripts" />
967
		</copy>
968
		<copy todir="${war.webinf.scripts}"
969
			file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
970
			failonerror="false" />
971
972
		<copy file="src/perl/register-dataset.cgi"
973
			todir="${war.context.cgi}" />
974
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
975
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
976
977
		<!-- registry cgi section -->
978
		<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
979
			used in readDocumentFromMetacat -->
980
		<!-- TODO MCD copy temp files to actual location using config util?? -->
981
		<copy todir="${war.context.temp}" filtering="yes">
982
			<fileset dir="lib/style/common/emlb6toeml2">
983
				<include name="*.xsl" />
984
				<include name="*.xml" />
985
			</fileset>
986
		</copy>
987
		<available file="lib/style/common/emlb6toeml2" type="dir"
988
			property="styles.not.needed" />
989
990
		<!-- ldap cgi section -->
991
		<copy todir="${war.context.templates}">
992
			<fileset dir="lib/style/common/templates">
993
				<!-- SCW: Copy all files -->
994
			</fileset>
995
		</copy>
996
	</target>
997
998
	<target name="cgiPrepare" if="build.perl">
999
		<exec dir="src/perl/Metacat/" executable="make">
1000 4820 daigle
			<arg value="clean" />
1001 4969 daigle
		</exec>
1002
		<exec dir="src/perl/Metacat/" executable="perl">
1003 4369 daigle
			<arg value="Makefile.PL" />
1004
		</exec>
1005 4820 daigle
		<exec dir="src/perl/Metacat/" executable="make" />
1006 4369 daigle
	</target>
1007 4969 daigle
1008 4550 daigle
	<target name="testPrepare"
1009 4435 daigle
		description="Copies test files into the war directories">
1010
		<echo>in testPrepare</echo>
1011 4969 daigle
		<property name="war.context.test"
1012
			value="${build.war}/${metacat.context}/test" />
1013 4435 daigle
		<mkdir dir="${war.context.test}" />
1014 4969 daigle
		<copy todir="${war.context.test}" filtering="yes">
1015
			<fileset dir="test/servertestfiles">
1016
				<include name="*/**" />
1017
			</fileset>
1018 4435 daigle
		</copy>
1019
	</target>
1020 1929 brooke
1021 4969 daigle
	<target name="getConversionXSL" depends="prepare"
1022
		unless="styles.not.needed"
1023
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1024 2497 sgarg
1025 5176 daigle
		<svn>
1026
			<export srcUrl="${svn.eml2StyleUrl}"
1027
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1028
		</svn>
1029 2343 sgarg
1030 4969 daigle
		<mkdir dir="lib/style/common/emlb6toeml2" />
1031
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1032
			<fileset
1033 5176 daigle
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1034 4969 daigle
				<include name="*.xsl" />
1035
				<include name="*.xml" />
1036
			</fileset>
1037
		</copy>
1038
	</target>
1039 1929 brooke
1040 4969 daigle
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1041
		<mkdir dir="${build.tests}" />
1042 5753 leinfelder
		<copy todir="${build.tests}" encoding="UTF-8">
1043 4969 daigle
			<fileset dir="${testdir}">
1044
				<include name="edu/**" />
1045
			</fileset>
1046
		</copy>
1047 5753 leinfelder
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1048 4121 daigle
1049 6003 cjones
		<path id="test.classpath">
1050
			<path refid="compile.classpath" />
1051
			<fileset dir="${build.dir}">
1052
				<include name="${name}.jar" />
1053
				<include name="${name}-client.jar" />
1054
				<include name="harvester.jar" />
1055
			</fileset>
1056
		</path>
1057
1058
		<pathconvert pathsep="${line.separator}|  |--"
1059
		             property="echo.test.classpath"
1060
		             refid="test.classpath">
1061
		</pathconvert>
1062
		<echo message="|--test classpath" />
1063
		<echo message="|  |" />
1064
		<echo message="|  |-- ${echo.test.classpath}" />
1065
1066 4969 daigle
		<!-- copy and compile the tests into a jar file -->
1067
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1068 5753 leinfelder
			debug="on" includes="**/*.java" encoding="UTF-8">
1069 6003 cjones
			<classpath refid="test.classpath" />
1070 4969 daigle
		</javac>
1071 204 jones
1072 4969 daigle
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1073
			basedir="${build.tests}" includes="**/*.class" />
1074 6003 cjones
1075 4969 daigle
	</target>
1076 971 tao
1077 4969 daigle
	<target name="test" depends="testprep"
1078
		description="Uses the ant junit task to run all JUnit tests">
1079 1822 jones
1080 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1081
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1082
			haltonerror="no">
1083 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1084 4969 daigle
			<classpath>
1085 5311 daigle
				<path refid="test.classpath" />
1086 4969 daigle
				<fileset dir="${build.dir}">
1087
					<include name="${name}.jar" />
1088
					<include name="${name}-client.jar" />
1089
					<include name="harvester.jar" />
1090
					<include name="${name}-junittests.jar" />
1091
				</fileset>
1092
			</classpath>
1093 971 tao
1094 4969 daigle
			<formatter type="plain" />
1095 971 tao
1096 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1097
				<fileset dir="${build.tests}">
1098 5009 daigle
					<include name="**/*.class" />
1099 4969 daigle
					<exclude name="**/MCTestCase.class" />
1100
					<exclude name="**/ClientViewHelperTest.class" />
1101 6363 leinfelder
					<!-- these are not test cases -->
1102
					<exclude name="**/MockCNode.class" />
1103
					<exclude name="**/D1NodeServiceTest.class" />
1104 4969 daigle
				</fileset>
1105
			</batchtest>
1106
		</junit>
1107
	</target>
1108 1103 tao
1109 4969 daigle
	<target name="runonetest" depends="testprep"
1110
		description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1111 1500 tao
1112 4969 daigle
		<echo>testtorun: ${testtorun}</echo>
1113 1939 brooke
1114 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1115
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1116
			haltonerror="no" showoutput="yes">
1117 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1118 4969 daigle
			<classpath>
1119 5311 daigle
				<path refid="test.classpath" />
1120 4969 daigle
				<fileset dir="${build.dir}">
1121
					<include name="${name}.jar" />
1122
					<include name="${name}-client.jar" />
1123
					<include name="harvester.jar" />
1124
					<include name="${name}-junittests.jar" />
1125
				</fileset>
1126
			</classpath>
1127 1500 tao
1128 4969 daigle
			<formatter type="plain" />
1129 1500 tao
1130 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1131
				<fileset dir="${build.tests}">
1132
					<include name="**/${testtorun}.class" />
1133
				</fileset>
1134
			</batchtest>
1135
		</junit>
1136
	</target>
1137 1500 tao
1138 4969 daigle
	<target name="testharvester" depends="testprep"
1139
		description="Uses the ant junit task to test only the Harvester code">
1140
		<junit printsummary="yes" haltonfailure="off" fork="yes"
1141
			haltonerror="off">
1142
			<classpath>
1143
				<path refid="compile.classpath" />
1144
				<fileset dir="${build.dir}">
1145
					<include name="${name}.jar" />
1146
					<include name="${name}-client.jar" />
1147
					<include name="harvester.jar" />
1148
					<include name="${name}-junittests.jar" />
1149
				</fileset>
1150
			</classpath>
1151
			<formatter type="plain" />
1152
			<batchtest fork="yes" todir="${build.dir}">
1153
				<fileset dir="${build.tests}">
1154
					<include name="**/harvesterClient/*.class" />
1155
				</fileset>
1156
			</batchtest>
1157
		</junit>
1158
	</target>
1159 2135 costa
1160 4969 daigle
	<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1161
	<target name="nettest" depends="install"
1162
		description="compiles and runs the metacatnettest code">
1163 2175 tao
1164 4969 daigle
		<echo>
1165
			*********************************** Please run ant
1166
			gethttpclient first! ***********************************
1167
		</echo>
1168
		<!-- copy and compile the tests into a jar file -->
1169
		<mkdir dir="${build.metacatnettest}" />
1170
		<javac srcdir="${junitnettestsdir}"
1171
			destdir="${build.metacatnettest}" includes="**/*.java">
1172
			<classpath>
1173
				<path refid="compile.classpath" />
1174
				<fileset dir="${build.dir}">
1175
					<include name="${name}.jar" />
1176
				</fileset>
1177
			</classpath>
1178
		</javac>
1179 1103 tao
1180 4969 daigle
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1181
			basedir="${build.metacatnettest}" includes="**/*.class" />
1182 1103 tao
1183 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1184
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1185
			haltonerror="no">
1186
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1187
			<classpath>
1188
				<path refid="compile.classpath" />
1189
				<fileset dir="${build.dir}">
1190
					<include name="${name}.jar" />
1191
					<include name="${name}-junitnettests.jar" />
1192
				</fileset>
1193
			</classpath>
1194 1103 tao
1195 4969 daigle
			<formatter type="plain" />
1196 1103 tao
1197 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1198
				<fileset dir="${build.metacatnettest}">
1199
					<include name="**/*.class" />
1200
				</fileset>
1201
			</batchtest>
1202
		</junit>
1203
	</target>
1204 1103 tao
1205 4969 daigle
	<target name="cleanweb" depends="clean"
1206
		description="deletes tomcat web context dir and all its contents">
1207
		<delete dir="${installdir}" />
1208
	</target>
1209 1522 berkley
1210
1211 4969 daigle
	<target name="clean" depends="init"
1212
		description="deletes build dir and files that can be regenerated form the release">
1213
		<delete dir="${build.dir}" />
1214
		<delete dir="${dist.dir}" />
1215
	</target>
1216 2320 jones
1217 4098 daigle
	<target name="localclean" depends="clean"
1218 4969 daigle
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1219
		<delete file="lib/utilities.jar" />
1220
	</target>
1221 113 jones
1222 4969 daigle
	<target name="fullclean" depends="localclean"
1223
		description="deletes code and eml">
1224
		<delete includeEmptyDirs="true" failonerror="false">
1225
			<fileset dir="${style-common-cvsrelpath}">
1226
				<include name="${eml-css}" />
1227
				<include name="eml-*/*.xsl" />
1228
				<include name="eml-*" />
1229
			</fileset>
1230
			<fileset dir="${schema-cvsrelpath}">
1231
				<include name="eml-*/*.xsd" />
1232
			</fileset>
1233 5841 tao
			<fileset dir="${ecogrid-dir}"/>
1234 5809 leinfelder
			<fileset dir="lib/style/common/emlb6toeml2"/>
1235
			<fileset dir="lib/dtd"/>
1236
			<fileset dir="lib/schema"/>
1237 6184 tao
			<fileset dir="${utilitiesdir}"/>
1238 4969 daigle
		</delete>
1239
	</target>
1240 113 jones
1241 4969 daigle
	<target name="jdoc" depends="prepare"
1242
		description="generates javadoc documentation">
1243
		<javadoc packagenames="edu.ucsb.nceas.*"
1244
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1245
			version="true" use="true" windowtitle="${Name} API"
1246
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1247
			bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1248
			<classpath>
1249
				<path refid="compile.classpath" />
1250
			</classpath>
1251
		</javadoc>
1252
	</target>
1253 882 jones
1254 4969 daigle
	<target name="dist"
1255 6438 leinfelder
		depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1256 4969 daigle
		description="prepares a full release distribution">
1257
		<mkdir dir="${dist.dir}" />
1258
		<delete dir="${ver.dir}" />
1259
		<mkdir dir="${ver.dir}" />
1260
		<copy todir="${ver.dir}">
1261
			<fileset dir="."
1262
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1263
		</copy>
1264
		<copy todir="${ver.dir}" file="build.xml" />
1265
		<copy todir="${ver.dir}" file="build.properties" />
1266 806 jones
1267 4969 daigle
		<copy todir="${ver.dir}/docs" filtering="yes">
1268
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1269
		</copy>
1270
		<copy todir="${ver.dir}/docs" filtering="no">
1271
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1272
		</copy>
1273
		<copy todir="${ver.dir}/docs/dev">
1274
			<fileset dir="${build.dir}/docs" />
1275
		</copy>
1276
		<copy todir="${ver.dir}/src">
1277
			<fileset dir="${build.dir}/src" />
1278
		</copy>
1279
1280
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1281
		<copy todir="${ver.dir}/test/servertestfiles">
1282
			<fileset dir="./test/servertestfiles" />
1283
		</copy>
1284
	</target>
1285
1286
	<target name="distbin" depends="build-metacat,war-lsid"
1287
		description="prepares a binary distribution">
1288 4372 daigle
		<copy todir="${dist.dir}">
1289 4969 daigle
			<fileset dir="./src/scripts" />
1290
		</copy>
1291 4372 daigle
		<delete file="./${name}-bin-${release}.zip" />
1292 4969 daigle
		<zip zipfile="./${name}-bin-${release}.zip"
1293
			basedir="${dist.dir}" excludes="metacat-*/**" />
1294 4372 daigle
		<delete file="./${name}-bin-${release}.tar.gz" />
1295 4969 daigle
		<tar tarfile="./${name}-bin-${release}.tar"
1296
			basedir="${dist.dir}" excludes="metacat-*/**" />
1297
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1298
			src="./${name}-bin-${release}.tar" />
1299 4372 daigle
		<delete file="./${name}-bin-${release}.tar" />
1300
	</target>
1301 806 jones
1302 4969 daigle
	<target name="distsrc" depends="dist"
1303
		description="prepares a source distribution">
1304
		<mkdir dir="${ver.src}" />
1305
		<copy todir="${ver.src}">
1306
			<fileset dir="./src" />
1307
		</copy>
1308
		<mkdir dir="${util.dir}" />
1309
		<copy todir="${util.dir}">
1310
			<fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1311
		</copy>
1312 3131 perry
1313 4969 daigle
		<mkdir dir="${ecogrid-dist-dir}" />
1314
		<copy todir="${ecogrid-dist-dir}">
1315
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1316
		</copy>
1317 806 jones
1318 4969 daigle
		<delete file="${ver.dir}/lib/utilities.jar" />
1319 2175 tao
1320 4969 daigle
		<delete file="./${name}-src-${release}.zip" />
1321
		<zip zipfile="./${name}-src-${release}.zip"
1322
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1323
		<delete file="./${name}-src-${release}.tar.gz" />
1324
		<tar tarfile="./${name}-src-${release}.tar"
1325
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1326
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1327
			src="./${name}-src-${release}.tar" />
1328
		<delete file="./${name}-src-${release}.tar" />
1329
		<!--delete dir="${dist.dir}"/ -->
1330
	</target>
1331 2175 tao
1332 4969 daigle
	<target name="deb-package" depends="distbin"
1333
		description="create a debian installation package">
1334
		<delete dir="${deb.pkg.dir}" />
1335
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1336
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1337
			<fileset dir="./src/scripts/debian"
1338
				includes="control postinst" />
1339
		</copy>
1340 2598 harris
1341 4969 daigle
		<mkdir
1342
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1343
		<copy
1344
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1345
			filtering="yes">
1346
			<fileset dir="./src/scripts/debian"
1347
				excludes="control postinst" />
1348
		</copy>
1349
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1350 2598 harris
1351 4969 daigle
		<copy file="${dist.dir}/knb.war"
1352
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1353
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1354
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1355 2737 jones
1356 4969 daigle
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1357
			failonerror="true">
1358
			<arg line="--build debian" />
1359
		</exec>
1360 2737 jones
1361 4969 daigle
		<move file="${pkg.dir}/debian.deb"
1362
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1363
	</target>
1364
1365
	<target name="stylesheettest">
1366
		<xslt in="${input}" out="eml.html"
1367
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1368
			<param name="displaymodule" expression="${displaymodule}" />
1369
			<param name="docid" expression="${input}" />
1370
			<param name="entitytype" expression="${entitytype}" />
1371
			<param name="entityindex" expression="${entityindex}" />
1372
			<outputproperty name="method" value="html" />
1373
			<outputproperty name="standalone" value="yes" />
1374
			<outputproperty name="encoding" value="iso8859_1" />
1375
			<outputproperty name="indent" value="yes" />
1376
		</xslt>
1377
	</target>
1378
1379
	<target name="spatial_option" depends="prepare"
1380
		description=" -- compiles code for the spatial option">
1381
1382
		<echo message="Compiling the metatcat shapefile creator" />
1383
		<echo message="using the shapelib at: ${shapelib.dir}" />
1384
		<exec dir="." executable="g++" os="Linux, Unix"
1385
			failonerror="true">
1386
			<arg
1387
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1388
		</exec>
1389
1390
		<exec dir="." executable="g++" os="Linux, Unix"
1391
			failonerror="true">
1392
			<arg
1393
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1394
		</exec>
1395
	</target>
1396
1397
	<!-- LSID Authority support -->
1398
	<patternset id="lsid.jars">
1399
		<include name="axis.jar" />
1400
		<include name="commons-discovery-0.2.jar" />
1401
		<include name="jaxrpc.jar" />
1402
		<include name="lsid-client-1.1.1.jar" />
1403
		<include name="lsid-server-1.1.1.jar" />
1404
		<include name="saaj.jar" />
1405
		<include name="wsdl4j-1.5.1.jar" />
1406
		<include name="activation.jar" />
1407
		<include name="castor-0.9.5.jar" />
1408
		<include name="dnsjava-1.3.2.jar" />
1409
		<include name="mail.jar" />
1410
		<include name="commons-logging-1.0.4.jar" />
1411
		<!-- These jars may be needed but seem to not actually be,
1412
			so leaving them out for now
1413
			<include name="axis-ant.jar" />
1414
		-->
1415
		<!--<include name="GenCastor.class" />-->
1416
	</patternset>
1417
	<patternset id="lib.jars">
1418
		<include name="log4j-1.2.12.jar" />
1419
		<include name="utilities.jar" />
1420 5866 leinfelder
		<include name="xerces*.jar" />
1421
		<include name="xalan*.jar" />
1422 4969 daigle
		<include name="xml-apis.jar" />
1423
	</patternset>
1424
1425
	<path id="lsid.classpath">
1426
		<fileset dir="${lsid.lib.dir}">
1427
			<patternset refid="lsid.jars" />
1428
		</fileset>
1429
		<fileset dir="${lib.dir}">
1430 5866 leinfelder
			<patternset refid="lib.jars" />
1431 4969 daigle
		</fileset>
1432
		<fileset dir="${build.dir}">
1433
			<include name="metacat-client.jar" />
1434 5866 leinfelder
			<include name="metacat.jar" />
1435 4969 daigle
		</fileset>
1436
	</path>
1437
1438
	<filterset id="configFilters">
1439
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1440
			value="${config.hostname}" / -->
1441
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1442
			value="${config.port}" / -->
1443
		<!-- MCD BYE filter token="METADATA_LABELS"
1444
			value="${config.metadataLabelLsid}" / -->
1445
		<!-- MCD BYE filter token="METACAT_SERVER"
1446
			value="${config.metacatserver}" / -->
1447
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1448
			value="${config.lsidauthority}" / -->
1449
	</filterset>
1450
1451
	<target name="prepare-lsid" depends="prepare,utilities,clientjar"
1452
		description="Configure files prior to compilation">
1453
		<mkdir dir="${lsid.build.dir}" />
1454
		<!-- Copy the properties file into the build -->
1455
		<copy file="${conf.dir}/metacat-lsid.properties"
1456
			tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1457
			overwrite="true">
1458
			<filterset refid="configFilters" />
1459
		</copy>
1460
		<copy file="${conf.dir}/log4j.properties"
1461
			tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1462
			overwrite="true">
1463
			<filterset refid="configFilters" />
1464
		</copy>
1465
		<!-- Copy config files into the build -->
1466
		<copy todir="${lsid.build.dir}/WEB-INF">
1467
			<fileset dir="${webinf.dir}" includes="**/*.wsdd" />
1468
		</copy>
1469
		<!-- Copy the metadata configuration files into the build -->
1470
		<mkdir
1471
			dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1472
		<copy
1473
			todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1474
			<fileset dir="${conf.dir}" includes="**/*.xml" />
1475
			<fileset dir="${conf.dir}" includes="**/*.xslt" />
1476
			<filterset refid="configFilters" />
1477
		</copy>
1478
		<!-- Copy services files into the build -->
1479
		<mkdir dir="${lsid.build.dir}/services" />
1480
		<copy todir="${lsid.build.dir}/services">
1481
			<fileset dir="${services.dir}" />
1482
			<filterset refid="configFilters" />
1483
		</copy>
1484
		<!-- Copy axis files into the build -->
1485
		<mkdir dir="${lsid.build.dir}" />
1486
		<copy todir="${lsid.build.dir}">
1487
			<fileset dir="${conf.dir}/axis" excludes="*.properties" />
1488
		</copy>
1489
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1490
		<copy todir="${lsid.build.dir}/WEB-INF/classes">
1491
			<fileset dir="${conf.dir}/axis" includes="*.properties" />
1492
		</copy>
1493
	</target>
1494
1495
	<target name="compile-lsid" depends="prepare-lsid"
1496
		description="Compile Java sources">
1497
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1498
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1499
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1500
			deprecation="${compile.deprecation}"
1501
			optimize="${compile.optimize}">
1502
			<classpath refid="lsid.classpath" />
1503
		</javac>
1504
	</target>
1505
1506
	<target name="war-lsid" depends="compile-lsid"
1507
		description="Create a war file for the application">
1508
		<mkdir dir="${dist.dir}" />
1509
		<war destfile="${dist.dir}/${authority.context}.war"
1510
			webxml="${webinf.dir}/web.xml">
1511
			<fileset dir="${lsid.build.dir}" />
1512
			<lib dir="${lsid.lib.dir}">
1513
				<patternset refid="lsid.jars" />
1514
			</lib>
1515
			<lib dir="${lib.dir}">
1516
				<patternset refid="lib.jars" />
1517
			</lib>
1518
			<lib dir="${lib.dir}">
1519
				<include name="xalan.jar" />
1520
				<include name="xml-apis.jar" />
1521
			</lib>
1522
			<lib dir="${build.dir}">
1523
				<include name="metacat-client.jar" />
1524
			</lib>
1525
		</war>
1526
	</target>
1527
1528
	<target name="deploy-lsid" depends="war-lsid"
1529
		description="Deploy LSID war to servlet container">
1530
		<delete dir="${app.deploy.dir}/${authority.context}" />
1531
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1532
		<mkdir dir="${app.deploy.dir}" />
1533
		<copy todir="${app.deploy.dir}">
1534
			<fileset dir="${dist.dir}" />
1535
		</copy>
1536
	</target>
1537 5919 tao
1538
	<target name="change-metacat-properties" depends="warPrepare"
1539
        description="Chage some default values of metacat.properties">
1540 5924 tao
       <echo file="${metacat-properties-file}" append="true">
1541
		   configutil.propertiesConfigured=true
1542
		   configutil.authConfigured=true
1543
           configutil.skinsConfigured=true
1544
		   configutil.databaseConfigured=true
1545
		   configutil.geoserverConfigured=true
1546
	   </echo>
1547 6003 cjones
  </target>
1548 5919 tao
1549 5925 tao
	<!-- This target will use default values in svn metacat.properties to build a configured
1550
		metacat (except configuti.* properties, they will be set true). Those default settings
1551
		are for a test machine. It may not work on your system-->
1552 5924 tao
	<target name="install-configured-metacat" depends="change-metacat-properties, install"
1553 5919 tao
        description="Install a metacat by the default value in metacat.properties without additional configutaion">
1554
    </target>
1555
1556 113 jones
</project>