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: 2013-02-25 09:23:14 -0800 (Mon, 25 Feb 2013) $'
11
	*    '$Revision: 7502 $'
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
            <fileset dir='lib/lucene'>
105
                <include name='*.jar'/>
106
            </fileset>
107
            <fileset dir='lib/solr'>
108
                <include name='*.jar'/>
109
            </fileset>
110

    
111
            <pathelement location="lib" />
112
			<fileset dir="lib">
113
				<include name="*.jar" />
114
			</fileset>
115
			<fileset dir="lib">
116
				<include name="xalan.jar" />
117
			</fileset>
118
			<fileset dir="lib/lsid_lib">
119
				<include name="*.jar" />
120
			</fileset>
121

    
122
			<!-- Include geoserver, geotools, et. al. -->
123
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
124
				<include name="*.jar" />
125
			</fileset>
126

    
127
			<!-- Include OAI-PMH -->
128
			<fileset dir="lib/oaipmh">
129
				<include name="*.jar" />
130
			</fileset>
131

    
132
		</path>
133
		
134
		<path id="test.classpath">
135
			<pathelement location="${jsdk}" />
136
			<pathelement location="lib" />
137
			<fileset dir="lib">
138
				<include name="*.jar" />
139
				<exclude name="maven-ant-tasks-2.1.0.jar" />
140
			</fileset>
141
			<fileset dir="lib">
142
				<include name="xalan.jar" />
143
			</fileset>
144
			<fileset dir="lib/lsid_lib">
145
				<include name="*.jar" />
146
			</fileset>
147

    
148
			<!-- Include geoserver, geotools, et. al. -->
149
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
150
				<include name="*.jar" />
151
			</fileset>
152
		
153

    
154
			<!-- Include OAI-PMH -->
155
			<fileset dir="lib/oaipmh">
156
				<include name="*.jar" />
157
			</fileset>
158

    
159
		</path>
160

    
161
		<!-- It is less likely you'll need to make any changes from here down,
162
			but customization is possible -->
163
		<property name="name" value="metacat" />
164
		<property name="Name" value="MetaCat" />
165
		<property name="debugprefix" value="${Name}:" />
166
		<property name="release" value="${metacat.version}" />
167
		<tstamp>
168
		    <format property="copyrightyear" pattern="yyyy" locale="en,US"/>
169
		</tstamp>
170
		<property name="copyright" value="${copyrightyear} Regents of the University of California" />
171
		<property name="style-common-relpath" value="/style/common" />
172
		<property name="style-shared-relpath" value="/style/shared" />
173
		<property name="schema-relpath" value="/schema" />
174
		<property name="style-common-cvsrelpath"
175
			value="lib${style-common-relpath}" />
176
		<property name="schema-cvsrelpath" value="lib${schema-relpath}" />
177
		<property name="style-skins-relpath" value="/style/skins" />
178
		<property name="util-module" value="utilities" />
179
		<!--<property name="utilities-tag" value="trunk" />-->
180
		<property name="utilities-tag" value="tags/UTILITIES_1_3_0" />
181
		<property name="seek-tag" value="tags/ECOGRID_1_2_2" />
182
		<property name="eml-module" value="eml" />
183
		<property name="eml-version" value="2.0.0beta6" />
184
		<property name="eml-beta4-version" value="2.0.0beta4" />
185
		<property name="eml-beta-tag"
186
			value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT" />
187
		<property name="eml-beta4-tag"
188
					value="RELEASE_EML_2_BETA_4" />
189
		<property name="eml2_0_0-schema-tag"
190
			value="RELEASE_EML_2_0_0_UPDATE_1" />
191
		<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
192
		<property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0" />
193
		<property name="eml2_1_1-schema-tag" value="RELEASE_EML_2_1_1" />
194
		<property name="eml2-style-tag" value="RELEASE_EML_UTILS_1_0_6" />
195
		<property name="eml2_0_0namespace"
196
			value="eml://ecoinformatics.org/eml-2.0.0" />
197
		<property name="eml2_0_1namespace"
198
			value="eml://ecoinformatics.org/eml-2.0.1" />
199
		<property name="eml2_1_0namespace"
200
			value="eml://ecoinformatics.org/eml-2.1.0" />
201
		<property name="eml2_1_1namespace"
202
			value="eml://ecoinformatics.org/eml-2.1.1" />
