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: 2011-01-18 17:03:31 -0800 (Tue, 18 Jan 2011) $'
11
	*    '$Revision: 5815 $'
12
	*
13
	* Build file for the Ant cross-platform build system for metacat
14
	* See http://jakarta.apache.org for details on Ant
15
	*
16
	* usage: ant [compile|jar|install|jdoc]
17
	*
18
	* This program is free software; you can redistribute it and/or modify
19
	* it under the terms of the GNU General Public License as published by
20
	* the Free Software Foundation; either version 2 of the License, or
21
	* (at your option) any later version.
22
	*
23
	* This program is distributed in the hope that it will be useful,
24
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
	* GNU General Public License for more details.
27
	*
28
	* You should have received a copy of the GNU General Public License
29
	* along with this program; if not, write to the Free Software
30
	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31
-->
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
	<!-- Determine if dataone-service should be built-->
65
	<condition property="d1.available">
66
        <and>
67
	        <available file="${d1.dir}"/>
68
	        <available file="${maven.home}"/>
69
        </and>
70
	</condition>
71

    
72
	<available file="${build.tomcat.dir}/common/lib/servlet-api.jar" 
73
			property="tomcat.common.exists" />
74

    
75
	<target name="config" depends="setTomcatCommon, setTomcatNoCommon">
76
		<!-- usr for client testing, generally you don't need change-->
77
		<property name="mcuser"
78
			value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org" />
79
		<property name="mcpassword" value="kepler" />
80
		<property name="mcanotheruser"
81
			value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org" />
82
		<property name="mcanotherpassword" value="yourpass" />
83
		<property name="piscouser"
84
			value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org" />
85
		<property name="piscopassword" value="yourpass" />
86
		<property name="lteruser"
87
			value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org" />
88
		<property name="lterpassword" value="yourpass" />
89

    
90
		<property name="debug" value="on" />
91
		<property name="morphosourcedir" value="../morpho" />
92
		<property name="utilitiesdir" value="../utilities" />
93
		<property name="installdir"
94
			value="${app.deploy.dir}/${metacat.context}" />
95

    
96
		<echo>*********** set jsdk to ${jsdk}</echo>
97
	</target>
98
	
99
	<target name="setTomcatCommon" if="tomcat.common.exists" >
100
		<property name="jsdk"
101
			value="${build.tomcat.dir}/common/lib/servlet-api.jar" />
102
	</target>
103
	
104
	<target name="setTomcatNoCommon" unless="tomcat.common.exists" >
105
		<property name="jsdk"
106
			value="${build.tomcat.dir}/lib/servlet-api.jar" />
107
	</target>
108
	
109
	<target name="init" depends="config">
110
		<path id="compile.classpath">
111
			<pathelement location="${jsdk}" />
112
			<pathelement location="lib" />
113
			<fileset dir="lib">
114
				<include name="*.jar" />
115
			</fileset>
116
			<fileset dir="lib">
117
				<include name="xalan.jar" />
118
			</fileset>
119
			<fileset dir="lib/lsid_lib">
120
				<include name="*.jar" />
121
			</fileset>
122

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

    
130
			<!-- Include OAI-PMH -->
131
			<fileset dir="lib/oaipmh">
132
				<include name="*.jar" />
133
			</fileset>
134

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

    
151
			<!-- Include geoserver, geotools, et. al. -->
152
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
153
				<include name="*.jar" />
154
			</fileset>
155
			<pathelement
156
				location="lib/spatial/geoserver/WEB-INF/classes" />
157

    
158
			<!-- Include OAI-PMH -->
159
			<fileset dir="lib/oaipmh">
160
				<include name="*.jar" />
161
			</fileset>
162

    
163
		</path>
164

    
165
		<!-- It is less likely you'll need to make any changes from here down,
166
			but customization is possible -->
167
		<property name="name" value="metacat" />
168
		<property name="Name" value="MetaCat" />
169
		<property name="debugprefix" value="${Name}:" />
170
		<property name="release" value="${metacat.version}" />
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_1_0_RC1" />
181
		<property name="seek-tag" value="tags/ECOGRID_1_2_1" />
182
		<property name="eml-module" value="eml" />
183
		<property name="eml-version" value="2.0.0beta6" />
184
		<property name="eml-beta-tag"
185
			value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT" />
186
		<property name="eml2_0_0-schema-tag"
187
			value="RELEASE_EML_2_0_0_UPDATE_1" />
188
		<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
189
		<property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0" />
190
		<property name="eml2_1_1-schema-tag" value="RELEASE_EML_2_1_1_RC_2" />
191
		<property name="dataone-schema-tag" value="D1_SCHEMA_0_5_1" />
192
		<property name="eml2-style-tag" value="RELEASE_EML_UTILS_1_0_0_RC7" />
193
		<property name="eml2_0_0namespace"
194
			value="eml://ecoinformatics.org/eml-2.0.0" />
195
		<property name="eml2_0_1namespace"
196
			value="eml://ecoinformatics.org/eml-2.0.1" />
197
		<property name="eml2_1_0namespace"
198
			value="eml://ecoinformatics.org/eml-2.1.0" />
199
		<property name="eml2_1_1namespace"
200
			value="eml://ecoinformatics.org/eml-2.1.1" />
201
		<property name="stmmlnamespace"
202
			value="http://www.xml-cml.org/schema/stmml" />
203
		<property name="eml-css" value="eml_xsl.css" />
204
		<property name="eml-module.default.css" value="default.css" />
205
		<property name="systemidserver" value="" />
206
		<property name="html-path" value="" />
207

    
208

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

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

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

    
247
		<filter token="eml-version" value="${eml-version}" />
248
		<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}" />
249
		<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}" />
250
		<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}" />
251
		<filter token="eml2_1_1namespace" value="${eml2_1_1namespace}" />
252
		<filter token="stmmlnamespace" value="${stmmlnamespace}" />
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="InternationalizationTest" />
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="build.dir" value="./build" />
291
		<property name="build.src" value="${build.dir}/src" />
