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-11 20:41:02 -0700 (Mon, 11 Jun 2012) $'
11
	*    '$Revision: 7271 $'
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_2" />
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
					<exclude name="**/HzObjectPathMapTest$1.class" />
1166
					<exclude name="**/HzObjectPathMapTest$2.class" />
1167
				</fileset>
1168
			</batchtest>
1169
		</junit>
1170
	</target>
1171

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

    
1175
		<echo>testtorun: ${testtorun}</echo>
1176

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

    
1191
			<formatter type="plain" />
1192

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

    
1204
			<echo>testtorun: ${testtorun}</echo>
1205

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

    
1220
				<formatter type="plain" />
1221

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

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

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

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

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

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

    
1287
			<formatter type="plain" />
1288

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

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

    
1302

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

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

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

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

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

    
1379
		<copy todir="${ver.dir}/docs" filtering="yes">
1380
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1381
		</copy>
1382
		<copy todir="${ver.dir}/docs" filtering="no">
1383
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1384
		</copy>
1385
		<copy todir="${ver.dir}/docs/dev">
1386
			<fileset dir="${build.dir}/docs" />
1387
		</copy>
1388
		<copy todir="${ver.dir}/src">
1389
			<fileset dir="${build.dir}/src" />
1390
		</copy>
1391

    
1392
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1393
		<copy todir="${ver.dir}/test/servertestfiles">
1394
			<fileset dir="./test/servertestfiles" />
1395
		</copy>
1396
	</target>
1397

    
1398
	<target name="fulldist" depends="distbin, distsrc"
1399
			description="full distribution - source and bin"/>
1400
		
1401
	<target name="distbin" depends="build-metacat,war-lsid"
1402
		description="prepares a binary distribution">
1403
		<copy todir="${dist.dir}">
1404
			<fileset dir="./src/scripts" />
1405
		</copy>
1406
		<delete file="./${name}-bin-${release}.zip" />
1407
		<zip zipfile="./${name}-bin-${release}.zip"
1408
			basedir="${dist.dir}" excludes="metacat-*/**" />
1409
		<delete file="./${name}-bin-${release}.tar.gz" />
1410
		<tar tarfile="./${name}-bin-${release}.tar"
1411
			basedir="${dist.dir}" excludes="metacat-*/**" />
1412
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1413
			src="./${name}-bin-${release}.tar" />
1414
		<delete file="./${name}-bin-${release}.tar" />
1415
	</target>
1416

    
1417
	<target name="distsrc" depends="dist"
1418
		description="prepares a source distribution">
1419
		<mkdir dir="${ver.src}" />
1420
		<copy todir="${ver.src}">
1421
			<fileset dir="./src" />
1422
		</copy>
1423
		<mkdir dir="${util.dir}" />
1424
		<copy todir="${util.dir}">
1425
			<fileset dir="${utilitiesdir}" excludes="**/CVS*" />
1426
		</copy>
1427

    
1428
		<mkdir dir="${ecogrid-dist-dir}" />
1429
		<copy todir="${ecogrid-dist-dir}">
1430
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1431
		</copy>
1432

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

    
1435
		<delete file="./${name}-src-${release}.zip" />
1436
		<zip zipfile="./${name}-src-${release}.zip"
1437
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1438
		<delete file="./${name}-src-${release}.tar.gz" />
1439
		<tar tarfile="./${name}-src-${release}.tar"
1440
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1441
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1442
			src="./${name}-src-${release}.tar" />
1443
		<delete file="./${name}-src-${release}.tar" />
1444
		<!--delete dir="${dist.dir}"/ -->
1445
	</target>
1446

    
1447
	<target name="deb-package" depends="distbin"
1448
		description="create a debian installation package">
1449
		<delete dir="${deb.pkg.dir}" />
1450
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1451
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1452
			<fileset dir="./src/scripts/debian"
1453
				includes="control postinst" />
1454
		</copy>
1455

    
1456
		<mkdir
1457
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1458
		<copy
1459
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1460
			filtering="yes">
