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-14 12:11:27 -0800 (Fri, 14 Jan 2011) $'
11
	*    '$Revision: 5809 $'
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
	<!-- Determine if ecogrid should be installed-->
45
	<condition property="enable.ecogrid">
46
		<equals arg1="${install.ecogrid}" arg2="true" />
47
	</condition>
48

    
49
	<!-- Determine if perl should be built-->
50
	<condition property="build.perl">
51
		<equals arg1="${make.perl.code}" arg2="true" />
52
	</condition>
53

    
54
	<!-- Determine if dataone-service should be built-->
55
	<condition property="d1.available">
56
        <and>
57
	        <available file="${d1.dir}"/>
58
	        <available file="${maven.home}"/>
59
        </and>
60
	</condition>
61

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

    
65
	<target name="config" depends="setTomcatCommon, setTomcatNoCommon">
66
		<!-- usr for client testing, generally you don't need change-->
67
		<property name="mcuser"
68
			value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org" />
69
		<property name="mcpassword" value="kepler" />
70
		<property name="mcanotheruser"
71
			value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org" />
72
		<property name="mcanotherpassword" value="yourpass" />
73
		<property name="piscouser"
74
			value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org" />
75
		<property name="piscopassword" value="yourpass" />
76
		<property name="lteruser"
77
			value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org" />
78
		<property name="lterpassword" value="yourpass" />
79

    
80
		<property name="debug" value="on" />
81
		<property name="morphosourcedir" value="../morpho" />
82
		<property name="utilitiesdir" value="../utilities" />
83
		<property name="installdir"
84
			value="${app.deploy.dir}/${metacat.context}" />
85

    
86
		<echo>*********** set jsdk to ${jsdk}</echo>
87
	</target>
88
	
89
	<target name="setTomcatCommon" if="tomcat.common.exists" >
90
		<property name="jsdk"
91
			value="${build.tomcat.dir}/common/lib/servlet-api.jar" />
92
	</target>
93
	
94
	<target name="setTomcatNoCommon" unless="tomcat.common.exists" >
95
		<property name="jsdk"
96
			value="${build.tomcat.dir}/lib/servlet-api.jar" />
97
	</target>
98
	
99
	<target name="init" depends="config">
100
		<path id="compile.classpath">
101
			<pathelement location="${jsdk}" />
102
			<pathelement location="lib" />
103
			<fileset dir="lib">
104
				<include name="*.jar" />
105
			</fileset>
106
			<fileset dir="lib">
107
				<include name="xalan.jar" />
108
			</fileset>
109
			<fileset dir="lib/lsid_lib">
110
				<include name="*.jar" />
111
			</fileset>
112

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

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

    
125
		</path>
126
		
127
		<path id="test.classpath">
128
			<pathelement location="${jsdk}" />
129
			<pathelement location="lib" />
130
			<fileset dir="lib">
131
				<include name="*.jar" />
132
				<exclude name="maven-ant-tasks-2.1.0.jar" />
133
			</fileset>
134
			<fileset dir="lib">
135
				<include name="xalan.jar" />
136
			</fileset>
137
			<fileset dir="lib/lsid_lib">
138
				<include name="*.jar" />
139
			</fileset>
140

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

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

    
153
		</path>
154

    
155
		<!-- It is less likely you'll need to make any changes from here down,
156
			but customization is possible -->
157
		<property name="name" value="metacat" />
158
		<property name="Name" value="MetaCat" />
159
		<property name="debugprefix" value="${Name}:" />
160
		<property name="release" value="${metacat.version}" />
161
		<property name="style-common-relpath" value="/style/common" />
162
		<property name="style-shared-relpath" value="/style/shared" />
163
		<property name="schema-relpath" value="/schema" />
164
		<property name="style-common-cvsrelpath"
165
			value="lib${style-common-relpath}" />
166
		<property name="schema-cvsrelpath" value="lib${schema-relpath}" />
167
		<property name="style-skins-relpath" value="/style/skins" />
168
		<property name="util-module" value="utilities" />
169
		<!-- property name="utilities-tag" value="trunk" / -->
170
		<property name="utilities-tag" value="tags/UTILITIES_1_1_0_RC1" />
171
		<property name="seek-tag" value="tags/ECOGRID_1_2_1" />
172
		<property name="eml-module" value="eml" />
173
		<property name="eml-version" value="2.0.0beta6" />
174
		<property name="eml-beta-tag"
175
			value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT" />
176
		<property name="eml2_0_0-schema-tag"
177
			value="RELEASE_EML_2_0_0_UPDATE_1" />
178
		<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
179
		<property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0" />
180
		<property name="eml2_1_1-schema-tag" value="RELEASE_EML_2_1_1_RC_2" />
181
		<property name="dataone-schema-tag" value="D1_SCHEMA_0_5_1" />
182
		<property name="eml2-style-tag" value="RELEASE_EML_UTILS_1_0_0_RC7" />
183
		<property name="eml2_0_0namespace"
184
			value="eml://ecoinformatics.org/eml-2.0.0" />
185
		<property name="eml2_0_1namespace"
186
			value="eml://ecoinformatics.org/eml-2.0.1" />
187
		<property name="eml2_1_0namespace"
188
			value="eml://ecoinformatics.org/eml-2.1.0" />
189
		<property name="eml2_1_1namespace"