203
		<property name="stmmlnamespace"
204
			value="http://www.xml-cml.org/schema/stmml" />
205
		<property name="stmml11namespace"
206
			value="http://www.xml-cml.org/schema/stmml-1.1" />
207
		<property name="eml-css" value="eml_xsl.css" />
208
		<property name="eml-module.default.css" value="default.css" />
209
		<property name="systemidserver" value="" />
210
		<property name="html-path" value="" />
211
		<property name ="metacat-properties-file" value="build/war/WEB-INF/metacat.properties"/>
212

    
213

    
214
		<!-- Config for registry variables -->
215
		<!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
216
		<property name="scope" value="obfs" />
217
		<property name="responseForm" value="genericResponse.tmpl" />
218
		<property name="entryForm" value="entryForm.tmpl" />
219
		<property name="guide" value="genericGuide.tmpl" />
220
		<property name="loginForm" value="loginForm.tmpl" />
221
		<property name="confirmData" value="confirmData.tmpl" />
222
		<property name="deleteData" value="deleteData.tmpl" />
223
		<property name="genericHeader" value="genericHeader.tmpl" />
224
		<property name="genericFooter" value="genericFooter.tmpl" />
225

    
226
		<filter token="scope" value="${scope}" />
227
		<filter token="responseForm" value="${responseForm}" />
228
		<filter token="entryForm" value="${entryForm}" />
229
		<filter token="guide" value="${guide}" />
230
		<filter token="loginForm" value="${loginForm}" />
231
		<filter token="confirmData" value="${confirmData}" />
232
		<filter token="deleteData" value="${deleteData}" />
233
		<filter token="genericHeader" value="${genericHeader}" />
234
		<filter token="genericFooter" value="${genericFooter}" />
235
		<filter token="adminname" value="${adminname}" />
236
		<filter token="recipient" value="${recipient}" />
237
		<filter token="metacatVersion" value="${metacat.version}" />
238
		<filter token="metacatRC" value="${metacat.releaseCandidate}" />
239
		<filter token="build.context" value="${metacat.context}" />
240

    
241
		<filter token="docrooturl" value="./" />
242
		<filter token="mcuser" value="${mcuser}" />
243
		<filter token="mcpassword" value="${mcpassword}" />
244
		<filter token="mcanotheruser" value="${mcanotheruser}" />
245
		<filter token="mcanotherpassword" value="${mcanotherpassword}" />
246
		<filter token="eml-css" value="${eml-css}" />
247
		<filter token="style-skins-relpath"
248
			value="${style-skins-relpath}" />
249
		<filter token="style-common-relpath"
250
			value="${style-common-relpath}" />
251

    
252
		<filter token="eml-version" value="${eml-version}" />
253
		<filter token="eml-beta4-version" value="${eml-beta4-version}" />
254
		<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}" />
255
		<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}" />
256
		<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}" />
257
		<filter token="eml2_1_1namespace" value="${eml2_1_1namespace}" />
258
		<filter token="stmmlnamespace" value="${stmmlnamespace}" />
259
		<filter token="stmml11namespace" value="${stmml11namespace}" />
260
		<filter token="debugprefix" value="${debugprefix}" />
261

    
262
		<filter token="defaultStage" value="${defaultStage}" />
263
		<filter token="defaultHeader" value="${defaultHeader}" />
264
		<filter token="defaultFooter" value="${defaultFooter}" />
265
		<filter token="defaultChangePass" value="${defaultChangePass}" />
266
		<filter token="defaultResetPass" value="${defaultResetPass}" />
267
		<filter token="changePassSuccess" value="${changePassSuccess}" />
268
		<filter token="resetPassSuccess" value="${resetPassSuccess}" />
269
		<filter token="registerFailed" value="${registerFailed}" />
270
		<filter token="registerLter" value="${registerLter}" />
271
		<filter token="registerMatch" value="${registerMatch}" />
272
		<filter token="registerSuccess" value="${registerSuccess}" />
273
		<filter token="register" value="${register}" />
274
		<filter token="searchResults" value="${searchResults}" />
275
		<filter token="ldapMainServerFailure"
276
			value="${ldapMainServerFailure}" />
277
		<filter token="lter-user" value="${lteruser}" />
278
		<filter token="lter-pass" value="${lterpassword}" />
279
		<filter token="pisco-user" value="${piscouser}" />
280
		<filter token="pisco-pass" value="${piscopassword}" />