1461
			<fileset dir="./src/scripts/debian"
1462
				excludes="control postinst" />
1463
		</copy>
1464
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1465

    
1466
		<copy file="${dist.dir}/knb.war"
1467
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1468
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1469
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1470

    
1471
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1472
			failonerror="true">
1473
			<arg line="--build debian" />
1474
		</exec>
1475

    
1476
		<move file="${pkg.dir}/debian.deb"
1477
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1478
	</target>
1479

    
1480
	<target name="stylesheettest">
1481
		<xslt in="${input}" out="eml.html"
1482
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1483
			<param name="displaymodule" expression="${displaymodule}" />
1484
			<param name="docid" expression="${input}" />
1485
			<param name="entitytype" expression="${entitytype}" />
1486
			<param name="entityindex" expression="${entityindex}" />
1487
			<outputproperty name="method" value="html" />
1488
			<outputproperty name="standalone" value="yes" />
1489
			<outputproperty name="encoding" value="iso8859_1" />
1490
			<outputproperty name="indent" value="yes" />
1491
		</xslt>
1492
	</target>
1493

    
1494
	<target name="spatial_option" depends="prepare"
1495
		description=" -- compiles code for the spatial option">
1496

    
1497
		<echo message="Compiling the metatcat shapefile creator" />
1498
		<echo message="using the shapelib at: ${shapelib.dir}" />
1499
		<exec dir="." executable="g++" os="Linux, Unix"
1500
			failonerror="true">
1501
			<arg
1502
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1503
		</exec>
1504

    
1505
		<exec dir="." executable="g++" os="Linux, Unix"
1506
			failonerror="true">
1507
			<arg
1508
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1509
		</exec>
1510
	</target>
1511

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

    
1540
	<path id="lsid.classpath">
1541
		<fileset dir="${lsid.lib.dir}">
1542
			<patternset refid="lsid.jars" />
1543
		</fileset>
1544
		<fileset dir="${lib.dir}">
1545
			<patternset refid="lib.jars" />
1546
		</fileset>
1547
		<fileset dir="${build.dir}">
1548
			<include name="metacat-client.jar" />
1549
			<include name="metacat.jar" />
1550
		</fileset>
1551
	</path>
1552

    
1553
	<filterset id="configFilters">
1554
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1555
			value="${config.hostname}" / -->
1556
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1557
			value="${config.port}" / -->
1558
		<!-- MCD BYE filter token="METADATA_LABELS"
1559
			value="${config.metadataLabelLsid}" / -->
1560
		<!-- MCD BYE filter token="METACAT_SERVER"
1561
			value="${config.metacatserver}" / -->
1562
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1563
			value="${config.lsidauthority}" / -->
1564
	</filterset>
1565

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

    
1610
	<target name="compile-lsid" depends="prepare-lsid"
1611
		description="Compile Java sources">
1612
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1613
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1614
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1615
			deprecation="${compile.deprecation}"
1616
			optimize="${compile.optimize}">
1617
			<classpath refid="lsid.classpath" />
1618
		</javac>
1619
	</target>
1620

    
1621
	<target name="war-lsid" depends="compile-lsid"
1622
		description="Create a war file for the application">
1623
		<mkdir dir="${dist.dir}" />
1624
		<war destfile="${dist.dir}/${authority.context}.war"
1625
			webxml="${webinf.dir}/web.xml">
1626
			<fileset dir="${lsid.build.dir}" />
1627
			<lib dir="${lsid.lib.dir}">
1628
				<patternset refid="lsid.jars" />
1629
			</lib>
1630
			<lib dir="${lib.dir}">
1631
				<patternset refid="lib.jars" />
1632
			</lib>
1633
			<lib dir="${lib.dir}">
1634
				<include name="xalan.jar" />
1635
				<include name="xml-apis.jar" />
1636
			</lib>
1637
			<lib dir="${build.dir}">
1638
				<include name="metacat-client.jar" />
1639
			</lib>
1640
		</war>
1641
	</target>
1642

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