190
			value="eml://ecoinformatics.org/eml-2.1.1" />
191
		<property name="stmmlnamespace"
192
			value="http://www.xml-cml.org/schema/stmml" />
193
		<property name="eml-css" value="eml_xsl.css" />
194
		<property name="eml-module.default.css" value="default.css" />
195
		<property name="systemidserver" value="" />
196
		<property name="html-path" value="" />
197

    
198

    
199
		<!-- Config for registry variables -->
200
		<!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
201
		<property name="scope" value="obfs" />
202
		<property name="responseForm" value="genericResponse.tmpl" />
203
		<property name="entryForm" value="entryForm.tmpl" />
204
		<property name="guide" value="genericGuide.tmpl" />
205
		<property name="loginForm" value="loginForm.tmpl" />
206
		<property name="confirmData" value="confirmData.tmpl" />
207
		<property name="deleteData" value="deleteData.tmpl" />
208
		<property name="genericHeader" value="genericHeader.tmpl" />
209
		<property name="genericFooter" value="genericFooter.tmpl" />
210

    
211
		<filter token="scope" value="${scope}" />
212
		<filter token="responseForm" value="${responseForm}" />
213
		<filter token="entryForm" value="${entryForm}" />
214
		<filter token="guide" value="${guide}" />
215
		<filter token="loginForm" value="${loginForm}" />
216
		<filter token="confirmData" value="${confirmData}" />
217
		<filter token="deleteData" value="${deleteData}" />
218
		<filter token="genericHeader" value="${genericHeader}" />
219
		<filter token="genericFooter" value="${genericFooter}" />
220
		<filter token="adminname" value="${adminname}" />
221
		<filter token="recipient" value="${recipient}" />
222
		<filter token="metacatVersion" value="${metacat.version}" />
223
		<filter token="metacatRC" value="${metacat.releaseCandidate}" />
224
		<filter token="build.context" value="${metacat.context}" />
225

    
226
		<filter token="docrooturl" value="./" />
227
		<filter token="mcuser" value="${mcuser}" />
228
		<filter token="mcpassword" value="${mcpassword}" />
229
		<filter token="mcanotheruser" value="${mcanotheruser}" />
230
		<filter token="mcanotherpassword" value="${mcanotherpassword}" />
231
		<filter token="eml-css" value="${eml-css}" />
232
		<filter token="style-skins-relpath"
233
			value="${style-skins-relpath}" />
234
		<filter token="style-common-relpath"
235
			value="${style-common-relpath}" />
236

    
237
		<filter token="eml-version" value="${eml-version}" />
238
		<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}" />
239
		<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}" />
240
		<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}" />
241
		<filter token="eml2_1_1namespace" value="${eml2_1_1namespace}" />
242
		<filter token="stmmlnamespace" value="${stmmlnamespace}" />
243
		<filter token="debugprefix" value="${debugprefix}" />
244

    
245
		<filter token="defaultStage" value="${defaultStage}" />
246
		<filter token="defaultHeader" value="${defaultHeader}" />
247
		<filter token="defaultFooter" value="${defaultFooter}" />
248
		<filter token="defaultChangePass" value="${defaultChangePass}" />
249
		<filter token="defaultResetPass" value="${defaultResetPass}" />
250
		<filter token="changePassSuccess" value="${changePassSuccess}" />
251
		<filter token="resetPassSuccess" value="${resetPassSuccess}" />
252
		<filter token="registerFailed" value="${registerFailed}" />
253
		<filter token="registerLter" value="${registerLter}" />
254
		<filter token="registerMatch" value="${registerMatch}" />
255
		<filter token="registerSuccess" value="${registerSuccess}" />
256
		<filter token="register" value="${register}" />
257
		<filter token="searchResults" value="${searchResults}" />
258
		<filter token="ldapMainServerFailure"
259
			value="${ldapMainServerFailure}" />
260
		<filter token="lter-user" value="${lteruser}" />
261
		<filter token="lter-pass" value="${lterpassword}" />
262
		<filter token="pisco-user" value="${piscouser}" />
263
		<filter token="pisco-pass" value="${piscopassword}" />
264

    
265

    
266
		<!-- MCD BYE filter token="timedreplication"     value="${timedreplication}" / -->
267
		<!-- MCD BYE filter token="firsttimedreplication" value="${firsttimedreplication}" / -->
268
		<!-- MCD BYE filter token="timedreplicationinterval" value="${timedreplicationinterval}" / -->
269

    
270
		<property name="srcdir" value="./src" />
271
		<property name="lib.dir" value="./lib" />
272
		<property name="docdir" value="./docs" />
273
		<property name="cgidir" value="./cgi-bin" />
274
		<property name="testdir" value="./test" />
275
		<property name="testtorun" value="InternationalizationTest" />
276
		<property name="junittestsdir"
277
			value="./test/edu/ucsb/nceas/metacattest" />
278
		<property name="junitnettestsdir"
279
			value="./test/edu/ucsb/nceas/metacatnettest" />
280
		<property name="build.dir" value="./build" />
281
		<property name="build.src" value="${build.dir}/src" />
282
		<property name="build.dest" value="${build.dir}/classes" />
283
		<property name="build.samples" value="${build.dir}/samples" />
284
		<property name="build.tests" value="${build.dir}/tests" />