281

    
282

    
283
		<!-- MCD BYE filter token="timedreplication"     value="${timedreplication}" / -->
284
		<!-- MCD BYE filter token="firsttimedreplication" value="${firsttimedreplication}" / -->
285
		<!-- MCD BYE filter token="timedreplicationinterval" value="${timedreplicationinterval}" / -->
286

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

    
324
		<property name="ecogrid-target-name" value="metacatImpl" />
325
		<property name="ecogrid-module-dest-dir" value=".." />
326
		<property name="ecogrid-module" value="seek/projects/ecogrid" />
327
		<property name="ecogrid-dist-dir"
328
			value="${dist.dir}/${ecogrid-module}" />
329
		<property name="ecogrid-dir"
330
			value="${ecogrid-module-dest-dir}/${ecogrid-module}" />
331

    
332
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
333

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

    
360
		<!-- load the svn task -->
361
		<path id="svn.classpath">
362
			<pathelement location="${svnjavahl.jar}" />
363
			<pathelement location="${svnant.jar}" />
364
			<pathelement location="${svnClientAdapter.jar}" />
365
		</path>
366
		<taskdef resource="svntask.properties"
367
			classpathref="svn.classpath" />
368

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

    
406
		<condition property="ecogrid.required">
407
			<or>
408
				<not>
409
					<available file="${ecogrid-dir}/build.properties" />
410
				</not>
411
				<not>
412
					<available
413
						file="${ecogrid-dir}/buildfiles/metacatImpl.xml" />
414
				</not>
415
			</or>
416
		</condition>
417

    
418
	</target>
419

    
420
	<target name="prepare" depends="init">
421
		<mkdir dir="${build.dir}" />
422
		<mkdir dir="${build.src}" />
423
		<mkdir dir="${build.dest}" />
424
		<mkdir dir="${build.docs}" />
425
		<mkdir dir="${build.javadocs}" />
426
		<mkdir dir="${build.tmp}" />
427

    
428
		<copy todir="${build.src}" filtering="yes">
429
			<fileset dir="${srcdir}">
430
				<include name="edu/**" />
431
				<include name="com/**" />
432
				<include name="org/**" />
433
				<!-- include name="java/**" / -->
434
				<include name="**/*.sql" />
435
				<exclude name="**/CVS*" />
436
				<exclude name="**/.#*" />
437
				<exclude name="edu/ucsb/nceas/workflowscheduler/**" />
438
			</fileset>
439
		</copy>
440
		<available file="lib/style/common/emlb6toeml2" type="dir"
441
			property="styles.not.needed" />
442
	</target>
443

    
444
	<target name="generateStubs" depends="prepare">
445
		<echo
446
			message=" Generating stubs for execution service from ${/tmp/KeplerWebService.wsdl}" />
447
		<axis-wsdl2java verbose="true" output="${srcdir}"
448
			url="/tmp/KeplerWebService.wsdl" />
449
	</target>
450

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

    
454
		<javac srcdir="${build.src}" destdir="${build.dest}"
455
			debug="${debug}"
456
			excludes="**/*.sql **/client/*.java **/harvesterClient/*.java">
457
			<classpath>
458
				<path refid="compile.classpath" />
459
			</classpath>
460
		</javac>
461
	</target>
462

    
463
	<target name="jar" depends="compile,geteml"
464
		description="Compiles and jars metacat java code to metacat.jar in build dir ">
465

    
466
		<delete file="${build.dir}/${name}.jar" />
467
		<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
468
			excludes="**/protocols/ **/harvesterClient/" />
469
	</target>
470

    
471
	<target name="protocol" depends="compile"
472
		description="Compiles and jars protocol java code to protocol.jar in build dir">
473
		<delete file="${build.dir}/protocol.jar" />
474
		<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
475
			includes="**/protocols/" />
476
	</target>
477

    
478
	<target name="utilities" depends="config,getpeerutilities"
479
		if="utilities.required">
480
		<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
481
		<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
482
		<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
483
	</target>
484

    
485
	<target name="getpeerutilities" depends="prepare"
486
		if="peer.utilities.required"
487
		description="Checks utilities out of svn and copies it to your utilitiesdir if it does not already exist">
488
		<echo message="Exporting utilities files from svn repository:" />
489
		<svn>
490
			<export srcUrl="${svn.utilitiesUrl}"
