Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
	*   '$RCSfile$'
4
	*     Authors: Matt Jones, Chad Berkley, Jivka Bojilova
5
	*   Copyright: 2000 Regents of the University of California and the
6
	*              National Center for Ecological Analysis and Synthesis
7
	* For Details: http://www.nceas.ucsb.edu/
8
	*
9
	*    '$Author: leinfelder $'
10
	*    '$Date: 2012-06-06 12:50:52 -0700 (Wed, 06 Jun 2012) $'
11
	*    '$Revision: 7248 $'
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|documentation]
17
	*
18
	* This program is free software; you can redistribute it and/or modify
19
	* it under the terms of the GNU General Public License as published by
20
	* the Free Software Foundation; either version 2 of the License, or
21
	* (at your option) any later version.
22
	*
23
	* This program is distributed in the hope that it will be useful,
24
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
	* GNU General Public License for more details.
27
	*
28
	* You should have received a copy of the GNU General Public License
29
	* along with this program; if not, write to the Free Software
30
	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31
-->
32
<project name="metacat" default="jar" basedir="."
33
         xmlns:artifact="antlib:org.apache.maven.artifact.ant">
34
	<property environment="env" />
35
	<property file="build.properties" /><!-- USER SPECIFIC PROPS -->
36

    
37

    
38
    <!-- 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

    
44
	<!-- 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
    	
51
	<taskdef resource="axis-tasks.properties"
52
		classpathref="axis.ant.classpath" />
53
	
54
	<!-- Determine if ecogrid should be installed-->
55
	<condition property="enable.ecogrid">
56
		<equals arg1="${install.ecogrid}" arg2="true" />
57
	</condition>
58

    
59
	<!-- Determine if perl should be built-->
60
	<condition property="build.perl">
61
		<equals arg1="${make.perl.code}" arg2="true" />
62
	</condition>
63

    
64
	<available file="${build.tomcat.dir}/common/lib/servlet-api.jar" 
65
			property="tomcat.common.exists" />
66

    
67
	<target name="config" depends="setTomcatCommon, setTomcatNoCommon">
68
		<!-- 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

    
82
		<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

    
88
		<echo>*********** set jsdk to ${jsdk}</echo>
89
	</target>
90
	
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
	<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

    
115
			<!-- Include geoserver, geotools, et. al. -->
116
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
117
				<include name="*.jar" />
118
			</fileset>
119

    
120
			<!-- Include OAI-PMH -->
121
			<fileset dir="lib/oaipmh">
122
				<include name="*.jar" />
123
			</fileset>
124

    
125
		</path>
126
		
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

    
141
			<!-- Include geoserver, geotools, et. al. -->
142
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
143
				<include name="*.jar" />
144
			</fileset>
145
		
146

    
147
			<!-- Include OAI-PMH -->
148
			<fileset dir="lib/oaipmh">
149
				<include name="*.jar" />
150
			</fileset>
151

    
152
		</path>
153

    
154
		<!-- 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
		<tstamp>
161
		    <format property="copyrightyear" pattern="yyyy" locale="en,US"/>
162
		</tstamp>
163
		<property name="copyright" value="${copyrightyear} Regents of the University of California" />
164
		<property name="style-common-relpath" value="/style/common" />
165
		<property name="style-shared-relpath" value="/style/shared" />
166
		<property name="schema-relpath" value="/schema" />
167
		<property name="style-common-cvsrelpath"
168
			value="lib${style-common-relpath}" />
169
		<property name="schema-cvsrelpath" value="lib${schema-relpath}" />
170
		<property name="style-skins-relpath" value="/style/skins" />
171
		<property name="util-module" value="utilities" />
172
		<!-- property name="utilities-tag" value="trunk" / -->
173
		<property name="utilities-tag" value="tags/UTILITIES_1_1_0" />
174
		<property name="seek-tag" value="tags/ECOGRID_1_2_2" />
175
		<property name="eml-module" value="eml" />
176
		<property name="eml-version" value="2.0.0beta6" />
177
		<property name="eml-beta4-version" value="2.0.0beta4" />
178
		<property name="eml-beta-tag"
179
			value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT" />
180
		<property name="eml-beta4-tag"
181
					value="RELEASE_EML_2_BETA_4" />
182
		<property name="eml2_0_0-schema-tag"
183
			value="RELEASE_EML_2_0_0_UPDATE_1" />
184
		<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
185
		<property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0" />
186
		<property name="eml2_1_1-schema-tag" value="RELEASE_EML_2_1_1" />
187
		<property name="eml2-style-tag" value="RELEASE_EML_UTILS_1_0_1" />
188
		<property name="eml2_0_0namespace"
189
			value="eml://ecoinformatics.org/eml-2.0.0" />
190
		<property name="eml2_0_1namespace"
191
			value="eml://ecoinformatics.org/eml-2.0.1" />
192
		<property name="eml2_1_0namespace"
193
			value="eml://ecoinformatics.org/eml-2.1.0" />
194
		<property name="eml2_1_1namespace"
195
			value="eml://ecoinformatics.org/eml-2.1.1" />
196
		<property name="stmmlnamespace"
197
			value="http://www.xml-cml.org/schema/stmml" />
198
		<property name="stmml11namespace"
199
			value="http://www.xml-cml.org/schema/stmml-1.1" />
200
		<property name="eml-css" value="eml_xsl.css" />
201
		<property name="eml-module.default.css" value="default.css" />
202
		<property name="systemidserver" value="" />
203
		<property name="html-path" value="" />
204
		<property name ="metacat-properties-file" value="build/war/WEB-INF/metacat.properties"/>
205

    
206

    
207
		<!-- Config for registry variables -->
208
		<!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
209
		<property name="scope" value="obfs" />
210
		<property name="responseForm" value="genericResponse.tmpl" />
211
		<property name="entryForm" value="entryForm.tmpl" />
212
		<property name="guide" value="genericGuide.tmpl" />
213
		<property name="loginForm" value="loginForm.tmpl" />
214
		<property name="confirmData" value="confirmData.tmpl" />
215
		<property name="deleteData" value="deleteData.tmpl" />
216
		<property name="genericHeader" value="genericHeader.tmpl" />
217
		<property name="genericFooter" value="genericFooter.tmpl" />
218

    
219
		<filter token="scope" value="${scope}" />
220
		<filter token="responseForm" value="${responseForm}" />
221
		<filter token="entryForm" value="${entryForm}" />
222
		<filter token="guide" value="${guide}" />
223
		<filter token="loginForm" value="${loginForm}" />
224
		<filter token="confirmData" value="${confirmData}" />
225
		<filter token="deleteData" value="${deleteData}" />
226
		<filter token="genericHeader" value="${genericHeader}" />
227
		<filter token="genericFooter" value="${genericFooter}" />
228
		<filter token="adminname" value="${adminname}" />
229
		<filter token="recipient" value="${recipient}" />
230
		<filter token="metacatVersion" value="${metacat.version}" />
231
		<filter token="metacatRC" value="${metacat.releaseCandidate}" />
232
		<filter token="build.context" value="${metacat.context}" />
233

    
234
		<filter token="docrooturl" value="./" />
235
		<filter token="mcuser" value="${mcuser}" />
236
		<filter token="mcpassword" value="${mcpassword}" />
237
		<filter token="mcanotheruser" value="${mcanotheruser}" />
238
		<filter token="mcanotherpassword" value="${mcanotherpassword}" />
239
		<filter token="eml-css" value="${eml-css}" />
240
		<filter token="style-skins-relpath"
241
			value="${style-skins-relpath}" />
242
		<filter token="style-common-relpath"
243
			value="${style-common-relpath}" />
244

    
245
		<filter token="eml-version" value="${eml-version}" />
246
		<filter token="eml-beta4-version" value="${eml-beta4-version}" />
247
		<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}" />
248
		<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}" />
249
		<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}" />
250
		<filter token="eml2_1_1namespace" value="${eml2_1_1namespace}" />
251
		<filter token="stmmlnamespace" value="${stmmlnamespace}" />
252
		<filter token="stmml11namespace" value="${stmml11namespace}" />
253
		<filter token="debugprefix" value="${debugprefix}" />
254

    
255
		<filter token="defaultStage" value="${defaultStage}" />