285
		<property name="build.tmp" value="${build.dir}/tmp" />
286
		<property name="build.metacattest"
287
			value="${build.tests}/metacattest" />
288
		<property name="build.metacatnettest"
289
			value="${build.tests}/metacatnettest" />
290
		<property name="build.data" value="${build.dir}/data" />
291
		<property name="build.javadocs" value="${build.dir}/docs/api" />
292
		<property name="build.war" value="${build.dir}/war" />
293
		<property name="dist.dir" value="dist" />
294
		<property name="ver.dir" value="${dist.dir}/${name}-${release}" />
295
		<property name="ver.src" value="${ver.dir}/src" />
296
		<property name="util.dir" value="${dist.dir}/${util-module}" />
297
		<property name="test.dir" value="${dist.dir}/test" />
298
		<!-- directories for creating a Harvest List Editor distribution -->
299
		<property name="dist.dir.hle" value="disthle" />
300
		<property name="ver.dir.hle"
301
			value="${dist.dir.hle}/harvest-list-editor-${release}" />
302
		<property name="pkg.dir" value="./package" />
303
		<property name="deb.pkg.dir" value="${pkg.dir}/debian" />
304

    
305
		<property name="ecogrid-target-name" value="metacatImpl" />
306
		<property name="ecogrid-module-dest-dir" value=".." />
307
		<property name="ecogrid-module" value="seek/projects/ecogrid" />
308
		<property name="ecogrid-dist-dir"
309
			value="${dist.dir}/${ecogrid-module}" />
310
		<property name="ecogrid-dir"
311
			value="${ecogrid-module-dest-dir}/${ecogrid-module}" />
312

    
313
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
314

    
315
		<!-- set up svn -->
316
		<property name="svnant.lib" value="lib" />
317
		<property name="svnant.jar" value="${svnant.lib}/svnant.jar" />
318
		<property name="svnClientAdapter.jar"
319
			value="${svnant.lib}/svnClientAdapter.jar" />
320
		<property name="svnjavahl.jar"
321
			value="${svnant.lib}/svnjavahl.jar" />
322
		<property name="svn.utilitiesUrl"
323
			value="https://code.ecoinformatics.org/code/utilities/${utilities-tag}" />
324
		<property name="svn.ecogridUrl"
325
			value="https://code.ecoinformatics.org/code/seek/${seek-tag}/projects/ecogrid/" />
326
		<property name="svn.emlBetaUrl"
327
			value="https://code.ecoinformatics.org/code/eml/branches/${eml-beta-tag}" />
328
		<property name="svn.eml200SchemaUrl"
329
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_0-schema-tag}" />
330
		<property name="svn.eml201SchemaUrl"
331
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_1-schema-tag}" />
332
		<property name="svn.eml210SchemaUrl"
333
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_0-schema-tag}" />
334
		<property name="svn.eml211SchemaUrl"
335
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_1-schema-tag}" />
336
		<property name="svn.dataone-0.1-schema-url"
337
			value="https://repository.dataone.org/software/cicore/tags/${dataone-schema-tag}" />
338
		<property name="svn.eml2StyleUrl"
339
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2-style-tag}" />
340

    
341
		<!-- load the svn task -->
342
		<path id="svn.classpath">
343
			<pathelement location="${svnjavahl.jar}" />
344
			<pathelement location="${svnant.jar}" />
345
			<pathelement location="${svnClientAdapter.jar}" />
346
		</path>
347
		<taskdef resource="svntask.properties"
348
			classpathref="svn.classpath" />
349

    
350
		<condition property="utilities.required">
351
			<or>
352
				<not>
353
					<available file="lib/httpclient.jar" />
354
				</not>
355
				<not>
356
					<available file="lib/utilities.jar" />
357
				</not>
358
				<not>
359
					<available file="${utilitiesdir}" type="dir" />
360
				</not>
361
			</or>
362
		</condition>
363
		<!-- peer.utilities.required is used when there is no utilities 
364
			directory at ${utilitiesdir} -->
365
		<condition property="peer.utilities.required">
366
			<or>
367
				<not>
368
					<available file="${utilitiesdir}" type="dir" />
369
				</not>
370
			</or>
371
		</condition>
372
		<condition property="eml.required">
373
			<or>
374
				<not>
375
					<available file="lib/schema/eml-2.0.1/eml.xsd" />
376
				</not>
377
				<not>
378
					<available file="lib/schema/eml-2.0.0/eml.xsd" />
379
				</not>
380
				<not>
381
					<available file="lib/schema/eml-2.1.0/eml.xsd" />
382
				</not>
383
				<not>
384
					<available
385
						file="lib/dtd/eml-dataset-2.0.0beta6.dtd" />
386
				</not>
387
			</or>
388
		</condition>
389

    
390
		<condition property="ecogrid.required">
391
			<or>
392
				<not>
393
					<available file="${ecogrid-dir}/build.properties" />
394
				</not>
395
				<not>
396
					<available
397
						file="${ecogrid-dir}/buildfiles/metacatImpl.xml" />
398
				</not>
399
			</or>
400
		</condition>
401

    
402
	</target>
403

    
404
	<target name="prepare" depends="init">
405
		<mkdir dir="${build.dir}" />
406
		<mkdir dir="${build.src}" />
407
		<mkdir dir="${build.dest}" />
408
		<mkdir dir="${build.javadocs}" />