491
				destPath="${utilitiesdir}" />
492
		</svn>
493

    
494
		<!--  ant dir="${utilitiesdir}" inheritAll="false"  target="dist" / -->
495
	</target>
496

    
497
	<target name="getutilities" depends="prepare"
498
		description="Checks utility out of svn and copies it to your metacat sandbox">
499
		<svn>
500
			<export srcUrl="${svn.utilitiesUrl}"
501
				destPath="${utilitiesdir}" force="true" />
502
		</svn>
503
	</target>
504

    
505
	<target name="client" depends="utilities, prepare"
506
		description="Compiles metacat-client java code to build dir">
507
		<javac srcdir="${build.src}" destdir="${build.dest}"
508
			includes="edu/ucsb/nceas/metacat/client/*">
509
			<classpath>
510
				<path refid="compile.classpath" />
511
			</classpath>
512
		</javac>
513
	</target>
514

    
515
	<target name="clientjar" depends="client"
516
		description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
517
		<delete file="${build.dir}/${name}-client.jar" />
518
		<jar jarfile="${build.dir}/${name}-client.jar"
519
			basedir="${build.dest}" includes="**/metacat/client/" />
520
	</target>
521

    
522
	<target name="advancedsearchjar" depends="compile"
523
		description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
524
		<delete file="${build.dir}/advancedsearch.jar" />
525
		<jar jarfile="${build.dir}/advancedsearch.jar"
526
			basedir="${build.dest}" includes="**/metacat/advancedsearch/" />
527
	</target>
528

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

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

    
570
	<target name="geteml" depends="getemlpre2,getemlpre2beta4,geteml2+,getConversionXSL"
571
		if="eml.required" description="Calls getemlpre2 and geteml2+ targets" />
572

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

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

    
613
			<!--
614
			<copy todir="${style-common-cvsrelpath}" filtering="yes">
615
				<fileset
616
					dir="${build.tmp}/eml_${eml-beta4-tag}/style">
617
					<include name="**/*.xsl" />
618
				</fileset>
619
			</copy>
620
			-->
621
		</target>
622

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

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

    
642
		</copy>
643
		<!-- <antcall target="copyxsl">
644
			<param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
645
			<param name="dirname" value="eml-2.0.0" />
646
			</antcall> -->
647

    
648
		<!-- Checkout eml201 for given schema tag-->
649
		<svn>
650
			<export srcUrl="${svn.eml201SchemaUrl}"
651
				destPath="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
652
		</svn>
653
		<mkdir dir="lib/schema/eml-2.0.1" />
654
		<copy todir="lib/schema/eml-2.0.1" filtering="yes">
655
			<fileset
656
				dir="${build.tmp}/eml_${eml2_0_1-schema-tag}">
657
				<include name="*.xsd" />
658
			</fileset>
659
		</copy>
660

    
661
		<!-- Checkout eml201 again for given style sheet tag-->
662
		<!-- echo>Enter CVS password: </echo>
663
			<cvs cvsRoot="${cvsroot}"
664
			package="${eml-module}"
665
			tag="${eml2_0_1-style-tag}"
666
			dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
667
			<antcall target="copyxsl">
668
			<param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
669
			<param name="dirname" value="eml-2.0.1" />
670
			</antcall -->
671

    
672
		<!-- Checkout eml210 for given schema tag-->
673
		<svn>
674
			<export srcUrl="${svn.eml210SchemaUrl}"
675
				destPath="${build.tmp}/eml_${eml2_1_0-schema-tag}" />
676
		</svn>
677
		<mkdir dir="lib/schema/eml-2.1.0" />
678
		<copy todir="lib/schema/eml-2.1.0" filtering="yes">
679
			<fileset
680
				dir="${build.tmp}/eml_${eml2_1_0-schema-tag}">
681
				<include name="*.xsd" />
682
			</fileset>
683
		</copy>
684

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

    
710
	<target name="copyxsl"
711
		description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
712

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

    
715
		<copy todir="${style-common-cvsrelpath}/${dirname}"
716
			filtering="yes">
717
			<fileset
718
				dir="${build.tmp}/eml_${cvs.tagname}/style/eml">
719
				<include name="**/*.xsl" />
720
			</fileset>
721
		</copy>
722

    
723

    
724
		<!-- now copy default css from eml module and put it in style-common-path
725
			dir with a new name, so other skin-specific css can import it if reqd -->