292
		<property name="build.dest" value="${build.dir}/classes" />
293
		<property name="build.samples" value="${build.dir}/samples" />
294
		<property name="build.tests" value="${build.dir}/tests" />
295
		<property name="build.tmp" value="${build.dir}/tmp" />
296
		<property name="build.metacattest"
297
			value="${build.tests}/metacattest" />
298
		<property name="build.metacatnettest"
299
			value="${build.tests}/metacatnettest" />
300
		<property name="build.data" value="${build.dir}/data" />
301
		<property name="build.javadocs" value="${build.dir}/docs/api" />
302
		<property name="build.war" value="${build.dir}/war" />
303
		<property name="dist.dir" value="dist" />
304
		<property name="ver.dir" value="${dist.dir}/${name}-${release}" />
305
		<property name="ver.src" value="${ver.dir}/src" />
306
		<property name="util.dir" value="${dist.dir}/${util-module}" />
307
		<property name="test.dir" value="${dist.dir}/test" />
308
		<!-- directories for creating a Harvest List Editor distribution -->
309
		<property name="dist.dir.hle" value="disthle" />
310
		<property name="ver.dir.hle"
311
			value="${dist.dir.hle}/harvest-list-editor-${release}" />
312
		<property name="pkg.dir" value="./package" />
313
		<property name="deb.pkg.dir" value="${pkg.dir}/debian" />
314

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

    
323
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
324

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

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

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

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

    
412
	</target>
413

    
414
	<target name="prepare" depends="init">
415
		<mkdir dir="${build.dir}" />
416
		<mkdir dir="${build.src}" />
417
		<mkdir dir="${build.dest}" />
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="dataone-service,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 **/stringclient/** **/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,getd1schemas"
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}/lib/httpclient.jar" todir="lib" />
476
		<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
477
	</target>
478

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

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

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

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

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

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

    
523
	<target name="harvester" depends="client"
524
		description="Compiles harvester java code to build dir">
525
		<javac srcdir="${build.src}" destdir="${build.dest}"
526
			includes="edu/ucsb/nceas/metacat/harvesterClient/*">
527
			<classpath>
528
				<path refid="compile.classpath" />
529
			</classpath>
530
		</javac>
531
	</target>
532

    
533
	<target name="harvesterjar" depends="harvester"
534
		description="Compiles and jars harvester java code to harvester.jar in build dir">
535
		<delete file="${build.dir}/harvester.jar" />
536
		<jar jarfile="${build.dir}/harvester.jar"
537
			basedir="${build.dest}" includes="**/metacat/harvesterClient/" />
538
	</target>
539

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

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

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

    
583
		<copy todir="${style-common-cvsrelpath}" filtering="yes">
584
			<fileset
585
				dir="${build.tmp}/eml_${eml-beta-tag}/style">
586
				<include name="**/*.xsl" />
587
			</fileset>
588
		</copy>
589
	</target>
590

    
591
	<target name="geteml2+" depends="prepare" if="eml.required"
592
		description="Checks eml-2 out of svn and copies schema and xsl to your metacat sandbox">
593
		<svn>
594
			<export srcUrl="${svn.eml200SchemaUrl}"
595
				destPath="${build.tmp}/eml_${eml2_0_0-schema-tag}" />
596
		</svn>
597
		<mkdir dir="lib/schema/eml-2.0.0" />
598
		<copy todir="lib/schema/eml-2.0.0" filtering="yes">
599
			<fileset
600
				dir="${build.tmp}/eml_${eml2_0_0-schema-tag}">
601
				<include name="*.xsd" />
602
			</fileset>
603

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

    
610
		</copy>
611
		<!-- <antcall target="copyxsl">
612
			<param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
613
			<param name="dirname" value="eml-2.0.0" />
614
			</antcall> -->
615

    
616
		<!-- Checkout eml201 for given schema tag-->
617
		<svn>
618
			<export srcUrl="${svn.eml201SchemaUrl}"
619
				destPath="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
620
		</svn>
621
		<mkdir dir="lib/schema/eml-2.0.1" />
622
		<copy todir="lib/schema/eml-2.0.1" filtering="yes">
623
			<fileset
624
				dir="${build.tmp}/eml_${eml2_0_1-schema-tag}">
625
				<include name="*.xsd" />
626
			</fileset>
627
		</copy>
628

    
629
		<!-- Checkout eml201 again for given style sheet tag-->
630
		<!-- echo>Enter CVS password: </echo>
631
			<cvs cvsRoot="${cvsroot}"
632
			package="${eml-module}"
633
			tag="${eml2_0_1-style-tag}"
634
			dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
635
			<antcall target="copyxsl">
636
			<param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
637
			<param name="dirname" value="eml-2.0.1" />
638
			</antcall -->
639

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

    
653
		<!-- Checkout eml210 for given style sheet tag-->
654
		<svn>
655
			<export srcUrl="${svn.eml2StyleUrl}"
656
				destPath="${build.tmp}/eml_${eml2-style-tag}" />
657
		</svn>
658
		<antcall target="copyxsl">
659
			<param name="cvs.tagname" value="${eml2-style-tag}" />
660
			<!-- param name="dirname" value="eml-2.1.0" / -->
661
			<param name="dirname" value="eml-2" />
662
		</antcall>
663
		
664
		<!-- Checkout eml210 for given schema tag-->
665
		<svn>
666
			<export srcUrl="${svn.eml211SchemaUrl}"
667
				destPath="${build.tmp}/eml_${eml2_1_1-schema-tag}" />
668
		</svn>
669
		<mkdir dir="lib/schema/eml-2.1.1" />
670
		<copy todir="lib/schema/eml-2.1.1" filtering="yes">
671
			<fileset
672
				dir="${build.tmp}/eml_${eml2_1_1-schema-tag}">
673
				<include name="*.xsd" />
674
			</fileset>
675
		</copy>
676
	</target>
677
	
678
	<!-- copies the dataone schemas from a local source if you don't want