409
		<mkdir dir="${build.tmp}" />
410

    
411
		<copy todir="${build.src}" filtering="yes">
412
			<fileset dir="${srcdir}">
413
				<include name="edu/**" />
414
				<include name="com/**" />
415
				<include name="org/**" />
416
				<!-- include name="java/**" / -->
417
				<include name="**/*.sql" />
418
				<exclude name="**/CVS*" />
419
				<exclude name="**/.#*" />
420
				<exclude name="edu/ucsb/nceas/workflowscheduler/**" />
421
			</fileset>
422
		</copy>
423
		<available file="lib/style/common/emlb6toeml2" type="dir"
424
			property="styles.not.needed" />
425
	</target>
426

    
427
	<taskdef resource="axis-tasks.properties"
428
		classpathref="compile.classpath" />
429

    
430
	<target name="generateStubs" depends="prepare">
431
		<echo
432
			message=" Generating stubs for execution service from ${/tmp/KeplerWebService.wsdl}" />
433
		<axis-wsdl2java verbose="true" output="${srcdir}"
434
			url="/tmp/KeplerWebService.wsdl" />
435
	</target>
436

    
437
	<target name="compile" depends="dataone-service,prepare,utilities"
438
		description="Compiles java code to build dir, and copies metacat props files there">
439

    
440
		<javac srcdir="${build.src}" destdir="${build.dest}"
441
			debug="${debug}"
442
			excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
443
			<classpath>
444
				<path refid="compile.classpath" />
445
			</classpath>
446
		</javac>
447
	</target>
448

    
449
	<target name="jar" depends="compile,geteml,getd1schemas"
450
		description="Compiles and jars metacat java code to metacat.jar in build dir ">
451

    
452
		<delete file="${build.dir}/${name}.jar" />
453
		<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
454
			excludes="**/protocols/ **/harvesterClient/" />
455
	</target>
456

    
457
	<target name="protocol" depends="compile"
458
		description="Compiles and jars protocol java code to protocol.jar in build dir">
459
		<delete file="${build.dir}/protocol.jar" />
460
		<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
461
			includes="**/protocols/" />
462
	</target>
463

    
464
	<target name="utilities" depends="config,getpeerutilities"
465
		if="utilities.required">
466
		<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
467
		<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
468
		<copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
469
		<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
470
	</target>
471

    
472
	<target name="getpeerutilities" depends="prepare"
473
		if="peer.utilities.required"
474
		description="Checks utilities out of svn and copies it to your utilitiesdir if it does not already exist">
475
		<echo message="Exporting utilities files from svn repository:" />
476
		<svn>
477
			<export srcUrl="${svn.utilitiesUrl}"
478
				destPath="${utilitiesdir}" />
479
		</svn>
480

    
481
		<!--  ant dir="${utilitiesdir}" inheritAll="false"  target="dist" / -->
482
	</target>
483

    
484
	<target name="getutilities" depends="prepare"
485
		description="Checks utility out of svn and copies it to your metacat sandbox">
486
		<svn>
487
			<export srcUrl="${svn.utilitiesUrl}"
488
				destPath="${utilitiesdir}" />
489
		</svn>
490
	</target>
491

    
492
	<target name="client" depends="utilities, prepare"
493
		description="Compiles metacat-client java code to build dir">
494
		<javac srcdir="${build.src}" destdir="${build.dest}"
495
			includes="edu/ucsb/nceas/metacat/client/*">
496
			<classpath>
497
				<path refid="compile.classpath" />
498
			</classpath>
499
		</javac>
500
	</target>
501

    
502
	<target name="clientjar" depends="client"
503
		description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
504
		<delete file="${build.dir}/${name}-client.jar" />
505
		<jar jarfile="${build.dir}/${name}-client.jar"
506
			basedir="${build.dest}" includes="**/metacat/client/" />
507
	</target>
508

    
509
	<target name="advancedsearchjar" depends="compile"
510
		description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
511
		<delete file="${build.dir}/advancedsearch.jar" />
512
		<jar jarfile="${build.dir}/advancedsearch.jar"
513
			basedir="${build.dest}" includes="**/metacat/advancedsearch/" />
514
	</target>
515

    
516
	<target name="harvester" depends="client"
517
		description="Compiles harvester java code to build dir">
518
		<javac srcdir="${build.src}" destdir="${build.dest}"
519
			includes="edu/ucsb/nceas/metacat/harvesterClient/*">
520
			<classpath>
521
				<path refid="compile.classpath" />
522
			</classpath>
523
		</javac>
524
	</target>
525

    
526
	<target name="harvesterjar" depends="harvester"
527
		description="Compiles and jars harvester java code to harvester.jar in build dir">
528
		<delete file="${build.dir}/harvester.jar" />
529
		<jar jarfile="${build.dir}/harvester.jar"
530
			basedir="${build.dest}" includes="**/metacat/harvesterClient/" />
531
	</target>
532

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

    
557
	<target name="geteml" depends="getemlpre2,geteml2+,getConversionXSL"
558
		if="eml.required" description="Calls getemlpre2 and geteml2+ targets" />
559

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

    
576
		<copy todir="${style-common-cvsrelpath}" filtering="yes">
577
			<fileset
578
				dir="${build.tmp}/eml_${eml-beta-tag}/style">