726
		<copy
727
			file="${build.tmp}/eml_${cvs.tagname}/${eml-module.default.css}"
728
			tofile="${style-common-cvsrelpath}/${eml-css}" />
729

    
730
	</target>
731

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

    
747
	<target name="install-spatial" depends="jar,clientjar,harvesterjar"
748
		description="Installs spatial option for metacat">
749

    
750
		<property name="spatial.dir" value="./lib/spatial" />
751
		<property name="spatial.geoserver.dir"
752
			value="${spatial.dir}/geoserver" />
753
		<property name="spatial.webinf-mods"
754
			value="${spatial.dir}/WEB-INF" />
755

    
756
		<!-- Copy geoserver libs into ${war.lib} -->
757
		<copy todir="${war.lib}" filtering="no">
758
			<fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
759
				<include name="**" />
760
			</fileset>
761
		</copy>
762
		
763
		<copy todir="${dist.dir}">
764
			<fileset dir="./lib/spatial/geoserver" includes="*.war" />
765
		</copy>
766

    
767
	</target>
768

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

    
785
	<target name="build-metacat" depends="install-ecogrid, install-spatial"
786
		description="Build Metacat">
787
	</target>
788

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

    
810

    
811
	</target>
812

    
813
	<target name="get-ecogrid" depends="init"
814
		description="Check out ecogrid module" if="ecogrid.required">
815
		<svn>
816
			<export srcUrl="${svn.ecogridUrl}" force="true"
817
				destPath="${ecogrid-dir}" />
818
		</svn>
819
	</target>
820

    
821
	<!-- target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
822
		<ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
823
		<property name="context" value="${metacat.context}"/>
824
		<property name="target" value="${ecogrid-target-name}"/>
825
		<property name="metacat.dir" value="."/>
826
		<property name="hostname" value="${ecogrid.hostname}"/>
827
		<property name="port" value="${config.port}"/>
828
		</ant>
829
		</target -->
830

    
831
	<target name="clean-ecogrid-server-config-wsdd" depends="init"
832
		description="Automately generate wsdd for ecogrid service">
833
		<delete
834
			file="${app.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd" />
835
	</target>
836

    
837
	<target name="install-skin" depends="init"
838
		description="Install a Skin">
839

    
840
		<input message="Please enter name of the skin"
841
			addproperty="skin-name" />
842

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

    
887
		<echo message="Install Skin completed." />
888
	</target>
889

    
890
	<target name="war" depends="warPrepare,install-spatial"
891
		description="Create a web archive (WAR) for servlet deployment">
892
		<mkdir dir="${dist.dir}" />
893
		<war destfile="${dist.dir}/${metacat.context}.war"
894
			webxml="${build.war}/web.xml">
895
			<fileset dir="${war.context}" />
896
			<lib dir="${war.lib}" />
897
			<webinf dir="${war.webinf}" />
898
		</war>
899
	</target>
900

    
901
	<target name="warPrepare"
902
		depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare,documentation"
903
		description="Prepare files for creating a web archive (WAR)">
904

    
905
		<property name="war.lib" value="${build.war}/lib" />
906
		<property name="war.webinf" value="${build.war}/WEB-INF" />
907
		<property name="war.context"
908
			value="${build.war}/${metacat.context}" />
909
		<property name="war.webinf.sql" value="${war.webinf}/sql" />
910
		<property name="war.webinf.scripts"
911
			value="${war.webinf}/scripts" />
912
		<property name="war.context.cgi" value="${war.context}/cgi-bin" />
913
		<property name="war.context.docs" value="${war.context}/docs" />
914
		<property name="war.context.temp" value="${war.context}/temp" />
915
		<property name="war.context.templates"
916
			value="${war.context}${style-common-relpath}/templates" />
917
		<mkdir dir="${war.lib}" />
918
		<mkdir dir="${war.webinf}" />
919
		<mkdir dir="${war.context}" />
920
		<mkdir dir="${war.webinf.sql}" />
921
		<mkdir dir="${war.context.cgi}" />
922
		<mkdir dir="${war.context.docs}" />
923
		<mkdir dir="${war.context.temp}" />
924
		<mkdir dir="${war.context.templates}" />
925

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

    
1018
		<copy file="src/perl/register-dataset.cgi"
1019
			todir="${war.context.cgi}" />