256
		<filter token="defaultHeader" value="${defaultHeader}" />
257
		<filter token="defaultFooter" value="${defaultFooter}" />
258
		<filter token="defaultChangePass" value="${defaultChangePass}" />
259
		<filter token="defaultResetPass" value="${defaultResetPass}" />
260
		<filter token="changePassSuccess" value="${changePassSuccess}" />
261
		<filter token="resetPassSuccess" value="${resetPassSuccess}" />
262
		<filter token="registerFailed" value="${registerFailed}" />
263
		<filter token="registerLter" value="${registerLter}" />
264
		<filter token="registerMatch" value="${registerMatch}" />
265
		<filter token="registerSuccess" value="${registerSuccess}" />
266
		<filter token="register" value="${register}" />
267
		<filter token="searchResults" value="${searchResults}" />
268
		<filter token="ldapMainServerFailure"
269
			value="${ldapMainServerFailure}" />
270
		<filter token="lter-user" value="${lteruser}" />
271
		<filter token="lter-pass" value="${lterpassword}" />
272
		<filter token="pisco-user" value="${piscouser}" />
273
		<filter token="pisco-pass" value="${piscopassword}" />
274

    
275

    
276
		<!-- MCD BYE filter token="timedreplication"     value="${timedreplication}" / -->
277
		<!-- MCD BYE filter token="firsttimedreplication" value="${firsttimedreplication}" / -->
278
		<!-- MCD BYE filter token="timedreplicationinterval" value="${timedreplicationinterval}" / -->
279

    
280
		<property name="srcdir" value="./src" />
281
		<property name="lib.dir" value="./lib" />
282
		<property name="docdir" value="./docs" />
283
		<property name="cgidir" value="./cgi-bin" />
284
		<property name="testdir" value="./test" />
285
		<property name="testtorun" value="MNodeServiceTest" />
286
		<property name="junittestsdir"
287
			value="./test/edu/ucsb/nceas/metacattest" />
288
		<property name="junitnettestsdir"
289
			value="./test/edu/ucsb/nceas/metacatnettest" />
290
		<property name="classtorun" value="edu.ucsb.nceas.metacat.admin.upgrade.dataone.GenerateSystemMetadata" />
291
		<property name="build.dir" value="./build" />
292
		<property name="build.src" value="${build.dir}/src" />
293
		<property name="build.dest" value="${build.dir}/classes" />
294
		<property name="build.samples" value="${build.dir}/samples" />
295
		<property name="build.tests" value="${build.dir}/tests" />
296
		<property name="build.tmp" value="${build.dir}/tmp" />
297
		<property name="build.metacattest"
298
			value="${build.tests}/metacattest" />
299
		<property name="build.metacatnettest"
300
			value="${build.tests}/metacatnettest" />
301
		<property name="build.data" value="${build.dir}/data" />
302
		<property name="build.docs" value="${build.dir}/docs" />
303
		<property name="build.javadocs" value="${build.docs}/api" />
304
		<property name="build.war" value="${build.dir}/war" />
305
		<property name="dist.dir" value="dist" />
306
		<property name="ver.dir" value="${dist.dir}/${name}-${release}" />
307
		<property name="ver.src" value="${ver.dir}/src" />
308
		<property name="util.dir" value="${dist.dir}/${util-module}" />
309
		<property name="test.dir" value="${dist.dir}/test" />
310
		<!-- directories for creating a Harvest List Editor distribution -->
311
		<property name="dist.dir.hle" value="disthle" />
312
		<property name="ver.dir.hle"
313
			value="${dist.dir.hle}/harvest-list-editor-${release}" />
314
		<property name="pkg.dir" value="./package" />
315
		<property name="deb.pkg.dir" value="${pkg.dir}/debian" />
316

    
317
		<property name="ecogrid-target-name" value="metacatImpl" />
318
		<property name="ecogrid-module-dest-dir" value=".." />
319
		<property name="ecogrid-module" value="seek/projects/ecogrid" />
320
		<property name="ecogrid-dist-dir"
321
			value="${dist.dir}/${ecogrid-module}" />
322
		<property name="ecogrid-dir"
323
			value="${ecogrid-module-dest-dir}/${ecogrid-module}" />
324

    
325
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
326

    
327
		<!-- set up svn -->
328
		<property name="svnant.lib" value="lib" />
329
		<property name="svnant.jar" value="${svnant.lib}/svnant.jar" />
330
		<property name="svnClientAdapter.jar"
331
			value="${svnant.lib}/svnClientAdapter.jar" />
332
		<property name="svnjavahl.jar"
333
			value="${svnant.lib}/svnjavahl.jar" />
334
		<property name="svn.utilitiesUrl"
335
			value="https://code.ecoinformatics.org/code/utilities/${utilities-tag}" />
336
		<property name="svn.ecogridUrl"
337
			value="https://code.ecoinformatics.org/code/seek/${seek-tag}/projects/ecogrid/" />
338
		<property name="svn.emlBetaUrl"
339
			value="https://code.ecoinformatics.org/code/eml/branches/${eml-beta-tag}" />
340
		<property name="svn.emlBeta4Url"
341
					value="https://code.ecoinformatics.org/code/eml/tags/${eml-beta4-tag}" />
342
		<property name="svn.eml200SchemaUrl"
343
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_0-schema-tag}" />
344
		<property name="svn.eml201SchemaUrl"
345
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_1-schema-tag}" />
346
		<property name="svn.eml210SchemaUrl"
347
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_0-schema-tag}" />
348
		<property name="svn.eml211SchemaUrl"
349
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_1-schema-tag}" />
350
		<property name="svn.eml2StyleUrl"
351
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2-style-tag}" />
352

    
353
		<!-- load the svn task -->
354
		<path id="svn.classpath">
355
			<pathelement location="${svnjavahl.jar}" />
356
			<pathelement location="${svnant.jar}" />
357
			<pathelement location="${svnClientAdapter.jar}" />
358
		</path>
359
		<taskdef resource="svntask.properties"
360
			classpathref="svn.classpath" />
361

    
362
		<condition property="utilities.required">
363
			<or>
364
				<not>
365
					<available file="lib/utilities.jar" />
366
				</not>
367
				<not>
368
					<available file="${utilitiesdir}" type="dir" />
369
				</not>
370
			</or>
371
		</condition>
372
		<!-- peer.utilities.required is used when there is no utilities 
373
			directory at ${utilitiesdir} -->
374
		<condition property="peer.utilities.required">
375
			<or>
376
				<not>
377
					<available file="${utilitiesdir}" type="dir" />
378
				</not>
379
			</or>
380
		</condition>
381
		<condition property="eml.required">
382
			<or>
383
				<not>
384
					<available file="lib/schema/eml-2.0.1/eml.xsd" />
385
				</not>
386
				<not>
387
					<available file="lib/schema/eml-2.0.0/eml.xsd" />
388
				</not>
389
				<not>
390
					<available file="lib/schema/eml-2.1.0/eml.xsd" />
391
				</not>
392
				<not>
393
					<available
394
						file="lib/dtd/eml-dataset-2.0.0beta6.dtd" />
395
				</not>
396
			</or>
397
		</condition>
398

    
399
		<condition property="ecogrid.required">
400
			<or>
401
				<not>
402
					<available file="${ecogrid-dir}/build.properties" />
403
				</not>
404
				<not>
405
					<available
406
						file="${ecogrid-dir}/buildfiles/metacatImpl.xml" />
407
				</not>
408
			</or>
409
		</condition>
410

    
411
	</target>
412

    
413
	<target name="prepare" depends="init">
414
		<mkdir dir="${build.dir}" />
415
		<mkdir dir="${build.src}" />
416
		<mkdir dir="${build.dest}" />
417
		<mkdir dir="${build.docs}" />
418
		<mkdir dir="${build.javadocs}" />
419
		<mkdir dir="${build.tmp}" />
420

    
421
		<copy todir="${build.src}" filtering="yes">
422
			<fileset dir="${srcdir}">
423
				<include name="edu/**" />
424
				<include name="com/**" />
425
				<include name="org/**" />
426
				<!-- include name="java/**" / -->
427
				<include name="**/*.sql" />
428
				<exclude name="**/CVS*" />
429
				<exclude name="**/.#*" />