579
				<include name="**/*.xsl" />
580
			</fileset>
581
		</copy>
582
	</target>
583

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

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

    
603
		</copy>
604
		<!-- <antcall target="copyxsl">
605
			<param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
606
			<param name="dirname" value="eml-2.0.0" />
607
			</antcall> -->
608

    
609
		<!-- Checkout eml201 for given schema tag-->
610
		<svn>
611
			<export srcUrl="${svn.eml201SchemaUrl}"
612
				destPath="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
613
		</svn>
614
		<mkdir dir="lib/schema/eml-2.0.1" />
615
		<copy todir="lib/schema/eml-2.0.1" filtering="yes">
616
			<fileset
617
				dir="${build.tmp}/eml_${eml2_0_1-schema-tag}">
618
				<include name="*.xsd" />
619
			</fileset>
620
		</copy>
621

    
622
		<!-- Checkout eml201 again for given style sheet tag-->
623
		<!-- echo>Enter CVS password: </echo>
624
			<cvs cvsRoot="${cvsroot}"
625
			package="${eml-module}"
626
			tag="${eml2_0_1-style-tag}"
627
			dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
628
			<antcall target="copyxsl">
629
			<param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
630
			<param name="dirname" value="eml-2.0.1" />
631
			</antcall -->
632

    
633
		<!-- Checkout eml210 for given schema tag-->
634
		<svn>
635
			<export srcUrl="${svn.eml210SchemaUrl}"
636
				destPath="${build.tmp}/eml_${eml2_1_0-schema-tag}" />
637
		</svn>
638
		<mkdir dir="lib/schema/eml-2.1.0" />
639
		<copy todir="lib/schema/eml-2.1.0" filtering="yes">
640
			<fileset
641
				dir="${build.tmp}/eml_${eml2_1_0-schema-tag}">
642
				<include name="*.xsd" />
643
			</fileset>
644
		</copy>
645

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

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

    
700
	<target name="copyxsl"
701
		description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
702

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

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

    
713

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

    
720
	</target>
721

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

    
737
	<target name="install-spatial" depends="jar,clientjar,harvesterjar"
738
		description="Installs spatial option for metacat">
739

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

    
746
		<!-- Copy geoserver libs into ${war.lib} -->
747
		<copy todir="${war.lib}" filtering="no">
748
			<fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
749
				<include name="**" />
750
			</fileset>
751
		</copy>
752

    
753
		<!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
754
		<copy todir="${war.webinf}" filtering="no">
755
			<fileset dir="${spatial.geoserver.dir}/WEB-INF">
756
				<exclude name="lib/**" />
757
				<exclude name="web.xml" />
758
			</fileset>
759
		</copy>
760

    
761
		<!-- Copy the rest of the geoserver codebase into ${war.context} -->
762
		<copy todir="${war.context}" filtering="no">
763
			<fileset dir="${spatial.geoserver.dir}">
764
				<exclude name="WEB-INF/**" />
765
				<exclude name="index.jsp" />
766
			</fileset>
767
		</copy>
768

    
769
		<!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
770
		<copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
771
			tofile="${war.context}/geoserver.jsp" overwrite="true"
772
			filtering="no" />
773

    
774
		<!-- Copy the rest of the modified geoserver web-inf files
775
			<copy todir="${war.webinf}" filtering="no">
776
			<fileset dir="${spatial.webinf-mods}">
777
			<exclude name="web.xml.combined"/>
778
			</fileset>
779
			</copy> -->
780

    
781
	</target>
782

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

    
797
	<target name="build-metacat" depends="install-ecogrid"
798
		description="Build Metacat">
799
	</target>
800

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

    
822

    
823
	</target>
824

    
825
	<target name="get-ecogrid" depends="init"
826
		description="Check out ecogrid module" if="ecogrid.required">
827
		<svn>
828
			<export srcUrl="${svn.ecogridUrl}" force="true"
829
				destPath="${ecogrid-dir}" />
830
		</svn>
831
	</target>
832

    
833
	<!-- target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
834
		<ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
835
		<property name="context" value="${metacat.context}"/>
836
		<property name="target" value="${ecogrid-target-name}"/>
837
		<property name="metacat.dir" value="."/>
838
		<property name="hostname" value="${ecogrid.hostname}"/>
839
		<property name="port" value="${config.port}"/>
840
		</ant>
841
		</target -->
842

    
843
	<target name="clean-ecogrid-server-config-wsdd" depends="init"
844
		description="Automately generate wsdd for ecogrid service">
845
		<delete
846
			file="${app.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd" />
847
	</target>
848

    
849
	<target name="install-skin" depends="init"
850
		description="Install a Skin">
851

    
852
		<input message="Please enter name of the skin"
853
			addproperty="skin-name" />
854

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

    
899
		<echo message="Install Skin completed." />
900
	</target>
901

    
902
	<target name="war" depends="warPrepare,install-spatial"
903
		description="Create a web archive (WAR) for servlet deployment">
904
		<mkdir dir="${dist.dir}" />
905
		<war destfile="${dist.dir}/${metacat.context}.war"
906
			webxml="${build.war}/web.xml">
907
			<fileset dir="${war.context}" />
908
			<lib dir="${war.lib}" />
909
			<webinf dir="${war.webinf}" />
910
		</war>
911
	</target>
912

    
913
	<target name="warPrepare"