1020
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1021
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1022

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

    
1036
		<!-- ldap cgi section -->
1037
		<copy todir="${war.context.templates}">
1038
			<fileset dir="lib/style/common/templates">
1039
				<!-- SCW: Copy all files -->
1040
			</fileset>
1041
		</copy>
1042
	</target>
1043

    
1044
	<target name="cgiPrepare" if="build.perl">
1045
		<exec dir="src/perl/Metacat/" executable="make">
1046
			<arg value="clean" />
1047
		</exec>
1048
		<exec dir="src/perl/Metacat/" executable="perl">
1049
			<arg value="Makefile.PL" />
1050
		</exec>
1051
		<exec dir="src/perl/Metacat/" executable="make" />
1052
	</target>
1053

    
1054
	<target name="testPrepare"
1055
		description="Copies test files into the war directories">
1056
		<echo>in testPrepare</echo>
1057
		<property name="war.context.test"
1058
			value="${build.war}/${metacat.context}/test" />
1059
		<mkdir dir="${war.context.test}" />
1060
		<copy todir="${war.context.test}" filtering="yes">
1061
			<fileset dir="test/servertestfiles">
1062
				<include name="*/**" />
1063
			</fileset>
1064
		</copy>
1065
	</target>
1066

    
1067
	<target name="getConversionXSL" depends="prepare"
1068
		unless="styles.not.needed"
1069
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1070

    
1071
		<svn>
1072
			<export srcUrl="${svn.eml2StyleUrl}"
1073
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1074
		</svn>
1075

    
1076
		<mkdir dir="lib/style/common/emlb6toeml2" />
1077
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1078
			<fileset
1079
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1080
				<include name="*.xsl" />
1081
				<include name="*.xml" />
1082
			</fileset>
1083
		</copy>
1084
	</target>
1085

    
1086
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1087
		<mkdir dir="${build.tests}" />
1088
		<copy todir="${build.tests}" encoding="UTF-8">
1089
			<fileset dir="${testdir}">
1090
				<include name="edu/**" />
1091
			</fileset>
1092
		</copy>
1093
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1094

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

    
1118
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1119
			basedir="${build.tests}" >
1120
			<include name="**/*.class"/>
1121
			<include name="**/*.xml"/>
1122
		</jar>	
1123
		
1124
	</target>
1125

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

    
1146
		<!-- use the ant "junit" task to run JUnit tests. -->
1147
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1148
			haltonerror="no">
1149
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1150
			<classpath>
1151
				<path refid="test.classpath" />
1152
				<fileset dir="${build.dir}">
1153
					<include name="${name}.jar" />
1154
					<include name="${name}-client.jar" />
1155
					<include name="harvester.jar" />
1156
					<include name="${name}-junittests.jar" />
1157
				</fileset>
1158
			</classpath>
1159

    
1160
			<formatter type="plain" />
1161

    
1162
			<batchtest fork="yes" todir="${build.dir}">
1163
				<fileset dir="${build.tests}">
1164
					<include name="**/*.class" />
1165
					<exclude name="**/MCTestCase.class" />
1166
					<exclude name="**/ClientViewHelperTest.class" />
1167
					<!-- these are not test cases -->
1168
					<exclude name="**/MockCNode.class" />
1169
					<exclude name="**/D1NodeServiceTest.class" />
1170
					<exclude name="**/QueryRunner.class" />
1171
					<exclude name="**/MockObjectPathMap.class" />
1172
					<exclude name="**/HzObjectPathMapTest$1.class" />
1173
					<exclude name="**/HzObjectPathMapTest$2.class" />
1174
				</fileset>
1175
			</batchtest>
1176
		</junit>
1177
	</target>
1178

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

    
1182
		<echo>testtorun: ${testtorun}</echo>
1183

    
1184
		<!-- use the ant "junit" task to run JUnit tests. -->
1185
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1186
			haltonerror="no" showoutput="yes">
1187
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1188
			<classpath>
1189
				<path refid="test.classpath" />
1190
				<fileset dir="${build.dir}">
1191
					<include name="${name}.jar" />
1192
					<include name="${name}-client.jar" />
1193
					<include name="harvester.jar" />
1194
					<include name="${name}-junittests.jar" />
1195
				</fileset>
1196
			</classpath>
1197

    
1198
			<formatter type="plain" />
1199

    
1200
			<batchtest fork="yes" todir="${build.dir}">