430
				<exclude name="edu/ucsb/nceas/workflowscheduler/**" />
431
			</fileset>
432
		</copy>
433
		<available file="lib/style/common/emlb6toeml2" type="dir"
434
			property="styles.not.needed" />
435
	</target>
436

    
437
	<target name="generateStubs" depends="prepare">
438
		<echo
439
			message=" Generating stubs for execution service from ${/tmp/KeplerWebService.wsdl}" />
440
		<axis-wsdl2java verbose="true" output="${srcdir}"
441
			url="/tmp/KeplerWebService.wsdl" />
442
	</target>
443

    
444
	<target name="compile" depends="prepare,utilities"
445
		description="Compiles java code to build dir, and copies metacat props files there">
446

    
447
		<javac srcdir="${build.src}" destdir="${build.dest}"
448
			debug="${debug}"
449
			excludes="**/*.sql **/client/*.java **/harvesterClient/*.java">
450
			<classpath>
451
				<path refid="compile.classpath" />
452
			</classpath>
453
		</javac>
454
	</target>
455

    
456
	<target name="jar" depends="compile,geteml"
457
		description="Compiles and jars metacat java code to metacat.jar in build dir ">
458

    
459
		<delete file="${build.dir}/${name}.jar" />
460
		<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
461
			excludes="**/protocols/ **/harvesterClient/" />
462
	</target>
463

    
464
	<target name="protocol" depends="compile"
465
		description="Compiles and jars protocol java code to protocol.jar in build dir">
466
		<delete file="${build.dir}/protocol.jar" />
467
		<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
468
			includes="**/protocols/" />
469
	</target>
470

    
471
	<target name="utilities" depends="config,getpeerutilities"
472
		if="utilities.required">
473
		<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
474
		<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
475
		<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
476
	</target>
477

    
478
	<target name="getpeerutilities" depends="prepare"
479
		if="peer.utilities.required"
480
		description="Checks utilities out of svn and copies it to your utilitiesdir if it does not already exist">
481
		<echo message="Exporting utilities files from svn repository:" />
482
		<svn>
483
			<export srcUrl="${svn.utilitiesUrl}"
484
				destPath="${utilitiesdir}" />
485
		</svn>
486

    
487
		<!--  ant dir="${utilitiesdir}" inheritAll="false"  target="dist" / -->
488
	</target>
489

    
490
	<target name="getutilities" depends="prepare"
491
		description="Checks utility out of svn and copies it to your metacat sandbox">
492
		<svn>
493
			<export srcUrl="${svn.utilitiesUrl}"
494
				destPath="${utilitiesdir}" force="true" />
495
		</svn>
496
	</target>
497

    
498
	<target name="client" depends="utilities, prepare"
499
		description="Compiles metacat-client java code to build dir">
500
		<javac srcdir="${build.src}" destdir="${build.dest}"
501
			includes="edu/ucsb/nceas/metacat/client/*">
502
			<classpath>
503
				<path refid="compile.classpath" />
504
			</classpath>
505
		</javac>
506
	</target>
507

    
508
	<target name="clientjar" depends="client"
509
		description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
510
		<delete file="${build.dir}/${name}-client.jar" />
511
		<jar jarfile="${build.dir}/${name}-client.jar"
512
			basedir="${build.dest}" includes="**/metacat/client/" />
513
	</target>
514

    
515
	<target name="advancedsearchjar" depends="compile"
516
		description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
517
		<delete file="${build.dir}/advancedsearch.jar" />
518
		<jar jarfile="${build.dir}/advancedsearch.jar"
519
			basedir="${build.dest}" includes="**/metacat/advancedsearch/" />
520
	</target>
521

    
522
	<target name="harvester" depends="client"
523
		description="Compiles harvester java code to build dir">
524
		<javac srcdir="${build.src}" destdir="${build.dest}"
525
			includes="edu/ucsb/nceas/metacat/harvesterClient/*">
526
			<classpath>
527
				<path refid="compile.classpath" />
528
			</classpath>
529
		</javac>
530
	</target>
531
		
532
	<target name="harvesterjar" depends="harvester"
533
		description="Compiles and jars harvester java code to harvester.jar in build dir">
534
		<delete file="${build.dir}/harvester.jar" />
535
		<jar jarfile="${build.dir}/harvester.jar"
536
			basedir="${build.dest}" includes="**/metacat/harvesterClient/" />
537
	</target>
538

    
539
	<target name="harvestListEditorDist" depends="harvesterjar"
540
		description="Prepares a distribution of the Harvest List Editor tool">
541
		<mkdir dir="${dist.dir.hle}" />
542
		<delete dir="${ver.dir.hle}" />
543
		<mkdir dir="${ver.dir.hle}" />
544
		<copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar" />
545
		<copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar" />
546
		<copy todir="${ver.dir.hle}"
547
			file="lib/harvester/harvestList.xsd" />
548
		<copy todir="${ver.dir.hle}"
549
			file="lib/harvester/harvestListEditor.bat" />
550
		<copy todir="${ver.dir.hle}"
551
			file="lib/harvester/harvestListEditor.sh" />
552
		<delete file="./harvest-list-editor-${release}.zip" />
553
		<zip zipfile="./harvest-list-editor-${release}.zip"
554
			basedir="${ver.dir.hle}" />
555
		<delete file="./harvest-list-editor-${release}.tar.gz" />
556
		<tar tarfile="./harvest-list-editor-${release}.tar"
557
			basedir="${ver.dir.hle}" />
558
		<gzip zipfile="./harvest-list-editor-${release}.tar.gz"
559
			src="./harvest-list-editor-${release}.tar" />
560
		<delete file="./harvest-list-editor-${release}.tar" />
561
	</target>
562

    
563
	<target name="geteml" depends="getemlpre2,getemlpre2beta4,geteml2+,getConversionXSL"
564
		if="eml.required" description="Calls getemlpre2 and geteml2+ targets" />
565

    
566
	<target name="getemlpre2" depends="prepare" if="eml.required"
567
		description="Checks EML-beta6 out of svn and copies dtds and xsl to your metacat sandbox">
568
		<svn>
569
			<export srcUrl="${svn.emlBetaUrl}"
570
				destPath="${build.tmp}/eml_${eml-beta-tag}" />
571
		</svn>
572
		<mkdir dir="lib/dtd" />
573
		<copy todir="lib/dtd" filtering="yes">
574
			<fileset
575
				dir="${build.tmp}/eml_${eml-beta-tag}">
576
				<include name="*.dtd" />
577
			</fileset>
578
			<mapper type="glob" from="eml-*.dtd"
579
				to="eml-*-${eml-version}.dtd" />
580
		</copy>
581

    
582
		<copy todir="${style-common-cvsrelpath}" filtering="yes">
583
			<fileset
584
				dir="${build.tmp}/eml_${eml-beta-tag}/style">
585
				<include name="**/*.xsl" />
586
			</fileset>
587
		</copy>
588
	</target>
589
	
590
	<target name="getemlpre2beta4" depends="prepare" if="eml.required"
591
			description="Checks EML-beta4 out of svn and copies dtds to your metacat sandbox">
592
			<svn>
593
				<export srcUrl="${svn.emlBeta4Url}"
594
					destPath="${build.tmp}/eml_${eml-beta4-tag}" />
595
			</svn>
596
			<mkdir dir="lib/dtd" />
597
			<copy todir="lib/dtd" filtering="yes">
598
				<fileset
599
					dir="${build.tmp}/eml_${eml-beta4-tag}">
600
					<include name="*.dtd" />
601
				</fileset>
602
				<mapper type="glob" from="eml-*.dtd"
603
					to="eml-*-${eml-beta4-version}.dtd" />
604
			</copy>
605

    
606
			<!--
607
			<copy todir="${style-common-cvsrelpath}" filtering="yes">
608
				<fileset
609
					dir="${build.tmp}/eml_${eml-beta4-tag}/style">
610
					<include name="**/*.xsl" />
611
				</fileset>
612
			</copy>
613
			-->
614
		</target>
615

    
616
	<target name="geteml2+" depends="prepare" if="eml.required"
617
		description="Checks eml-2 out of svn and copies schema and xsl to your metacat sandbox">
618
		<svn>
619
			<export srcUrl="${svn.eml200SchemaUrl}"