914
		depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare"
915
		description="Prepare files for creating a web archive (WAR)">
916

    
917
		<property name="war.lib" value="${build.war}/lib" />
918
		<property name="war.webinf" value="${build.war}/WEB-INF" />
919
		<property name="war.context"
920
			value="${build.war}/${metacat.context}" />
921
		<property name="war.webinf.sql" value="${war.webinf}/sql" />
922
		<property name="war.webinf.scripts"
923
			value="${war.webinf}/scripts" />
924
		<property name="war.context.cgi" value="${war.context}/cgi-bin" />
925
		<property name="war.context.docs" value="${war.context}/docs" />
926
		<property name="war.context.temp" value="${war.context}/temp" />
927
		<property name="war.context.templates"
928
			value="${war.context}${style-common-relpath}/templates" />
929
		<mkdir dir="${war.lib}" />
930
		<mkdir dir="${war.webinf}" />
931
		<mkdir dir="${war.context}" />
932
		<mkdir dir="${war.webinf.sql}" />
933
		<mkdir dir="${war.context.cgi}" />
934
		<mkdir dir="${war.context.docs}" />
935
		<mkdir dir="${war.context.temp}" />
936
		<mkdir dir="${war.context.templates}" />
937

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

    
1027
		<copy file="src/perl/register-dataset.cgi"
1028
			todir="${war.context.cgi}" />
1029
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1030
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1031

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

    
1045
		<!-- ldap cgi section -->
1046
		<copy todir="${war.context.templates}">
1047
			<fileset dir="lib/style/common/templates">
1048
				<!-- SCW: Copy all files -->
1049
			</fileset>
1050
		</copy>
1051
	</target>
1052

    
1053
	<target name="cgiPrepare" if="build.perl">
1054
		<exec dir="src/perl/Metacat/" executable="make">
1055
			<arg value="clean" />
1056
		</exec>
1057
		<exec dir="src/perl/Metacat/" executable="perl">
1058
			<arg value="Makefile.PL" />
1059
		</exec>
1060
		<exec dir="src/perl/Metacat/" executable="make" />
1061
	</target>
1062

    
1063
	<target name="testPrepare"
1064
		description="Copies test files into the war directories">
1065
		<echo>in testPrepare</echo>
1066
		<property name="war.context.test"
1067
			value="${build.war}/${metacat.context}/test" />
1068
		<mkdir dir="${war.context.test}" />
1069
		<copy todir="${war.context.test}" filtering="yes">
1070
			<fileset dir="test/servertestfiles">
1071
				<include name="*/**" />
1072
			</fileset>
1073
		</copy>
1074
	</target>
1075

    
1076
	<target name="getConversionXSL" depends="prepare"
1077
		unless="styles.not.needed"
1078
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1079

    
1080
		<svn>
1081
			<export srcUrl="${svn.eml2StyleUrl}"
1082
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1083
		</svn>
1084

    
1085
		<mkdir dir="lib/style/common/emlb6toeml2" />
1086
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1087
			<fileset
1088
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1089
				<include name="*.xsl" />
1090
				<include name="*.xml" />
1091
			</fileset>
1092
		</copy>
1093
	</target>
1094

    
1095
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1096
		<mkdir dir="${build.tests}" />
1097
		<copy todir="${build.tests}" encoding="UTF-8">
1098
			<fileset dir="${testdir}">
1099
				<include name="edu/**" />
1100
			</fileset>
1101
		</copy>
1102
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1103

    
1104
		<!-- copy and compile the tests into a jar file -->
1105
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1106
			debug="on" includes="**/*.java" encoding="UTF-8">
1107
			<classpath>
1108
				<path refid="compile.classpath" />
1109
				<fileset dir="${build.dir}">
1110
					<include name="${name}.jar" />
1111
					<include name="${name}-client.jar" />
1112
					<include name="harvester.jar" />
1113
				</fileset>
1114
			</classpath>
1115
		</javac>
1116

    
1117
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1118
			basedir="${build.tests}" includes="**/*.class" />
1119
	</target>
1120

    
1121
	<target name="test" depends="testprep"
1122
		description="Uses the ant junit task to run all JUnit tests">
1123

    
1124
		<!-- use the ant "junit" task to run JUnit tests. -->
1125
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1126
			haltonerror="no">
1127
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1128
			<classpath>
1129
				<path refid="test.classpath" />
1130
				<fileset dir="${build.dir}">
1131
					<include name="${name}.jar" />
1132
					<include name="${name}-client.jar" />
1133
					<include name="harvester.jar" />
1134
					<include name="${name}-junittests.jar" />
1135
				</fileset>
1136
			</classpath>
1137

    
1138
			<formatter type="plain" />
1139

    
1140
			<batchtest fork="yes" todir="${build.dir}">
1141
				<fileset dir="${build.tests}">
1142
					<include name="**/*.class" />
1143
					<exclude name="**/MCTestCase.class" />
1144
					<exclude name="**/ClientViewHelperTest.class" />
1145
				</fileset>
1146
			</batchtest>
1147
		</junit>
1148
	</target>
1149

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

    
1153
		<echo>testtorun: ${testtorun}</echo>
1154

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

    
1170
			<formatter type="plain" />
1171

    
1172
			<batchtest fork="yes" todir="${build.dir}">