679
	     to have to make a ton of svn calls when you're testing (see getd1schemas) -->
680
	<target name="install-dataone" depends="init">
681
	  <property name="dataone-shema-dir" value="../cicore/schemas"/>
682
	  <property name="install-dataone-schema-dir" value="${installdir}/schema/${dataone-schema-tag}"/>
683
	  <mkdir dir="${install-dataone-schema-dir}"/>
684
	  <copy todir="${install-dataone-schema-dir}">
685
	    <fileset dir="${dataone-shema-dir}">
686
	      <include name="**/*.xsd"/>
687
	    </fileset>
688
	  </copy>
689
	</target>
690

    
691
	<!-- get the dataone schemas from svn -->
692
	<target name="getd1schemas" depends="prepare" 
693
		description="Checkout dataone schemas from svn and copy to metacat sandbox">
694
		<delete dir="${build.tmp}/${dataone-schema-tag}"/>
695
        <svn>
696
            <export srcUrl="${svn.dataone-0.1-schema-url}"
697
                destPath="${build.tmp}/${dataone-schema-tag}" />
698
        </svn>
699
        <mkdir dir="lib/schema/${dataone-schema-tag}" />
700
        <copy todir="lib/schema/${dataone-schema-tag}" filtering="yes">
701
            <fileset dir="${build.tmp}/${dataone-schema-tag}">
702
                <include name="*.xsd" />
703
            </fileset>
704
        </copy>
705
    </target>
706

    
707
	<target name="copyxsl"
708
		description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
709

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

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

    
720

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

    
727
	</target>
728

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

    
744
	<target name="install-spatial" depends="jar,clientjar,harvesterjar"
745
		description="Installs spatial option for metacat">
746

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

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

    
760
		<!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
761
		<copy todir="${war.webinf}" filtering="no">
762
			<fileset dir="${spatial.geoserver.dir}/WEB-INF">
763
				<exclude name="lib/**" />
764
				<exclude name="web.xml" />
765
			</fileset>
766
		</copy>
767

    
768
		<!-- Copy the rest of the geoserver codebase into ${war.context} -->
769
		<copy todir="${war.context}" filtering="no">
770
			<fileset dir="${spatial.geoserver.dir}">
771
				<exclude name="WEB-INF/**" />
772
				<exclude name="index.jsp" />
773
			</fileset>
774
		</copy>
775

    
776
		<!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
777
		<copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
778
			tofile="${war.context}/geoserver.jsp" overwrite="true"
779
			filtering="no" />
780

    
781
		<!-- Copy the rest of the modified geoserver web-inf files
782
			<copy todir="${war.webinf}" filtering="no">
783
			<fileset dir="${spatial.webinf-mods}">
784
			<exclude name="web.xml.combined"/>
785
			</fileset>
786
			</copy> -->
787

    
788
	</target>
789

    
790
	<target name="install" depends="build-metacat"
791
		description="* Full Install For Development *">
792
		<copy file="${dist.dir}/${metacat.context}.war"
793
			todir="${app.deploy.dir}" />
794
               <!-- <copy file="${dist.dir}/${metacat.context}.war"
795
                        todir="${app.deploy.dir2}" />-->
796
		<delete dir="${app.deploy.dir}/${metacat.context}" />
797
		<!--<delete dir="${app.deploy.dir2}/${metacat.context}" />-->
798
		<tstamp>
799
			<format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa" />
800
		</tstamp>
801
		<echo>Dev install completed at ${NOW}</echo>
802
	</target>
803

    
804
	<target name="build-metacat" depends="install-ecogrid"
805
		description="Build Metacat">
806
	</target>
807

    
808
	<target name="install-ecogrid" depends="warPrepare, get-ecogrid"
809
		if="enable.ecogrid" description="Install Ecogrid Compentent">
810
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="clean"
811
			inheritall="false">
812
			<property name="context" value="${metacat.context}" />
813
			<property name="target" value="${ecogrid-target-name}" />
814
		</ant>
815
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="war"
816
			inheritall="false">
817
			<property name="context" value="${metacat.context}" />
818
			<property name="target" value="${ecogrid-target-name}" />
819
			<property name="metacat.dir" value="${basedir}"/>
820
		</ant>
821
		<!-- war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
822
			<webinf dir="${ecogrid-dir}/lib">
823
			<include name="server-config.wsdd"/>
824
			</webinf>
825
			</war -->
826
		<copy file="${ecogrid-dir}/build/${metacat.context}.war"
827
			todir="${dist.dir}" overwrite="true" />
828

    
829

    
830
	</target>
831

    
832
	<target name="get-ecogrid" depends="init"
833
		description="Check out ecogrid module" if="ecogrid.required">
834
		<svn>
835
			<export srcUrl="${svn.ecogridUrl}" force="true"
836
				destPath="${ecogrid-dir}" />
837
		</svn>
838
	</target>
839

    
840
	<!-- target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
841
		<ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
842
		<property name="context" value="${metacat.context}"/>
843
		<property name="target" value="${ecogrid-target-name}"/>
844
		<property name="metacat.dir" value="."/>
845
		<property name="hostname" value="${ecogrid.hostname}"/>
846
		<property name="port" value="${config.port}"/>
847
		</ant>
848
		</target -->
849

    
850
	<target name="clean-ecogrid-server-config-wsdd" depends="init"
851
		description="Automately generate wsdd for ecogrid service">
852
		<delete
853
			file="${app.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd" />
854
	</target>
855

    
856
	<target name="install-skin" depends="init"
857
		description="Install a Skin">
858

    
859
		<input message="Please enter name of the skin"
860
			addproperty="skin-name" />
861

    
862
		<mkdir dir="${installdir}/style/skins/${skin-name}" />
863
		<copy todir="${installdir}/style/skins/${skin-name}"
864
			filtering="yes">
865
			<fileset dir="lib/style/skins/${skin-name}">
866
				<exclude name="**/*.png" />
867
				<exclude name="**/*.gif" />