620
				destPath="${build.tmp}/eml_${eml2_0_0-schema-tag}" />
621
		</svn>
622
		<mkdir dir="lib/schema/eml-2.0.0" />
623
		<copy todir="lib/schema/eml-2.0.0" filtering="yes">
624
			<fileset
625
				dir="${build.tmp}/eml_${eml2_0_0-schema-tag}">
626
				<include name="*.xsd" />
627
			</fileset>
628

    
629
			<!-- shouldn't we have a mapper here like this??
630
				<mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
631
				
632
				Jing's code didn't nave one - does it need to be added?
633
				NOTE that eml-version is set to beta 6, so this would need changing -->
634

    
635
		</copy>
636
		<!-- <antcall target="copyxsl">
637
			<param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
638
			<param name="dirname" value="eml-2.0.0" />
639
			</antcall> -->
640

    
641
		<!-- Checkout eml201 for given schema tag-->
642
		<svn>
643
			<export srcUrl="${svn.eml201SchemaUrl}"
644
				destPath="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
645
		</svn>
646
		<mkdir dir="lib/schema/eml-2.0.1" />
647
		<copy todir="lib/schema/eml-2.0.1" filtering="yes">
648
			<fileset
649
				dir="${build.tmp}/eml_${eml2_0_1-schema-tag}">
650
				<include name="*.xsd" />
651
			</fileset>
652
		</copy>
653

    
654
		<!-- Checkout eml201 again for given style sheet tag-->
655
		<!-- echo>Enter CVS password: </echo>
656
			<cvs cvsRoot="${cvsroot}"
657
			package="${eml-module}"
658
			tag="${eml2_0_1-style-tag}"
659
			dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
660
			<antcall target="copyxsl">
661
			<param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
662
			<param name="dirname" value="eml-2.0.1" />
663
			</antcall -->
664

    
665
		<!-- Checkout eml210 for given schema tag-->
666
		<svn>
667
			<export srcUrl="${svn.eml210SchemaUrl}"
668
				destPath="${build.tmp}/eml_${eml2_1_0-schema-tag}" />
669
		</svn>
670
		<mkdir dir="lib/schema/eml-2.1.0" />
671
		<copy todir="lib/schema/eml-2.1.0" filtering="yes">
672
			<fileset
673
				dir="${build.tmp}/eml_${eml2_1_0-schema-tag}">
674
				<include name="*.xsd" />
675
			</fileset>
676
		</copy>
677

    
678
		<!-- Checkout eml210 for given style sheet tag-->
679
		<svn>
680
			<export srcUrl="${svn.eml2StyleUrl}"
681
				destPath="${build.tmp}/eml_${eml2-style-tag}" />
682
		</svn>
683
		<antcall target="copyxsl">
684
			<param name="cvs.tagname" value="${eml2-style-tag}" />
685
			<!-- param name="dirname" value="eml-2.1.0" / -->
686
			<param name="dirname" value="eml-2" />
687
		</antcall>
688
		
689
		<!-- Checkout eml210 for given schema tag-->
690
		<svn>
691
			<export srcUrl="${svn.eml211SchemaUrl}"
692
				destPath="${build.tmp}/eml_${eml2_1_1-schema-tag}" />
693
		</svn>
694
		<mkdir dir="lib/schema/eml-2.1.1" />
695
		<copy todir="lib/schema/eml-2.1.1" filtering="yes">
696
			<fileset
697
				dir="${build.tmp}/eml_${eml2_1_1-schema-tag}">
698
				<include name="*.xsd" />
699
			</fileset>
700
		</copy>
701
	</target>
702

    
703
	<target name="copyxsl"
704
		description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
705

    
706
		<delete file="${style-common-cvsrelpath}/${eml-css}" />
707

    
708
		<copy todir="${style-common-cvsrelpath}/${dirname}"
709
			filtering="yes">
710
			<fileset
711
				dir="${build.tmp}/eml_${cvs.tagname}/style/eml">
712
				<include name="**/*.xsl" />
713
			</fileset>
714
		</copy>
715

    
716

    
717
		<!-- now copy default css from eml module and put it in style-common-path
718
			dir with a new name, so other skin-specific css can import it if reqd -->
719
		<copy
720
			file="${build.tmp}/eml_${cvs.tagname}/${eml-module.default.css}"
721
			tofile="${style-common-cvsrelpath}/${eml-css}" />
722

    
723
	</target>
724

    
725
	<target name="correctEML201Docs" depends="jar"
726
		description="Uses the ant  task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
727
		<copy todir="${build.dir}" file="lib/metacat.properties"
728
			filtering="yes" />
729
		<java
730
			classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector">
731
			<classpath>
732
				<path refid="compile.classpath" />
733
				<fileset dir="${build.dir}">
734
					<include name="${name}.jar" />
735
				</fileset>
736
			</classpath>
737
		</java>
738
	</target>
739

    
740
	<target name="install-spatial" depends="jar,clientjar,harvesterjar"
741
		description="Installs spatial option for metacat">
742

    
743
		<property name="spatial.dir" value="./lib/spatial" />
744
		<property name="spatial.geoserver.dir"
745
			value="${spatial.dir}/geoserver" />
746
		<property name="spatial.webinf-mods"
747
			value="${spatial.dir}/WEB-INF" />
748

    
749
		<!-- Copy geoserver libs into ${war.lib} -->
750
		<copy todir="${war.lib}" filtering="no">
751
			<fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
752
				<include name="**" />
753
			</fileset>
754
		</copy>
755
		
756
		<copy todir="${dist.dir}">
757
			<fileset dir="./lib/spatial/geoserver" includes="*.war" />
758
		</copy>
759

    
760
	</target>
761

    
762
	<target name="install" depends="build-metacat"
763
		description="* Full Install For Development *">
764
		<copy file="${dist.dir}/${metacat.context}.war"
765
			todir="${app.deploy.dir}" />
766
               <!-- <copy file="${dist.dir}/${metacat.context}.war"
767
                        todir="${app.deploy.dir2}" />-->
768
		<delete dir="${app.deploy.dir}/${metacat.context}" />
769
		<!--<delete dir="${app.deploy.dir2}/${metacat.context}" />-->
770
		<copy file="${dist.dir}/geoserver.war"
771
					todir="${app.deploy.dir}" />
772
		<tstamp>
773
			<format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa" />
774
		</tstamp>
775
		<echo>Dev install completed at ${NOW}</echo>
776
	</target>
777

    
778
	<target name="build-metacat" depends="install-ecogrid, install-spatial"
779
		description="Build Metacat">
780
	</target>
781

    
782
	<target name="install-ecogrid" depends="warPrepare, get-ecogrid"
783
		if="enable.ecogrid" description="Install Ecogrid Compentent">
784
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="clean"
785
			inheritall="false">
786
			<property name="context" value="${metacat.context}" />
787
			<property name="target" value="${ecogrid-target-name}" />
788
		</ant>
789
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="war"
790
			inheritall="false">
791
			<property name="context" value="${metacat.context}" />
792
			<property name="target" value="${ecogrid-target-name}" />
793
			<property name="metacat.dir" value="${basedir}"/>
794
		</ant>
795
		<!-- war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
796
			<webinf dir="${ecogrid-dir}/lib">
797
			<include name="server-config.wsdd"/>
798
			</webinf>
799
			</war -->
800
		<copy file="${ecogrid-dir}/build/${metacat.context}.war"
801
			todir="${dist.dir}" overwrite="true" />
802

    
803

    
804
	</target>
805

    
806
	<target name="get-ecogrid" depends="init"
807
		description="Check out ecogrid module" if="ecogrid.required">
808
		<svn>
809
			<export srcUrl="${svn.ecogridUrl}" force="true"
810
				destPath="${ecogrid-dir}" />
811
		</svn>
812
	</target>
813

    
814
	<!-- target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
815
		<ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
816
		<property name="context" value="${metacat.context}"/>
817
		<property name="target" value="${ecogrid-target-name}"/>
818
		<property name="metacat.dir" value="."/>
819
		<property name="hostname" value="${ecogrid.hostname}"/>
820
		<property name="port" value="${config.port}"/>
821
		</ant>
822
		</target -->
823

    
824
	<target name="clean-ecogrid-server-config-wsdd" depends="init"