1173
				<fileset dir="${build.tests}">
1174
					<include name="**/${testtorun}.class" />
1175
				</fileset>
1176
			</batchtest>
1177
		</junit>
1178
	</target>
1179

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

    
1202
	<target name="gethttpclient" depends="prepare"
1203
		description="checks out and compiles morpho httpclient code">
1204
		<!--mkdir dir="${morphosourcedir}" -->
1205
		<cvs cvsRoot="${cvsroot}" package="morpho" dest="." />
1206
		<ant dir="${morphosourcedir}" inheritAll="false" target="jar" />
1207
	</target>
1208

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

    
1213
		<echo>
1214
			*********************************** Please run ant
1215
			gethttpclient first! ***********************************
1216
		</echo>
1217
		<!-- copy and compile the tests into a jar file -->
1218
		<mkdir dir="${build.metacatnettest}" />
1219
		<javac srcdir="${junitnettestsdir}"
1220
			destdir="${build.metacatnettest}" includes="**/*.java">
1221
			<classpath>
1222
				<path refid="compile.classpath" />
1223
				<fileset dir="${build.dir}">
1224
					<include name="${name}.jar" />
1225
				</fileset>
1226
			</classpath>
1227
		</javac>
1228

    
1229
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1230
			basedir="${build.metacatnettest}" includes="**/*.class" />
1231

    
1232
		<!-- use the ant "junit" task to run JUnit tests. -->
1233
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1234
			haltonerror="no">
1235
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1236
			<classpath>
1237
				<path refid="compile.classpath" />
1238
				<fileset dir="${build.dir}">
1239
					<include name="${name}.jar" />
1240
					<include name="${name}-junitnettests.jar" />
1241
				</fileset>
1242
			</classpath>
1243

    
1244
			<formatter type="plain" />
1245

    
1246
			<batchtest fork="yes" todir="${build.dir}">
1247
				<fileset dir="${build.metacatnettest}">
1248
					<include name="**/*.class" />
1249
				</fileset>
1250
			</batchtest>
1251
		</junit>
1252
	</target>
1253

    
1254
	<target name="cleanweb" depends="clean"
1255
		description="deletes tomcat web context dir and all its contents">
1256
		<delete dir="${installdir}" />
1257
	</target>
1258

    
1259

    
1260
	<target name="clean" depends="init"
1261
		description="deletes build dir and files that can be regenerated form the release">
1262
		<delete dir="${build.dir}" />
1263
		<delete dir="${dist.dir}" />
1264
	</target>
1265

    
1266
	<target name="localclean" depends="clean"
1267
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1268
		<delete file="lib/httpclient.jar" />
1269
		<delete file="lib/utilities.jar" />
1270
	</target>
1271

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

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

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

    
1319
		<copy todir="${ver.dir}/docs" filtering="yes">
1320
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1321
		</copy>
1322
		<copy todir="${ver.dir}/docs" filtering="no">
1323
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1324
		</copy>
1325
		<copy todir="${ver.dir}/docs/dev">
1326
			<fileset dir="${build.dir}/docs" />
1327
		</copy>
1328
		<copy todir="${ver.dir}/src">
1329
			<fileset dir="${build.dir}/src" />
1330
		</copy>
1331

    
1332
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1333
		<copy todir="${ver.dir}/test/servertestfiles">
1334
			<fileset dir="./test/servertestfiles" />
1335
		</copy>
1336
	</target>
1337

    
1338
	<target name="distbin" depends="build-metacat,war-lsid"
1339
		description="prepares a binary distribution">
1340
		<copy todir="${dist.dir}">
1341
			<fileset dir="./src/scripts" />
1342
		</copy>
1343
		<delete file="./${name}-bin-${release}.zip" />
1344
		<zip zipfile="./${name}-bin-${release}.zip"
1345
			basedir="${dist.dir}" excludes="metacat-*/**" />
1346
		<delete file="./${name}-bin-${release}.tar.gz" />
1347
		<tar tarfile="./${name}-bin-${release}.tar"
1348
			basedir="${dist.dir}" excludes="metacat-*/**" />
1349
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1350
			src="./${name}-bin-${release}.tar" />
1351
		<delete file="./${name}-bin-${release}.tar" />
1352
	</target>
1353

    
1354
	<target name="distsrc" depends="dist"
1355
		description="prepares a source distribution">
1356
		<mkdir dir="${ver.src}" />
1357
		<copy todir="${ver.src}">
1358
			<fileset dir="./src" />
1359
		</copy>
1360
		<mkdir dir="${util.dir}" />
1361
		<copy todir="${util.dir}">
1362
			<fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1363
		</copy>
1364

    
1365
		<mkdir dir="${ecogrid-dist-dir}" />
1366
		<copy todir="${ecogrid-dist-dir}">
1367
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1368
		</copy>
1369

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

    
1372
		<delete file="./${name}-src-${release}.zip" />
1373
		<zip zipfile="./${name}-src-${release}.zip"
1374
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1375
		<delete file="./${name}-src-${release}.tar.gz" />
1376
		<tar tarfile="./${name}-src-${release}.tar"
1377
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1378
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1379
			src="./${name}-src-${release}.tar" />
1380
		<delete file="./${name}-src-${release}.tar" />
1381
		<!--delete dir="${dist.dir}"/ -->
1382
	</target>