868
				<exclude name="**/*.jpg" />
869
				<exclude name="**/CVS*" />
870
				<exclude name="**/.#*" />
871
			</fileset>
872
		</copy>
873
		<copy todir="${installdir}/style/skins/${skin-name}"
874
			filtering="no">
875
			<fileset dir="lib/style/skins/${skin-name}">
876
				<include name="**/*.png" />
877
				<include name="**/*.gif" />
878
				<include name="**/*.jpg" />
879
				<exclude name="**/CVS*" />
880
				<exclude name="**/.#*" />
881
			</fileset>
882
		</copy>
883
		<copy todir="${installdir}/style/common" filtering="yes">
884
			<fileset dir="lib/style/common">
885
				<include name="*.js" />
886
				<include name="*.jsp" />
887
				<include name="*.css" />
888
				<exclude name="*.png" />
889
				<exclude name="*.gif" />
890
				<exclude name="*.jpg" />
891
				<exclude name="**/CVS*" />
892
				<exclude name="**/.#*" />
893
			</fileset>
894
		</copy>
895
		<!--
896
			<mkdir dir="${installdir}/style/skins/${skin-name}/images" />
897
			<copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
898
			<fileset dir="lib/style/skins/${skin-name}/images">
899
			<include name="*.png"/>
900
			<include name="*.gif"/>
901
			<include name="*.jpg"/>
902
			</fileset>
903
			</copy>
904
		-->
905

    
906
		<echo message="Install Skin completed." />
907
	</target>
908

    
909
	<target name="war" depends="warPrepare,install-spatial"
910
		description="Create a web archive (WAR) for servlet deployment">
911
		<mkdir dir="${dist.dir}" />
912
		<war destfile="${dist.dir}/${metacat.context}.war"
913
			webxml="${build.war}/web.xml">
914
			<fileset dir="${war.context}" />
915
			<lib dir="${war.lib}" />
916
			<webinf dir="${war.webinf}" />
917
		</war>
918
	</target>
919

    
920
	<target name="warPrepare"
921
		depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare"
922
		description="Prepare files for creating a web archive (WAR)">
923

    
924
		<property name="war.lib" value="${build.war}/lib" />
925
		<property name="war.webinf" value="${build.war}/WEB-INF" />
926
		<property name="war.context"
927
			value="${build.war}/${metacat.context}" />
928
		<property name="war.webinf.sql" value="${war.webinf}/sql" />
929
		<property name="war.webinf.scripts"
930
			value="${war.webinf}/scripts" />
931
		<property name="war.context.cgi" value="${war.context}/cgi-bin" />
932
		<property name="war.context.docs" value="${war.context}/docs" />
933
		<property name="war.context.temp" value="${war.context}/temp" />
934
		<property name="war.context.templates"
935
			value="${war.context}${style-common-relpath}/templates" />
936
		<mkdir dir="${war.lib}" />
937
		<mkdir dir="${war.webinf}" />
938
		<mkdir dir="${war.context}" />
939
		<mkdir dir="${war.webinf.sql}" />
940
		<mkdir dir="${war.context.cgi}" />
941
		<mkdir dir="${war.context.docs}" />
942
		<mkdir dir="${war.context.temp}" />
943
		<mkdir dir="${war.context.templates}" />
944

    
945
		<!--copy file="${lib.dir}/${jdbc.lib.postgres}" todir="${war.lib}" / -->
946
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver1}" todir="${war.lib}" / -->
947
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver2}" todir="${war.lib}" / -->
948
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver3}" todir="${war.lib}" / -->
949
		<copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
950
		<copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
951
		<copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
952
		<copy todir="${war.lib}" filtering="no">
953
			<fileset dir="lib">
954
				<!--
955
					<not>
956
					<filename name="${jdbc-jar-name}"/>
957
					</not>
958
				-->
959
				<include name="*.jar" />
960
				<exclude name="maven-ant-tasks*.jar" />
961
			</fileset>
962
			<fileset dir="lib">
963
				<include name="xalan.jar" />
964
				<include name="gwt*.jar" />
965
			</fileset>
966
			<fileset dir="lib/oaipmh">
967
				<include name="oaicat.jar" />
968
			</fileset>
969
		</copy>
970
		<!-- MCD copy file="lib/web.xml.${tomcatversion}"
971
			tofile="${build.war}/web.xml" / -->
972
		<!-- MCD added next - Remove the tomcat5 reference-->
973
		<copy file="lib/web.xml.tomcat5" tofile="${build.war}/web.xml" />
974
		<copy file="lib/metacat.properties" todir="${war.webinf}"
975
			filtering="yes" />
976
		<copy file="lib/metacat.properties.metadata.xml"
977
			todir="${war.webinf}" filtering="no" />
978
		<copy file="lib/org.properties.metadata.xml"
979
			todir="${war.webinf}" filtering="no" />
980
		<copy file="lib/auth.properties.metadata.xml"
981
			todir="${war.webinf}" filtering="no" />
982
		<copy todir="${war.webinf}" filtering="yes">
983
			<fileset dir="lib">
984
				<include name="skin.configs/**" />
985
			</fileset>
986
		</copy>
987
		<copy file="lib/log4j.properties" todir="${war.webinf}"
988
			filtering="yes" />
989
		<copy todir="${war.context}" filtering="no">
990
			<fileset dir="lib">
991
				<include name="**/*.jpg" />
992
				<include name="**/*.png" />
993
				<include name="**/*.gif" />
994
				<include name="LiveMap_30/**" />
995
				<include name="oaipmh/**" />
996
			</fileset>
997
		</copy>
998
		<copy todir="${war.context}" filtering="yes">
999
			<fileset dir="lib">
1000
				<exclude name="*.jar" />
1001
				<exclude name="*.properties" />
1002
				<exclude name="*.metadata.xml" />
1003
				<exclude name="web.xml" />
1004
				<exclude name="**/*.jpg" />
1005
				<exclude name="**/*.png" />