825
		description="Automately generate wsdd for ecogrid service">
826
		<delete
827
			file="${app.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd" />
828
	</target>
829

    
830
	<target name="install-skin" depends="init"
831
		description="Install a Skin">
832

    
833
		<input message="Please enter name of the skin"
834
			addproperty="skin-name" />
835

    
836
		<mkdir dir="${installdir}/style/skins/${skin-name}" />
837
		<copy todir="${installdir}/style/skins/${skin-name}"
838
			filtering="yes">
839
			<fileset dir="lib/style/skins/${skin-name}">
840
				<exclude name="**/*.png" />
841
				<exclude name="**/*.gif" />
842
				<exclude name="**/*.jpg" />
843
				<exclude name="**/CVS*" />
844
				<exclude name="**/.#*" />
845
			</fileset>
846
		</copy>
847
		<copy todir="${installdir}/style/skins/${skin-name}"
848
			filtering="no">
849
			<fileset dir="lib/style/skins/${skin-name}">
850
				<include name="**/*.png" />
851
				<include name="**/*.gif" />
852
				<include name="**/*.jpg" />
853
				<exclude name="**/CVS*" />
854
				<exclude name="**/.#*" />
855
			</fileset>
856
		</copy>
857
		<copy todir="${installdir}/style/common" filtering="yes">
858
			<fileset dir="lib/style/common">
859
				<include name="*.js" />
860
				<include name="*.jsp" />
861
				<include name="*.css" />
862
				<exclude name="*.png" />
863
				<exclude name="*.gif" />
864
				<exclude name="*.jpg" />
865
				<exclude name="**/CVS*" />
866
				<exclude name="**/.#*" />
867
			</fileset>
868
		</copy>
869
		<!--
870
			<mkdir dir="${installdir}/style/skins/${skin-name}/images" />
871
			<copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
872
			<fileset dir="lib/style/skins/${skin-name}/images">
873
			<include name="*.png"/>
874
			<include name="*.gif"/>
875
			<include name="*.jpg"/>
876
			</fileset>
877
			</copy>
878
		-->
879

    
880
		<echo message="Install Skin completed." />
881
	</target>
882

    
883
	<target name="war" depends="warPrepare,install-spatial"
884
		description="Create a web archive (WAR) for servlet deployment">
885
		<mkdir dir="${dist.dir}" />
886
		<war destfile="${dist.dir}/${metacat.context}.war"
887
			webxml="${build.war}/web.xml">
888
			<fileset dir="${war.context}" />
889
			<lib dir="${war.lib}" />
890
			<webinf dir="${war.webinf}" />
891
		</war>
892
	</target>
893

    
894
	<target name="warPrepare"
895
		depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare"
896
		description="Prepare files for creating a web archive (WAR)">
897

    
898
		<property name="war.lib" value="${build.war}/lib" />
899
		<property name="war.webinf" value="${build.war}/WEB-INF" />
900
		<property name="war.context"
901
			value="${build.war}/${metacat.context}" />
902
		<property name="war.webinf.sql" value="${war.webinf}/sql" />
903
		<property name="war.webinf.scripts"
904
			value="${war.webinf}/scripts" />
905
		<property name="war.context.cgi" value="${war.context}/cgi-bin" />
906
		<property name="war.context.docs" value="${war.context}/docs" />
907
		<property name="war.context.temp" value="${war.context}/temp" />
908
		<property name="war.context.templates"
909
			value="${war.context}${style-common-relpath}/templates" />
910
		<mkdir dir="${war.lib}" />
911
		<mkdir dir="${war.webinf}" />
912
		<mkdir dir="${war.context}" />
913
		<mkdir dir="${war.webinf.sql}" />
914
		<mkdir dir="${war.context.cgi}" />
915
		<mkdir dir="${war.context.docs}" />
916
		<mkdir dir="${war.context.temp}" />
917
		<mkdir dir="${war.context.templates}" />
918

    
919
		<!--copy file="${lib.dir}/${jdbc.lib.postgres}" todir="${war.lib}" / -->
920
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver1}" todir="${war.lib}" / -->
921
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver2}" todir="${war.lib}" / -->
922
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver3}" todir="${war.lib}" / -->
923
		<copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
924
		<copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
925
		<copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
926
		<copy todir="${war.lib}" filtering="no">
927
			<fileset dir="lib">
928
				<!--
929
					<not>
930
					<filename name="${jdbc-jar-name}"/>
931
					</not>
932
				-->
933
				<include name="*.jar" />
934
				<exclude name="maven-ant-tasks*.jar" />
935
			</fileset>
936
			<fileset dir="lib">
937
				<include name="xalan.jar" />
938
				<include name="gwt*.jar" />
939
			</fileset>
940
			<fileset dir="lib/oaipmh">
941
				<include name="oaicat.jar" />
942
			</fileset>
943
		</copy>
944
		<!-- MCD copy file="lib/web.xml.${tomcatversion}"
945
			tofile="${build.war}/web.xml" / -->
946
		<!-- MCD added next - Remove the tomcat5 reference-->
947
		<copy file="lib/web.xml.tomcat6" tofile="${build.war}/web.xml" />
948
		<copy file="lib/metacat.properties" todir="${war.webinf}"
949
			filtering="yes" />
950
		<copy file="lib/metacat.properties.metadata.xml"
951
			todir="${war.webinf}" filtering="no" />
952
		<copy file="lib/org.properties.metadata.xml"
953
			todir="${war.webinf}" filtering="no" />
954
		<copy file="lib/auth.properties.metadata.xml"
955
			todir="${war.webinf}" filtering="no" />
956
		<copy todir="${war.webinf}" filtering="yes">
957
			<fileset dir="lib">
958
				<include name="skin.configs/**" />
959
			</fileset>
960
		</copy>
961
		<copy file="lib/log4j.properties" todir="${war.webinf}"
962
			filtering="yes" />
963
		<copy file="lib/hazelcast.xml" todir="${war.webinf}"
964
			filtering="yes" />
965
		<copy todir="${war.context}" filtering="no">
966
			<fileset dir="lib">
967
				<include name="**/*.jpg" />
968
				<include name="**/*.png" />
969
				<include name="**/*.gif" />
970
				<include name="LiveMap_30/**" />
971
				<include name="oaipmh/**" />
972
			</fileset>
973
		</copy>
974
		<copy todir="${war.context}" filtering="yes">
975
			<fileset dir="lib">
976
				<exclude name="*.jar" />
977
				<exclude name="*.properties" />
978
				<exclude name="*.metadata.xml" />
979
				<exclude name="web.xml" />
980
				<exclude name="**/*.jpg" />
981
				<exclude name="**/*.png" />
982
				<exclude name="**/*.gif" />
983
				<exclude name="lsid_lib/**" />
984
				<exclude name="lsid_conf/**" />
985
				<exclude name="LiveMap_30/**" />
986
				<exclude name="oaipmh/**" />
987
				<exclude name="skin.configs/**" />
988
				<exclude name="spatial/geoserver/**" />
989
			</fileset>
990
		</copy>
991
		<copy todir="${war.context}" filtering="no">
992
			<fileset dir="lib">
993
				<include name="spatial/geoserver/data/**" />
994
			</fileset>
995
		</copy>
996
		<copy todir="${war.context.docs}" filtering="no">
997
			<fileset dir="${build.docs}" />
998
		</copy>
999
		<copy todir="${war.webinf.sql}" filtering="yes">
1000
			<fileset dir="src">
1001
				<include name="**/*.sql" />
1002
			</fileset>
1003
		</copy>
1004
		<copy todir="${war.webinf.scripts}" filtering="yes">
1005
			<fileset dir="src/scripts" />
1006
		</copy>
1007
		<copy todir="${war.webinf.scripts}"
1008
			file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
1009
			failonerror="false" />
1010

    
1011
		<copy file="src/perl/register-dataset.cgi"
1012
			todir="${war.context.cgi}" />
1013
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1014
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1015

    
1016
		<!-- registry cgi section -->
1017
		<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
1018
			used in readDocumentFromMetacat -->
1019
		<!-- TODO MCD copy temp files to actual location using config util?? -->
1020
		<copy todir="${war.context.temp}" filtering="yes">