1201
				<fileset dir="${build.tests}">
1202
					<include name="**/${testtorun}.class" />
1203
				</fileset>
1204
			</batchtest>
1205
		</junit>
1206
	</target>
1207
	
1208
	<target name="run" depends="testprep"
1209
			description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1210

    
1211
			<echo>testtorun: ${testtorun}</echo>
1212

    
1213
			<!-- use the ant "junit" task to run JUnit tests. -->
1214
			<junit printsummary="yes" haltonfailure="no" fork="yes"
1215
				haltonerror="no" showoutput="yes">
1216
				<jvmarg value="-Dfile.encoding=UTF-8"/>
1217
				<classpath>
1218
					<path refid="test.classpath" />
1219
					<fileset dir="${build.dir}">
1220
						<include name="${name}.jar" />
1221
						<include name="${name}-client.jar" />
1222
						<include name="harvester.jar" />
1223
						<include name="${name}-junittests.jar" />
1224
					</fileset>
1225
				</classpath>
1226

    
1227
				<formatter type="plain" />
1228

    
1229
				<batchtest fork="yes" todir="${build.dir}">
1230
					<fileset dir="${build.tests}">
1231
						<include name="**/${testtorun}.class" />
1232
					</fileset>
1233
				</batchtest>
1234
			</junit>
1235
		</target>
1236

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

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

    
1263
		<echo>
1264
			*********************************** Please run ant
1265
			gethttpclient first! ***********************************
1266
		</echo>
1267
		<!-- copy and compile the tests into a jar file -->
1268
		<mkdir dir="${build.metacatnettest}" />
1269
		<javac srcdir="${junitnettestsdir}"
1270
			destdir="${build.metacatnettest}" includes="**/*.java">
1271
			<classpath>
1272
				<path refid="compile.classpath" />
1273
				<fileset dir="${build.dir}">
1274
					<include name="${name}.jar" />
1275
				</fileset>
1276
			</classpath>
1277
		</javac>
1278

    
1279
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1280
			basedir="${build.metacatnettest}" includes="**/*.class" />
1281

    
1282
		<!-- use the ant "junit" task to run JUnit tests. -->
1283
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1284
			haltonerror="no">
1285
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1286
			<classpath>
1287
				<path refid="compile.classpath" />
1288
				<fileset dir="${build.dir}">
1289
					<include name="${name}.jar" />
1290
					<include name="${name}-junitnettests.jar" />
1291
				</fileset>
1292
			</classpath>
1293

    
1294
			<formatter type="plain" />
1295

    
1296
			<batchtest fork="yes" todir="${build.dir}">
1297
				<fileset dir="${build.metacatnettest}">
1298
					<include name="**/*.class" />
1299
				</fileset>
1300
			</batchtest>
1301
		</junit>
1302
	</target>
1303

    
1304
	<target name="cleanweb" depends="clean"
1305
		description="deletes tomcat web context dir and all its contents">
1306
		<delete dir="${installdir}" />
1307
	</target>
1308

    
1309

    
1310
	<target name="clean" depends="init"
1311
		description="deletes build dir and files that can be regenerated form the release">
1312
		<delete dir="${build.dir}" />
1313
		<delete dir="${dist.dir}" />
1314
	</target>
1315

    
1316
	<target name="localclean" depends="clean"
1317
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1318
		<delete file="lib/utilities.jar" />
1319
	</target>
1320

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

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

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

    
1386
		<copy todir="${ver.dir}/docs" filtering="yes">
1387
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1388
		</copy>
1389
		<copy todir="${ver.dir}/docs" filtering="no">
1390
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1391
		</copy>
1392
		<copy todir="${ver.dir}/docs/dev">
1393
			<fileset dir="${build.dir}/docs" />
1394
		</copy>
1395
		<copy todir="${ver.dir}/src">
1396
			<fileset dir="${build.dir}/src" />
1397
		</copy>
1398

    
1399
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1400
		<copy todir="${ver.dir}/test/servertestfiles">
1401
			<fileset dir="./test/servertestfiles" />
1402
		</copy>
1403
	</target>
1404

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

    
1424
	<target name="distsrc" depends="dist"
1425
		description="prepares a source distribution">
1426
		<mkdir dir="${ver.src}" />
1427
		<copy todir="${ver.src}">
1428
			<fileset dir="./src" />
1429
		</copy>