1006
				<exclude name="**/*.gif" />
1007
				<exclude name="lsid_lib/**" />
1008
				<exclude name="lsid_conf/**" />
1009
				<exclude name="LiveMap_30/**" />
1010
				<exclude name="oaipmh/**" />
1011
				<exclude name="skin.configs/**" />
1012
				<exclude name="spatial/geoserver/**" />
1013
				<exclude name="spatial/WEB-INF/**" />
1014
			</fileset>
1015
		</copy>
1016
		<copy todir="${war.context.docs}" filtering="yes">
1017
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1018
		</copy>
1019
		<copy todir="${war.context.docs}" filtering="no">
1020
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1021
		</copy>
1022
		<copy todir="${war.webinf.sql}" filtering="yes">
1023
			<fileset dir="src">
1024
				<include name="**/*.sql" />
1025
			</fileset>
1026
		</copy>
1027
		<copy todir="${war.webinf.scripts}" filtering="yes">
1028
			<fileset dir="src/scripts" />
1029
		</copy>
1030
		<copy todir="${war.webinf.scripts}"
1031
			file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
1032
			failonerror="false" />
1033

    
1034
		<copy file="src/perl/register-dataset.cgi"
1035
			todir="${war.context.cgi}" />
1036
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1037
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1038

    
1039
		<!-- registry cgi section -->
1040
		<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
1041
			used in readDocumentFromMetacat -->
1042
		<!-- TODO MCD copy temp files to actual location using config util?? -->
1043
		<copy todir="${war.context.temp}" filtering="yes">
1044
			<fileset dir="lib/style/common/emlb6toeml2">
1045
				<include name="*.xsl" />
1046
				<include name="*.xml" />
1047
			</fileset>
1048
		</copy>
1049
		<available file="lib/style/common/emlb6toeml2" type="dir"
1050
			property="styles.not.needed" />
1051

    
1052
		<!-- ldap cgi section -->
1053
		<copy todir="${war.context.templates}">
1054
			<fileset dir="lib/style/common/templates">
1055
				<!-- SCW: Copy all files -->
1056
			</fileset>
1057
		</copy>
1058
	</target>
1059

    
1060
	<target name="cgiPrepare" if="build.perl">
1061
		<exec dir="src/perl/Metacat/" executable="make">
1062
			<arg value="clean" />
1063
		</exec>
1064
		<exec dir="src/perl/Metacat/" executable="perl">
1065
			<arg value="Makefile.PL" />
1066
		</exec>
1067
		<exec dir="src/perl/Metacat/" executable="make" />
1068
	</target>
1069

    
1070
	<target name="testPrepare"
1071
		description="Copies test files into the war directories">
1072
		<echo>in testPrepare</echo>
1073
		<property name="war.context.test"
1074
			value="${build.war}/${metacat.context}/test" />
1075
		<mkdir dir="${war.context.test}" />
1076
		<copy todir="${war.context.test}" filtering="yes">
1077
			<fileset dir="test/servertestfiles">
1078
				<include name="*/**" />
1079
			</fileset>
1080
		</copy>
1081
	</target>
1082

    
1083
	<target name="getConversionXSL" depends="prepare"
1084
		unless="styles.not.needed"
1085
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1086

    
1087
		<svn>
1088
			<export srcUrl="${svn.eml2StyleUrl}"
1089
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1090
		</svn>
1091

    
1092
		<mkdir dir="lib/style/common/emlb6toeml2" />
1093
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1094
			<fileset
1095
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1096
				<include name="*.xsl" />
1097
				<include name="*.xml" />
1098
			</fileset>
1099
		</copy>
1100
	</target>
1101

    
1102
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1103
		<mkdir dir="${build.tests}" />
1104
		<copy todir="${build.tests}" encoding="UTF-8">
1105
			<fileset dir="${testdir}">
1106
				<include name="edu/**" />
1107
			</fileset>
1108
		</copy>
1109
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1110

    
1111
		<!-- copy and compile the tests into a jar file -->
1112
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1113
			debug="on" includes="**/*.java" encoding="UTF-8">
1114
			<classpath>
1115
				<path refid="compile.classpath" />
1116
				<fileset dir="${build.dir}">
1117
					<include name="${name}.jar" />
1118
					<include name="${name}-client.jar" />
1119
					<include name="harvester.jar" />
1120
				</fileset>
1121
			</classpath>
1122
		</javac>
1123

    
1124
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1125
			basedir="${build.tests}" includes="**/*.class" />
1126
	</target>
1127

    
1128
	<target name="test" depends="testprep"
1129
		description="Uses the ant junit task to run all JUnit tests">
1130

    
1131
		<!-- use the ant "junit" task to run JUnit tests. -->
1132
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1133
			haltonerror="no">
1134
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1135
			<classpath>
1136
				<path refid="test.classpath" />
1137
				<fileset dir="${build.dir}">
1138
					<include name="${name}.jar" />
1139
					<include name="${name}-client.jar" />
1140
					<include name="harvester.jar" />
1141
					<include name="${name}-junittests.jar" />
1142
				</fileset>
1143
			</classpath>
1144

    
1145
			<formatter type="plain" />
1146

    
1147
			<batchtest fork="yes" todir="${build.dir}">
1148
				<fileset dir="${build.tests}">
1149
					<include name="**/*.class" />
1150
					<exclude name="**/MCTestCase.class" />
1151
					<exclude name="**/ClientViewHelperTest.class" />
1152
				</fileset>
1153
			</batchtest>
1154
		</junit>
1155
	</target>
1156

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

    
1160
		<echo>testtorun: ${testtorun}</echo>
1161

    
1162
		<!-- use the ant "junit" task to run JUnit tests. -->
1163
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1164
			haltonerror="no" showoutput="yes">
1165
			<!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1166
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1167
			<classpath>
1168
				<path refid="test.classpath" />
1169
				<fileset dir="${build.dir}">
1170
					<include name="${name}.jar" />
1171
					<include name="${name}-client.jar" />