1021
			<fileset dir="lib/style/common/emlb6toeml2">
1022
				<include name="*.xsl" />
1023
				<include name="*.xml" />
1024
			</fileset>
1025
		</copy>
1026
		<available file="lib/style/common/emlb6toeml2" type="dir"
1027
			property="styles.not.needed" />
1028

    
1029
		<!-- ldap cgi section -->
1030
		<copy todir="${war.context.templates}">
1031
			<fileset dir="lib/style/common/templates">
1032
				<!-- SCW: Copy all files -->
1033
			</fileset>
1034
		</copy>
1035
	</target>
1036

    
1037
	<target name="cgiPrepare" if="build.perl">
1038
		<exec dir="src/perl/Metacat/" executable="make">
1039
			<arg value="clean" />
1040
		</exec>
1041
		<exec dir="src/perl/Metacat/" executable="perl">
1042
			<arg value="Makefile.PL" />
1043
		</exec>
1044
		<exec dir="src/perl/Metacat/" executable="make" />
1045
	</target>
1046

    
1047
	<target name="testPrepare"
1048
		description="Copies test files into the war directories">
1049
		<echo>in testPrepare</echo>
1050
		<property name="war.context.test"
1051
			value="${build.war}/${metacat.context}/test" />
1052
		<mkdir dir="${war.context.test}" />
1053
		<copy todir="${war.context.test}" filtering="yes">
1054
			<fileset dir="test/servertestfiles">
1055
				<include name="*/**" />
1056
			</fileset>
1057
		</copy>
1058
	</target>
1059

    
1060
	<target name="getConversionXSL" depends="prepare"
1061
		unless="styles.not.needed"
1062
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1063

    
1064
		<svn>
1065
			<export srcUrl="${svn.eml2StyleUrl}"
1066
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1067
		</svn>
1068

    
1069
		<mkdir dir="lib/style/common/emlb6toeml2" />
1070
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1071
			<fileset
1072
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1073
				<include name="*.xsl" />
1074
				<include name="*.xml" />
1075
			</fileset>
1076
		</copy>
1077
	</target>
1078

    
1079
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1080
		<mkdir dir="${build.tests}" />
1081
		<copy todir="${build.tests}" encoding="UTF-8">
1082
			<fileset dir="${testdir}">
1083
				<include name="edu/**" />
1084
			</fileset>
1085
		</copy>
1086
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1087

    
1088
		<path id="test.classpath">
1089
			<path refid="compile.classpath" />
1090
			<fileset dir="${build.dir}">
1091
				<include name="${name}.jar" />
1092
				<include name="${name}-client.jar" />
1093
				<include name="harvester.jar" />
1094
			</fileset>
1095
		</path>
1096
		
1097
		<pathconvert pathsep="${line.separator}|  |--" 
1098
		             property="echo.test.classpath"
1099
		             refid="test.classpath">
1100
		</pathconvert>
1101
		<echo message="|--test classpath" />
1102
		<echo message="|  |" />
1103
		<echo message="|  |-- ${echo.test.classpath}" />
1104
		
1105
		<!-- copy and compile the tests into a jar file -->
1106
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1107
			debug="on" includes="**/*.java" encoding="UTF-8">
1108
			<classpath refid="test.classpath" />
1109
		</javac>
1110

    
1111
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1112
			basedir="${build.tests}" >
1113
			<include name="**/*.class"/>
1114
			<include name="**/*.xml"/>
1115
		</jar>	
1116
		
1117
	</target>
1118

    
1119
	<target name="runoneclass" depends="testprep"
1120
		description="Uses the ant to run a class">
1121
		
1122
		<java classname="${classtorun}" fork="true">
1123
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1124
			<classpath>
1125
				<path refid="test.classpath" />
1126
				<fileset dir="${build.dir}">
1127
					<include name="${name}.jar" />
1128
					<include name="${name}-client.jar" />
1129
					<include name="harvester.jar" />
1130
					<include name="${name}-junittests.jar" />
1131
				</fileset>
1132
			</classpath>
1133
		</java>
1134
	</target>
1135
	
1136
	<target name="test" depends="testprep"
1137
		description="Uses the ant junit task to run all JUnit tests">
1138

    
1139
		<!-- use the ant "junit" task to run JUnit tests. -->
1140
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1141
			haltonerror="no">
1142
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1143
			<classpath>
1144
				<path refid="test.classpath" />
1145
				<fileset dir="${build.dir}">
1146
					<include name="${name}.jar" />
1147
					<include name="${name}-client.jar" />
1148
					<include name="harvester.jar" />
1149
					<include name="${name}-junittests.jar" />
1150
				</fileset>
1151
			</classpath>
1152

    
1153
			<formatter type="plain" />
1154

    
1155
			<batchtest fork="yes" todir="${build.dir}">
1156
				<fileset dir="${build.tests}">
1157
					<include name="**/*.class" />
1158
					<exclude name="**/MCTestCase.class" />
1159
					<exclude name="**/ClientViewHelperTest.class" />
1160
					<!-- these are not test cases -->
1161
					<exclude name="**/MockCNode.class" />
1162
					<exclude name="**/D1NodeServiceTest.class" />
1163
					<exclude name="**/QueryRunner.class" />
1164
					<exclude name="**/MockObjectPathMap.class" />
1165
				</fileset>
1166
			</batchtest>
1167
		</junit>
1168
	</target>
1169

    
1170
	<target name="runonetest" depends="testprep"
1171
		description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1172

    
1173
		<echo>testtorun: ${testtorun}</echo>
1174

    
1175
		<!-- use the ant "junit" task to run JUnit tests. -->
1176
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1177
			haltonerror="no" showoutput="yes">
1178
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1179
			<classpath>
1180
				<path refid="test.classpath" />
1181
				<fileset dir="${build.dir}">
1182
					<include name="${name}.jar" />
1183
					<include name="${name}-client.jar" />
1184
					<include name="harvester.jar" />
1185
					<include name="${name}-junittests.jar" />
1186
				</fileset>
1187
			</classpath>
1188

    
1189
			<formatter type="plain" />
1190

    
1191
			<batchtest fork="yes" todir="${build.dir}">
1192
				<fileset dir="${build.tests}">
1193
					<include name="**/${testtorun}.class" />
1194
				</fileset>
1195
			</batchtest>
1196
		</junit>
1197
	</target>
1198
	
1199
	<target name="run" depends="testprep"
1200
			description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1201

    
1202
			<echo>testtorun: ${testtorun}</echo>
1203

    
1204
			<!-- use the ant "junit" task to run JUnit tests. -->
1205
			<junit printsummary="yes" haltonfailure="no" fork="yes"
1206
				haltonerror="no" showoutput="yes">
1207
				<jvmarg value="-Dfile.encoding=UTF-8"/>
1208
				<classpath>
1209
					<path refid="test.classpath" />
1210
					<fileset dir="${build.dir}">
1211
						<include name="${name}.jar" />
1212
						<include name="${name}-client.jar" />
1213
						<include name="harvester.jar" />
1214
						<include name="${name}-junittests.jar" />
1215
					</fileset>
1216
				</classpath>
1217

    
1218
				<formatter type="plain" />
1219

    
1220
				<batchtest fork="yes" todir="${build.dir}">
1221
					<fileset dir="${build.tests}">
1222
						<include name="**/${testtorun}.class" />
1223
					</fileset>
1224
				</batchtest>
1225
			</junit>
1226
		</target>
1227

    
1228
	<target name="testharvester" depends="testprep"
1229
		description="Uses the ant junit task to test only the Harvester code">
1230
		<junit printsummary="yes" haltonfailure="off" fork="yes"
1231
			haltonerror="off">
1232
			<classpath>
1233
				<path refid="compile.classpath" />
1234
				<fileset dir="${build.dir}">
1235
					<include name="${name}.jar" />
1236
					<include name="${name}-client.jar" />
1237
					<include name="harvester.jar" />
1238
					<include name="${name}-junittests.jar" />
1239
				</fileset>
1240
			</classpath>
1241
			<formatter type="plain" />
1242
			<batchtest fork="yes" todir="${build.dir}">
1243
				<fileset dir="${build.tests}">
1244
					<include name="**/harvesterClient/*.class" />
1245
				</fileset>
1246
			</batchtest>