1430
		<mkdir dir="${util.dir}" />
1431
		<copy todir="${util.dir}">
1432
			<fileset dir="${utilitiesdir}" excludes="**/CVS*" />
1433
		</copy>
1434

    
1435
		<mkdir dir="${ecogrid-dist-dir}" />
1436
		<copy todir="${ecogrid-dist-dir}">
1437
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1438
		</copy>
1439

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

    
1442
		<delete file="./${name}-src-${release}.zip" />
1443
		<zip zipfile="./${name}-src-${release}.zip"
1444
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1445
		<delete file="./${name}-src-${release}.tar.gz" />
1446
		<tar tarfile="./${name}-src-${release}.tar"
1447
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1448
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1449
			src="./${name}-src-${release}.tar" />
1450
		<delete file="./${name}-src-${release}.tar" />
1451
		<!--delete dir="${dist.dir}"/ -->
1452
	</target>
1453

    
1454
	<target name="deb-package" depends="distbin"
1455
		description="create a debian installation package">
1456
		<delete dir="${deb.pkg.dir}" />
1457
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1458
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1459
			<fileset dir="./src/scripts/debian"
1460
				includes="control postinst" />
1461
		</copy>
1462

    
1463
		<mkdir
1464
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1465
		<copy
1466
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1467
			filtering="yes">
1468
			<fileset dir="./src/scripts/debian"
1469
				excludes="control postinst" />
1470
		</copy>
1471
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1472

    
1473
		<copy file="${dist.dir}/knb.war"
1474
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1475
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1476
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1477

    
1478
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1479
			failonerror="true">
1480
			<arg line="--build debian" />
1481
		</exec>
1482

    
1483
		<move file="${pkg.dir}/debian.deb"
1484
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1485
	</target>
1486

    
1487
	<target name="stylesheettest">
1488
		<xslt in="${input}" out="eml.html"
1489
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1490
			<param name="displaymodule" expression="${displaymodule}" />
1491
			<param name="docid" expression="${input}" />
1492
			<param name="entitytype" expression="${entitytype}" />
1493
			<param name="entityindex" expression="${entityindex}" />
1494
			<outputproperty name="method" value="html" />
1495
			<outputproperty name="standalone" value="yes" />
1496
			<outputproperty name="encoding" value="iso8859_1" />
1497
			<outputproperty name="indent" value="yes" />
1498
		</xslt>
1499
	</target>
1500

    
1501
	<target name="spatial_option" depends="prepare"
1502
		description=" -- compiles code for the spatial option">
1503

    
1504
		<echo message="Compiling the metatcat shapefile creator" />
1505
		<echo message="using the shapelib at: ${shapelib.dir}" />
1506
		<exec dir="." executable="g++" os="Linux, Unix"
1507
			failonerror="true">
1508
			<arg
1509
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1510
		</exec>
1511

    
1512
		<exec dir="." executable="g++" os="Linux, Unix"
1513
			failonerror="true">
1514
			<arg
1515
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1516
		</exec>
1517
	</target>
1518

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

    
1547
	<path id="lsid.classpath">
1548
		<fileset dir="${lsid.lib.dir}">
1549
			<patternset refid="lsid.jars" />
1550
		</fileset>
1551
		<fileset dir="${lib.dir}">
1552
			<patternset refid="lib.jars" />
1553
		</fileset>
1554
		<fileset dir="${build.dir}">
1555
			<include name="metacat-client.jar" />
1556
			<include name="metacat.jar" />
1557
		</fileset>
1558
	</path>
1559

    
1560
	<filterset id="configFilters">
1561
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1562
			value="${config.hostname}" / -->
1563
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1564
			value="${config.port}" / -->
1565
		<!-- MCD BYE filter token="METADATA_LABELS"
1566
			value="${config.metadataLabelLsid}" / -->
1567
		<!-- MCD BYE filter token="METACAT_SERVER"
1568
			value="${config.metacatserver}" / -->
1569
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1570
			value="${config.lsidauthority}" / -->
1571
	</filterset>
1572

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

    
1617
	<target name="compile-lsid" depends="prepare-lsid"
1618
		description="Compile Java sources">
1619
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1620
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1621
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1622
			deprecation="${compile.deprecation}"
1623
			optimize="${compile.optimize}">
1624
			<classpath refid="lsid.classpath" />
1625
		</javac>
1626
	</target>
1627

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

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