1172
					<include name="harvester.jar" />
1173
					<include name="${name}-junittests.jar" />
1174
				</fileset>
1175
			</classpath>
1176

    
1177
			<formatter type="plain" />
1178

    
1179
			<batchtest fork="yes" todir="${build.dir}">
1180
				<fileset dir="${build.tests}">
1181
					<include name="**/${testtorun}.class" />
1182
				</fileset>
1183
			</batchtest>
1184
		</junit>
1185
	</target>
1186

    
1187
	<target name="testharvester" depends="testprep"
1188
		description="Uses the ant junit task to test only the Harvester code">
1189
		<junit printsummary="yes" haltonfailure="off" fork="yes"
1190
			haltonerror="off">
1191
			<classpath>
1192
				<path refid="compile.classpath" />
1193
				<fileset dir="${build.dir}">
1194
					<include name="${name}.jar" />
1195
					<include name="${name}-client.jar" />
1196
					<include name="harvester.jar" />
1197
					<include name="${name}-junittests.jar" />
1198
				</fileset>
1199
			</classpath>
1200
			<formatter type="plain" />
1201
			<batchtest fork="yes" todir="${build.dir}">
1202
				<fileset dir="${build.tests}">
1203
					<include name="**/harvesterClient/*.class" />
1204
				</fileset>
1205
			</batchtest>
1206
		</junit>
1207
	</target>
1208

    
1209
	<target name="gethttpclient" depends="prepare"
1210
		description="checks out and compiles morpho httpclient code">
1211
		<!--mkdir dir="${morphosourcedir}" -->
1212
		<cvs cvsRoot="${cvsroot}" package="morpho" dest="." />
1213
		<ant dir="${morphosourcedir}" inheritAll="false" target="jar" />
1214
	</target>
1215

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

    
1220
		<echo>
1221
			*********************************** Please run ant
1222
			gethttpclient first! ***********************************
1223
		</echo>
1224
		<!-- copy and compile the tests into a jar file -->
1225
		<mkdir dir="${build.metacatnettest}" />
1226
		<javac srcdir="${junitnettestsdir}"
1227
			destdir="${build.metacatnettest}" includes="**/*.java">
1228
			<classpath>
1229
				<path refid="compile.classpath" />
1230
				<fileset dir="${build.dir}">
1231
					<include name="${name}.jar" />
1232
				</fileset>
1233
			</classpath>
1234
		</javac>
1235

    
1236
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1237
			basedir="${build.metacatnettest}" includes="**/*.class" />
1238

    
1239
		<!-- use the ant "junit" task to run JUnit tests. -->
1240
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1241
			haltonerror="no">
1242
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1243
			<classpath>
1244
				<path refid="compile.classpath" />
1245
				<fileset dir="${build.dir}">
1246
					<include name="${name}.jar" />
1247
					<include name="${name}-junitnettests.jar" />
1248
				</fileset>
1249
			</classpath>
1250

    
1251
			<formatter type="plain" />
1252

    
1253
			<batchtest fork="yes" todir="${build.dir}">
1254
				<fileset dir="${build.metacatnettest}">
1255
					<include name="**/*.class" />
1256
				</fileset>
1257
			</batchtest>
1258
		</junit>
1259
	</target>
1260

    
1261
	<target name="cleanweb" depends="clean"
1262
		description="deletes tomcat web context dir and all its contents">
1263
		<delete dir="${installdir}" />
1264
	</target>
1265

    
1266

    
1267
	<target name="clean" depends="init"
1268
		description="deletes build dir and files that can be regenerated form the release">
1269
		<delete dir="${build.dir}" />
1270
		<delete dir="${dist.dir}" />
1271
	</target>
1272

    
1273
	<target name="localclean" depends="clean"
1274
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1275
		<delete file="lib/httpclient.jar" />
1276
		<delete file="lib/utilities.jar" />
1277
	</target>
1278

    
1279
	<target name="fullclean" depends="localclean"
1280
		description="deletes code and eml">
1281
		<delete includeEmptyDirs="true" failonerror="false">
1282
			<fileset dir="${style-common-cvsrelpath}">
1283
				<include name="${eml-css}" />
1284
				<include name="eml-*/*.xsl" />
1285
				<include name="eml-*" />
1286
			</fileset>
1287
			<fileset dir="${schema-cvsrelpath}">
1288
				<include name="eml-*/*.xsd" />
1289
			</fileset>
1290
			<fileset dir="${ecogrid-dir}">
1291
				<include name="build.properties" />
1292
				<include name="buildfiles/metacatImpl.xml" />
1293
			</fileset>
1294
			<fileset dir="lib/style/common/emlb6toeml2"/>
1295
			<fileset dir="lib/dtd"/>
1296
			<fileset dir="lib/schema"/>
1297
		</delete>
1298
	</target>
1299

    
1300
	<target name="jdoc" depends="prepare"
1301
		description="generates javadoc documentation">
1302
		<javadoc packagenames="edu.ucsb.nceas.*"
1303
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1304
			version="true" use="true" windowtitle="${Name} API"
1305
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1306
			bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1307
			<classpath>
1308
				<path refid="compile.classpath" />
1309
			</classpath>
1310
		</javadoc>
1311
	</target>
1312

    
1313
	<target name="dist"
1314
		depends="geteml,getd1schemas,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1315
		description="prepares a full release distribution">
1316
		<mkdir dir="${dist.dir}" />
1317
		<delete dir="${ver.dir}" />
1318
		<mkdir dir="${ver.dir}" />
1319
		<copy todir="${ver.dir}">
1320
			<fileset dir="."
1321
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1322
		</copy>
1323
		<copy todir="${ver.dir}" file="build.xml" />
1324
		<copy todir="${ver.dir}" file="build.properties" />
1325

    
1326
		<copy todir="${ver.dir}/docs" filtering="yes">
1327
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1328
		</copy>
1329
		<copy todir="${ver.dir}/docs" filtering="no">
1330
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1331
		</copy>