1247
		</junit>
1248
	</target>
1249

    
1250
	<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1251
	<target name="nettest" depends="install"
1252
		description="compiles and runs the metacatnettest code">
1253

    
1254
		<echo>
1255
			*********************************** Please run ant
1256
			gethttpclient first! ***********************************
1257
		</echo>
1258
		<!-- copy and compile the tests into a jar file -->
1259
		<mkdir dir="${build.metacatnettest}" />
1260
		<javac srcdir="${junitnettestsdir}"
1261
			destdir="${build.metacatnettest}" includes="**/*.java">
1262
			<classpath>
1263
				<path refid="compile.classpath" />
1264
				<fileset dir="${build.dir}">
1265
					<include name="${name}.jar" />
1266
				</fileset>
1267
			</classpath>
1268
		</javac>
1269

    
1270
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1271
			basedir="${build.metacatnettest}" includes="**/*.class" />
1272

    
1273
		<!-- use the ant "junit" task to run JUnit tests. -->
1274
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1275
			haltonerror="no">
1276
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1277
			<classpath>
1278
				<path refid="compile.classpath" />
1279
				<fileset dir="${build.dir}">
1280
					<include name="${name}.jar" />
1281
					<include name="${name}-junitnettests.jar" />
1282
				</fileset>
1283
			</classpath>
1284

    
1285
			<formatter type="plain" />
1286

    
1287
			<batchtest fork="yes" todir="${build.dir}">
1288
				<fileset dir="${build.metacatnettest}">
1289
					<include name="**/*.class" />
1290
				</fileset>
1291
			</batchtest>
1292
		</junit>
1293
	</target>
1294

    
1295
	<target name="cleanweb" depends="clean"
1296
		description="deletes tomcat web context dir and all its contents">
1297
		<delete dir="${installdir}" />
1298
	</target>
1299

    
1300

    
1301
	<target name="clean" depends="init"
1302
		description="deletes build dir and files that can be regenerated form the release">
1303
		<delete dir="${build.dir}" />
1304
		<delete dir="${dist.dir}" />
1305
	</target>
1306

    
1307
	<target name="localclean" depends="clean"
1308
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1309
		<delete file="lib/utilities.jar" />
1310
	</target>
1311

    
1312
	<target name="fullclean" depends="localclean"
1313
		description="deletes code and eml">
1314
		<delete includeEmptyDirs="true" failonerror="false">
1315
			<fileset dir="${style-common-cvsrelpath}">
1316
				<include name="${eml-css}" />
1317
				<include name="eml-*/*.xsl" />
1318
				<include name="eml-*" />
1319
			</fileset>
1320
			<fileset dir="${schema-cvsrelpath}">
1321
				<include name="eml-*/*.xsd" />
1322
			</fileset>
1323
			<fileset dir="${ecogrid-dir}"/>
1324
			<fileset dir="lib/style/common/emlb6toeml2"/>
1325
			<fileset dir="lib/dtd"/>
1326
			<fileset dir="lib/schema"/>
1327
			<fileset dir="${utilitiesdir}"/>
1328
		</delete>
1329
	</target>
1330
	
1331
	<target name="documentation" depends="javadoc,admindoc"
1332
	    description="generates Javadoc API documentation and Admin Guide">
1333
    </target>
1334
	
1335
	<target name="admindoc" depends="prepare">
1336
		<!-- Build the administrator's guide, which is a Sphinx RST project
1337
		     For this to succeed, you must have Sphinx installed on your machine
1338
		     See: http://sphinx.pocoo.org/ for details
1339
		     And you must also have the 'make' build tool installed
1340
		-->
1341
		<exec dir="${docdir}/user/metacat" executable="make"> 
1342
		        <arg value="html"/> 
1343
		</exec>
1344
    </target>
1345

    
1346
	<target name="javadoc" depends="prepare"
1347
		description="generates Javadoc API documentation">
1348
		<javadoc packagenames="edu.ucsb.nceas.*"
1349
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1350
			version="true" use="true" windowtitle="${Name} API"
1351
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1352
			bottom="&lt;i&gt;Copyright &#169; ${copyright}. All Rights Reserved.&lt;/i&gt;">
1353
			<classpath>
1354
				<path refid="compile.classpath" />
1355
			</classpath>
1356
		</javadoc>
1357
	</target>
1358

    
1359
	<target name="dist"
1360
		depends="geteml,get-ecogrid,jar,protocol,documentation,getConversionXSL,getutilities"
1361
		description="prepares a full release distribution">
1362
		<mkdir dir="${dist.dir}" />
1363
		<delete dir="${ver.dir}" />
1364
		<mkdir dir="${ver.dir}" />
1365
		<copy todir="${ver.dir}">
1366
			<fileset dir="."
1367
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1368
		</copy>
1369
		<copy todir="${ver.dir}" file="build.xml" />
1370
		<copy todir="${ver.dir}" file="build.properties" />
1371

    
1372
		<copy todir="${ver.dir}/docs" filtering="yes">
1373
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1374
		</copy>
1375
		<copy todir="${ver.dir}/docs" filtering="no">
1376
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1377
		</copy>
1378
		<copy todir="${ver.dir}/docs/dev">
1379
			<fileset dir="${build.dir}/docs" />
1380
		</copy>
1381
		<copy todir="${ver.dir}/src">
1382
			<fileset dir="${build.dir}/src" />
1383
		</copy>
1384

    
1385
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1386
		<copy todir="${ver.dir}/test/servertestfiles">
1387
			<fileset dir="./test/servertestfiles" />
1388
		</copy>
1389
	</target>
1390

    
1391
	<target name="distbin" depends="build-metacat,war-lsid"
1392
		description="prepares a binary distribution">
1393
		<copy todir="${dist.dir}">
1394
			<fileset dir="./src/scripts" />
1395
		</copy>
1396
		<delete file="./${name}-bin-${release}.zip" />
1397
		<zip zipfile="./${name}-bin-${release}.zip"
1398
			basedir="${dist.dir}" excludes="metacat-*/**" />
1399
		<delete file="./${name}-bin-${release}.tar.gz" />
1400
		<tar tarfile="./${name}-bin-${release}.tar"
1401
			basedir="${dist.dir}" excludes="metacat-*/**" />
1402
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1403
			src="./${name}-bin-${release}.tar" />
1404
		<delete file="./${name}-bin-${release}.tar" />
1405
	</target>
1406

    
1407
	<target name="distsrc" depends="dist"
1408
		description="prepares a source distribution">
1409
		<mkdir dir="${ver.src}" />
1410
		<copy todir="${ver.src}">
1411
			<fileset dir="./src" />
1412
		</copy>
1413
		<mkdir dir="${util.dir}" />
1414
		<copy todir="${util.dir}">
1415
			<fileset dir="${utilitiesdir}" excludes="**/CVS*" />
1416
		</copy>
1417

    
1418
		<mkdir dir="${ecogrid-dist-dir}" />
1419
		<copy todir="${ecogrid-dist-dir}">
1420
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1421
		</copy>
1422

    
1423
		<delete file="${ver.dir}/lib/utilities.jar" />
1424

    
1425
		<delete file="./${name}-src-${release}.zip" />
1426
		<zip zipfile="./${name}-src-${release}.zip"
1427
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1428
		<delete file="./${name}-src-${release}.tar.gz" />
1429
		<tar tarfile="./${name}-src-${release}.tar"
1430
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1431
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1432
			src="./${name}-src-${release}.tar" />
1433
		<delete file="./${name}-src-${release}.tar" />
1434
		<!--delete dir="${dist.dir}"/ -->
1435
	</target>
1436

    
1437
	<target name="deb-package" depends="distbin"
1438
		description="create a debian installation package">
1439
		<delete dir="${deb.pkg.dir}" />
1440
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1441
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1442
			<fileset dir="./src/scripts/debian"
1443
				includes="control postinst" />
1444
		</copy>
1445

    
1446
		<mkdir
1447
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1448
		<copy
1449
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1450
			filtering="yes">
1451
			<fileset dir="./src/scripts/debian"
1452
				excludes="control postinst" />
1453
		</copy>
1454
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1455

    
1456
		<copy file="${dist.dir}/knb.war"
1457
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1458
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1459
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1460

    
1461
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1462
			failonerror="true">