1383

    
1384
	<target name="deb-package" depends="distbin"
1385
		description="create a debian installation package">
1386
		<delete dir="${deb.pkg.dir}" />
1387
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1388
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1389
			<fileset dir="./src/scripts/debian"
1390
				includes="control postinst" />
1391
		</copy>
1392

    
1393
		<mkdir
1394
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1395
		<copy
1396
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1397
			filtering="yes">
1398
			<fileset dir="./src/scripts/debian"
1399
				excludes="control postinst" />
1400
		</copy>
1401
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1402

    
1403
		<copy file="${dist.dir}/knb.war"
1404
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1405
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1406
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1407

    
1408
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1409
			failonerror="true">
1410
			<arg line="--build debian" />
1411
		</exec>
1412

    
1413
		<move file="${pkg.dir}/debian.deb"
1414
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1415
	</target>
1416

    
1417
	<target name="stylesheettest">
1418
		<xslt in="${input}" out="eml.html"
1419
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1420
			<param name="displaymodule" expression="${displaymodule}" />
1421
			<param name="docid" expression="${input}" />
1422
			<param name="entitytype" expression="${entitytype}" />
1423
			<param name="entityindex" expression="${entityindex}" />
1424
			<outputproperty name="method" value="html" />
1425
			<outputproperty name="standalone" value="yes" />
1426
			<outputproperty name="encoding" value="iso8859_1" />
1427
			<outputproperty name="indent" value="yes" />
1428
		</xslt>
1429
	</target>
1430

    
1431

    
1432
	<target name="compilewebclient" depends="prepare">
1433
		<javac srcdir="${build.src}" destdir="${build.dest}"
1434
			includes="**/application/*.java" classpathref="webservicepath" />
1435
	</target>
1436

    
1437
	<target name="runwebclient" depends="compilewebclient">
1438
		<java
1439
			classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1440
			dir="${build.dest}" fork="yes" classpathref="webservicepath"
1441
			classpath="./lib/utilities.jar" failonerror="true">
1442
			<arg value="${serviceUrl}" />
1443
			<arg value="${docid}" />
1444
		</java>
1445
	</target>
1446

    
1447
	<target name="spatial_option" depends="prepare"
1448
		description=" -- compiles code for the spatial option">
1449

    
1450
		<echo message="Compiling the metatcat shapefile creator" />
1451
		<echo message="using the shapelib at: ${shapelib.dir}" />
1452
		<exec dir="." executable="g++" os="Linux, Unix"
1453
			failonerror="true">
1454
			<arg
1455
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1456
		</exec>
1457

    
1458
		<exec dir="." executable="g++" os="Linux, Unix"
1459
			failonerror="true">
1460
			<arg
1461
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1462
		</exec>
1463
	</target>
1464

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

    
1494
	<path id="lsid.classpath">
1495
		<fileset dir="${lsid.lib.dir}">
1496
			<patternset refid="lsid.jars" />
1497
		</fileset>
1498
		<fileset dir="${lib.dir}">
1499
			<patternset refid="lsid.jars" />
1500
		</fileset>
1501
		<fileset dir="${lib.dir}">
1502
			<include name="xalan.jar" />
1503
			<include name="xml-apis.jar" />
1504
		</fileset>
1505
		<fileset dir="${build.dir}">
1506
			<include name="metacat-client.jar" />
1507
		</fileset>
1508
	</path>
1509

    
1510
	<filterset id="configFilters">
1511
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1512
			value="${config.hostname}" / -->
1513
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1514
			value="${config.port}" / -->
1515
		<!-- MCD BYE filter token="METADATA_LABELS"
1516
			value="${config.metadataLabelLsid}" / -->
1517
		<!-- MCD BYE filter token="METACAT_SERVER"
1518
			value="${config.metacatserver}" / -->
1519
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1520
			value="${config.lsidauthority}" / -->
1521
	</filterset>
1522

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

    
1567
	<target name="compile-lsid" depends="prepare-lsid"
1568
		description="Compile Java sources">
1569
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1570
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1571
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1572
			deprecation="${compile.deprecation}"
1573
			optimize="${compile.optimize}">
1574
			<classpath refid="lsid.classpath" />
1575
		</javac>
1576
	</target>
1577

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

    
1600
	<target name="deploy-lsid" depends="war-lsid"
1601
		description="Deploy LSID war to servlet container">
1602
		<delete dir="${app.deploy.dir}/${authority.context}" />
1603
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1604
		<mkdir dir="${app.deploy.dir}" />
1605
		<copy todir="${app.deploy.dir}">
1606
			<fileset dir="${dist.dir}" />
1607
		</copy>
1608
	</target>
1609

    
1610
    <!-- Build the dataone service, but only if it is checked out as a
1611
         sibling of the current build directory. Requires maven2 to
1612
         be installed and on the path. -->
1613
    <target name="dataone-service" if="d1.available">
1614
        <property name="d1.jar" value="dataone-service-api-0.3.0.jar"/>
1615

    
1616
        <artifact:mvn pom="${d1.dir}/pom.xml" fork="true"
1617
                      mavenHome="${maven.home}">
1618
            <arg value="install"/>
1619
        </artifact:mvn>
1620
		<copy file="${d1.dir}/target/${d1.jar}" todir="${lib.dir}" />
1621
    </target>
1622
</project>
(5-5/6)