1332
		<copy todir="${ver.dir}/docs/dev">
1333
			<fileset dir="${build.dir}/docs" />
1334
		</copy>
1335
		<copy todir="${ver.dir}/src">
1336
			<fileset dir="${build.dir}/src" />
1337
		</copy>
1338

    
1339
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1340
		<copy todir="${ver.dir}/test/servertestfiles">
1341
			<fileset dir="./test/servertestfiles" />
1342
		</copy>
1343
	</target>
1344

    
1345
	<target name="distbin" depends="build-metacat,war-lsid"
1346
		description="prepares a binary distribution">
1347
		<copy todir="${dist.dir}">
1348
			<fileset dir="./src/scripts" />
1349
		</copy>
1350
		<delete file="./${name}-bin-${release}.zip" />
1351
		<zip zipfile="./${name}-bin-${release}.zip"
1352
			basedir="${dist.dir}" excludes="metacat-*/**" />
1353
		<delete file="./${name}-bin-${release}.tar.gz" />
1354
		<tar tarfile="./${name}-bin-${release}.tar"
1355
			basedir="${dist.dir}" excludes="metacat-*/**" />
1356
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1357
			src="./${name}-bin-${release}.tar" />
1358
		<delete file="./${name}-bin-${release}.tar" />
1359
	</target>
1360

    
1361
	<target name="distsrc" depends="dist"
1362
		description="prepares a source distribution">
1363
		<mkdir dir="${ver.src}" />
1364
		<copy todir="${ver.src}">
1365
			<fileset dir="./src" />
1366
		</copy>
1367
		<mkdir dir="${util.dir}" />
1368
		<copy todir="${util.dir}">
1369
			<fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1370
		</copy>
1371

    
1372
		<mkdir dir="${ecogrid-dist-dir}" />
1373
		<copy todir="${ecogrid-dist-dir}">
1374
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1375
		</copy>
1376

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

    
1379
		<delete file="./${name}-src-${release}.zip" />
1380
		<zip zipfile="./${name}-src-${release}.zip"
1381
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1382
		<delete file="./${name}-src-${release}.tar.gz" />
1383
		<tar tarfile="./${name}-src-${release}.tar"
1384
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1385
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1386
			src="./${name}-src-${release}.tar" />
1387
		<delete file="./${name}-src-${release}.tar" />
1388
		<!--delete dir="${dist.dir}"/ -->
1389
	</target>
1390

    
1391
	<target name="deb-package" depends="distbin"
1392
		description="create a debian installation package">
1393
		<delete dir="${deb.pkg.dir}" />
1394
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1395
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1396
			<fileset dir="./src/scripts/debian"
1397
				includes="control postinst" />
1398
		</copy>
1399

    
1400
		<mkdir
1401
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1402
		<copy
1403
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1404
			filtering="yes">
1405
			<fileset dir="./src/scripts/debian"
1406
				excludes="control postinst" />
1407
		</copy>
1408
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1409

    
1410
		<copy file="${dist.dir}/knb.war"
1411
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1412
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1413
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1414

    
1415
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1416
			failonerror="true">
1417
			<arg line="--build debian" />
1418
		</exec>
1419

    
1420
		<move file="${pkg.dir}/debian.deb"
1421
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1422
	</target>
1423

    
1424
	<target name="stylesheettest">
1425
		<xslt in="${input}" out="eml.html"
1426
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1427
			<param name="displaymodule" expression="${displaymodule}" />
1428
			<param name="docid" expression="${input}" />
1429
			<param name="entitytype" expression="${entitytype}" />
1430
			<param name="entityindex" expression="${entityindex}" />
1431
			<outputproperty name="method" value="html" />
1432
			<outputproperty name="standalone" value="yes" />
1433
			<outputproperty name="encoding" value="iso8859_1" />
1434
			<outputproperty name="indent" value="yes" />
1435
		</xslt>
1436
	</target>
1437

    
1438

    
1439
	<target name="compilewebclient" depends="prepare">
1440
		<javac srcdir="${build.src}" destdir="${build.dest}"
1441
			includes="**/application/*.java" classpathref="webservicepath" />
1442
	</target>
1443

    
1444
	<target name="runwebclient" depends="compilewebclient">
1445
		<java
1446
			classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1447
			dir="${build.dest}" fork="yes" classpathref="webservicepath"
1448
			classpath="./lib/utilities.jar" failonerror="true">
1449
			<arg value="${serviceUrl}" />
1450
			<arg value="${docid}" />
1451
		</java>
1452
	</target>
1453

    
1454
	<target name="spatial_option" depends="prepare"
1455
		description=" -- compiles code for the spatial option">
1456

    
1457
		<echo message="Compiling the metatcat shapefile creator" />
1458
		<echo message="using the shapelib at: ${shapelib.dir}" />
1459
		<exec dir="." executable="g++" os="Linux, Unix"
1460
			failonerror="true">
1461
			<arg
1462
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1463
		</exec>
1464

    
1465
		<exec dir="." executable="g++" os="Linux, Unix"
1466
			failonerror="true">
1467
			<arg
1468
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1469
		</exec>
1470
	</target>
1471

    
1472
	<!-- LSID Authority support -->
1473
	<patternset id="lsid.jars">
1474
		<include name="axis.jar" />
1475
		<include name="commons-discovery-0.2.jar" />
1476
		<include name="jaxrpc.jar" />
1477
		<include name="lsid-client-1.1.1.jar" />
1478
		<include name="lsid-server-1.1.1.jar" />
1479
		<include name="saaj.jar" />
1480
		<include name="wsdl4j-1.5.1.jar" />
1481
		<include name="activation.jar" />
1482
		<include name="castor-0.9.5.jar" />
1483
		<include name="dnsjava-1.3.2.jar" />
1484
		<include name="mail.jar" />
1485
		<include name="commons-logging-1.0.4.jar" />
1486
		<!-- These jars may be needed but seem to not actually be,
1487
			so leaving them out for now