1463
			<arg line="--build debian" />
1464
		</exec>
1465

    
1466
		<move file="${pkg.dir}/debian.deb"
1467
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1468
	</target>
1469

    
1470
	<target name="stylesheettest">
1471
		<xslt in="${input}" out="eml.html"
1472
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1473
			<param name="displaymodule" expression="${displaymodule}" />
1474
			<param name="docid" expression="${input}" />
1475
			<param name="entitytype" expression="${entitytype}" />
1476
			<param name="entityindex" expression="${entityindex}" />
1477
			<outputproperty name="method" value="html" />
1478
			<outputproperty name="standalone" value="yes" />
1479
			<outputproperty name="encoding" value="iso8859_1" />
1480
			<outputproperty name="indent" value="yes" />
1481
		</xslt>
1482
	</target>
1483

    
1484
	<target name="spatial_option" depends="prepare"
1485
		description=" -- compiles code for the spatial option">
1486

    
1487
		<echo message="Compiling the metatcat shapefile creator" />
1488
		<echo message="using the shapelib at: ${shapelib.dir}" />
1489
		<exec dir="." executable="g++" os="Linux, Unix"
1490
			failonerror="true">
1491
			<arg
1492
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1493
		</exec>
1494

    
1495
		<exec dir="." executable="g++" os="Linux, Unix"
1496
			failonerror="true">
1497
			<arg
1498
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1499
		</exec>
1500
	</target>
1501

    
1502
	<!-- LSID Authority support -->
1503
	<patternset id="lsid.jars">
1504
		<include name="axis.jar" />
1505
		<include name="commons-discovery-0.2.jar" />
1506
		<include name="jaxrpc.jar" />
1507
		<include name="lsid-client-1.1.1.jar" />
1508
		<include name="lsid-server-1.1.1.jar" />
1509
		<include name="saaj.jar" />
1510
		<include name="wsdl4j-1.5.1.jar" />
1511
		<include name="activation.jar" />
1512
		<include name="castor-0.9.5.jar" />
1513
		<include name="dnsjava-1.3.2.jar" />
1514
		<include name="mail.jar" />
1515
		<include name="commons-logging-1.0.4.jar" />
1516
		<!-- These jars may be needed but seem to not actually be,
1517
			so leaving them out for now
1518
			<include name="axis-ant.jar" />
1519
		-->
1520
		<!--<include name="GenCastor.class" />-->
1521
	</patternset>
1522
	<patternset id="lib.jars">
1523
		<include name="log4j-1.2.12.jar" />
1524
		<include name="utilities.jar" />
1525
		<include name="xerces*.jar" />
1526
		<include name="xalan*.jar" />
1527
		<include name="xml-apis.jar" />
1528
	</patternset>
1529

    
1530
	<path id="lsid.classpath">
1531
		<fileset dir="${lsid.lib.dir}">
1532
			<patternset refid="lsid.jars" />
1533
		</fileset>
1534
		<fileset dir="${lib.dir}">
1535
			<patternset refid="lib.jars" />
1536
		</fileset>
1537
		<fileset dir="${build.dir}">
1538
			<include name="metacat-client.jar" />
1539
			<include name="metacat.jar" />
1540
		</fileset>
1541
	</path>
1542

    
1543
	<filterset id="configFilters">
1544
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1545
			value="${config.hostname}" / -->
1546
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1547
			value="${config.port}" / -->
1548
		<!-- MCD BYE filter token="METADATA_LABELS"
1549
			value="${config.metadataLabelLsid}" / -->
1550
		<!-- MCD BYE filter token="METACAT_SERVER"
1551
			value="${config.metacatserver}" / -->
1552
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1553
			value="${config.lsidauthority}" / -->
1554
	</filterset>
1555

    
1556
	<target name="prepare-lsid" depends="prepare,utilities,clientjar"
1557
		description="Configure files prior to compilation">
1558
		<mkdir dir="${lsid.build.dir}" />
1559
		<!-- Copy the properties file into the build -->
1560
		<copy file="${conf.dir}/metacat-lsid.properties"
1561
			tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1562
			overwrite="true">
1563
			<filterset refid="configFilters" />
1564
		</copy>
1565
		<copy file="${conf.dir}/log4j.properties"
1566
			tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1567
			overwrite="true">
1568
			<filterset refid="configFilters" />
1569
		</copy>
1570
		<!-- Copy config files into the build -->
1571
		<copy todir="${lsid.build.dir}/WEB-INF">
1572
			<fileset dir="${webinf.dir}" includes="**/*.wsdd" />
1573
		</copy>
1574
		<!-- Copy the metadata configuration files into the build -->
1575
		<mkdir
1576
			dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1577
		<copy
1578
			todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1579
			<fileset dir="${conf.dir}" includes="**/*.xml" />
1580
			<fileset dir="${conf.dir}" includes="**/*.xslt" />
1581
			<filterset refid="configFilters" />
1582
		</copy>
1583
		<!-- Copy services files into the build -->
1584
		<mkdir dir="${lsid.build.dir}/services" />
1585
		<copy todir="${lsid.build.dir}/services">
1586
			<fileset dir="${services.dir}" />
1587
			<filterset refid="configFilters" />
1588
		</copy>
1589
		<!-- Copy axis files into the build -->
1590
		<mkdir dir="${lsid.build.dir}" />
1591
		<copy todir="${lsid.build.dir}">
1592
			<fileset dir="${conf.dir}/axis" excludes="*.properties" />
1593
		</copy>
1594
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1595
		<copy todir="${lsid.build.dir}/WEB-INF/classes">
1596
			<fileset dir="${conf.dir}/axis" includes="*.properties" />
1597
		</copy>
1598
	</target>
1599

    
1600
	<target name="compile-lsid" depends="prepare-lsid"
1601
		description="Compile Java sources">
1602
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1603
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1604
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1605
			deprecation="${compile.deprecation}"
1606
			optimize="${compile.optimize}">
1607
			<classpath refid="lsid.classpath" />
1608
		</javac>
1609
	</target>
1610

    
1611
	<target name="war-lsid" depends="compile-lsid"
1612
		description="Create a war file for the application">
1613
		<mkdir dir="${dist.dir}" />
1614
		<war destfile="${dist.dir}/${authority.context}.war"
1615
			webxml="${webinf.dir}/web.xml">
1616
			<fileset dir="${lsid.build.dir}" />
1617
			<lib dir="${lsid.lib.dir}">
1618
				<patternset refid="lsid.jars" />
1619
			</lib>
1620
			<lib dir="${lib.dir}">
1621
				<patternset refid="lib.jars" />
1622
			</lib>
1623
			<lib dir="${lib.dir}">
1624
				<include name="xalan.jar" />
1625
				<include name="xml-apis.jar" />
1626
			</lib>
1627
			<lib dir="${build.dir}">
1628
				<include name="metacat-client.jar" />
1629
			</lib>
1630
		</war>
1631
	</target>
1632

    
1633
	<target name="deploy-lsid" depends="war-lsid"
1634
		description="Deploy LSID war to servlet container">
1635
		<delete dir="${app.deploy.dir}/${authority.context}" />
1636
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1637
		<mkdir dir="${app.deploy.dir}" />
1638
		<copy todir="${app.deploy.dir}">
1639
			<fileset dir="${dist.dir}" />
1640
		</copy>
1641
	</target>
1642
	
1643
	<target name="change-metacat-properties" depends="warPrepare"
1644
        description="Chage some default values of metacat.properties">
1645
       <echo file="${metacat-properties-file}" append="true">
1646
		   configutil.propertiesConfigured=true
1647
		   configutil.authConfigured=true
1648
           configutil.skinsConfigured=true
1649
		   configutil.databaseConfigured=true
1650
		   configutil.geoserverConfigured=true
1651
	   </echo>
1652
  </target>
1653
	
1654
	<!-- This target will use default values in svn metacat.properties to build a configured 
1655
		metacat (except configuti.* properties, they will be set true). Those default settings
1656
		are for a test machine. It may not work on your system-->
1657
	<target name="install-configured-metacat" depends="change-metacat-properties, install"
1658
        description="Install a metacat by the default value in metacat.properties without additional configutaion">
1659
    </target>
1660
	
1661
</project>
(5-5/6)