1488
			<include name="axis-ant.jar" />
1489
		-->
1490
		<!--<include name="GenCastor.class" />-->
1491
	</patternset>
1492
	<patternset id="lib.jars">
1493
		<include name="httpclient.jar" />
1494
		<include name="log4j-1.2.12.jar" />
1495
		<include name="utilities.jar" />
1496
		<include name="xercesImpl.jar" />
1497
		<include name="xalan.jar" />
1498
		<include name="xml-apis.jar" />
1499
	</patternset>
1500

    
1501
	<path id="lsid.classpath">
1502
		<fileset dir="${lsid.lib.dir}">
1503
			<patternset refid="lsid.jars" />
1504
		</fileset>
1505
		<fileset dir="${lib.dir}">
1506
			<patternset refid="lsid.jars" />
1507
		</fileset>
1508
		<fileset dir="${lib.dir}">
1509
			<include name="xalan.jar" />
1510
			<include name="xml-apis.jar" />
1511
		</fileset>
1512
		<fileset dir="${build.dir}">
1513
			<include name="metacat-client.jar" />
1514
		</fileset>
1515
	</path>
1516

    
1517
	<filterset id="configFilters">
1518
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1519
			value="${config.hostname}" / -->
1520
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1521
			value="${config.port}" / -->
1522
		<!-- MCD BYE filter token="METADATA_LABELS"
1523
			value="${config.metadataLabelLsid}" / -->
1524
		<!-- MCD BYE filter token="METACAT_SERVER"
1525
			value="${config.metacatserver}" / -->
1526
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1527
			value="${config.lsidauthority}" / -->
1528
	</filterset>
1529

    
1530
	<target name="prepare-lsid" depends="prepare,utilities,clientjar"
1531
		description="Configure files prior to compilation">
1532
		<mkdir dir="${lsid.build.dir}" />
1533
		<!-- Copy the properties file into the build -->
1534
		<copy file="${conf.dir}/metacat-lsid.properties"
1535
			tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1536
			overwrite="true">
1537
			<filterset refid="configFilters" />
1538
		</copy>
1539
		<copy file="${conf.dir}/log4j.properties"
1540
			tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1541
			overwrite="true">
1542
			<filterset refid="configFilters" />
1543
		</copy>
1544
		<!-- Copy config files into the build -->
1545
		<copy todir="${lsid.build.dir}/WEB-INF">
1546
			<fileset dir="${webinf.dir}" includes="**/*.wsdd" />
1547
		</copy>
1548
		<!-- Copy the metadata configuration files into the build -->
1549
		<mkdir
1550
			dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1551
		<copy
1552
			todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1553
			<fileset dir="${conf.dir}" includes="**/*.xml" />
1554
			<fileset dir="${conf.dir}" includes="**/*.xslt" />
1555
			<filterset refid="configFilters" />
1556
		</copy>
1557
		<!-- Copy services files into the build -->
1558
		<mkdir dir="${lsid.build.dir}/services" />
1559
		<copy todir="${lsid.build.dir}/services">
1560
			<fileset dir="${services.dir}" />
1561
			<filterset refid="configFilters" />
1562
		</copy>
1563
		<!-- Copy axis files into the build -->
1564
		<mkdir dir="${lsid.build.dir}" />
1565
		<copy todir="${lsid.build.dir}">
1566
			<fileset dir="${conf.dir}/axis" excludes="*.properties" />
1567
		</copy>
1568
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1569
		<copy todir="${lsid.build.dir}/WEB-INF/classes">
1570
			<fileset dir="${conf.dir}/axis" includes="*.properties" />
1571
		</copy>
1572
	</target>
1573

    
1574
	<target name="compile-lsid" depends="prepare-lsid"
1575
		description="Compile Java sources">
1576
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1577
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1578
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1579
			deprecation="${compile.deprecation}"
1580
			optimize="${compile.optimize}">
1581
			<classpath refid="lsid.classpath" />
1582
		</javac>
1583
	</target>
1584

    
1585
	<target name="war-lsid" depends="compile-lsid"
1586
		description="Create a war file for the application">
1587
		<mkdir dir="${dist.dir}" />
1588
		<war destfile="${dist.dir}/${authority.context}.war"
1589
			webxml="${webinf.dir}/web.xml">
1590
			<fileset dir="${lsid.build.dir}" />
1591
			<lib dir="${lsid.lib.dir}">
1592
				<patternset refid="lsid.jars" />
1593
			</lib>
1594
			<lib dir="${lib.dir}">
1595
				<patternset refid="lib.jars" />
1596
			</lib>
1597
			<lib dir="${lib.dir}">
1598
				<include name="xalan.jar" />
1599
				<include name="xml-apis.jar" />
1600
			</lib>
1601
			<lib dir="${build.dir}">
1602
				<include name="metacat-client.jar" />
1603
			</lib>
1604
		</war>
1605
	</target>
1606

    
1607
	<target name="deploy-lsid" depends="war-lsid"
1608
		description="Deploy LSID war to servlet container">
1609
		<delete dir="${app.deploy.dir}/${authority.context}" />
1610
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1611
		<mkdir dir="${app.deploy.dir}" />
1612
		<copy todir="${app.deploy.dir}">
1613
			<fileset dir="${dist.dir}" />
1614
		</copy>
1615
	</target>
1616

    
1617
    <!-- Build the dataone service, but only if it is checked out as a
1618
         sibling of the current build directory. Requires maven2 to
1619
         be installed and on the path. -->
1620
    <target name="dataone-service" if="d1.available">
1621
        <property name="d1.jar" value="dataone-service-api-0.3.0.jar"/>
1622

    
1623
        <artifact:mvn pom="${d1.dir}/pom.xml" fork="true"
1624
                      mavenHome="${maven.home}">
1625
            <arg value="install"/>
1626
        </artifact:mvn>
1627
		<copy file="${d1.dir}/target/${d1.jar}" todir="${lib.dir}" />
1628
    </target>
1629
</project>
(5-5/6)