Project

General

Profile

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

    
37

    
38
    <!-- Configure the maven2 ant tasks -->
39
    <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.0.jar" />
40
    <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
41
             uri="antlib:org.apache.maven.artifact.ant"
42
             classpathref="maven-ant-tasks.classpath" />
43
	
44
	<!-- defining the axis tasks -->
45
	<path id="axis.ant.classpath">
46
		<fileset dir="lib/lsid_lib">
47
			<include name="*.jar" />
48
		</fileset>
49
	</path>
50
    	
51
	<taskdef resource="axis-tasks.properties"
52
		classpathref="axis.ant.classpath" />
53
	
54
	<!-- Determine if ecogrid should be installed-->
55
	<condition property="enable.ecogrid">
56
		<equals arg1="${install.ecogrid}" arg2="true" />
57
	</condition>
58

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

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

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

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

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

    
118
			<!-- Include everything from maven -->
119
			<fileset dir="${libdir.mvn}">
120
				<include name="*.jar" />
121
			</fileset>
122

    
123
		</path>
124
		
125
		<path id="test.classpath">
126
			<pathelement location="${jsdk}" />
127
			<pathelement location="lib" />
128
			<fileset dir="lib">
129
				<include name="*.jar" />
130
				<exclude name="maven-ant-tasks-2.1.0.jar" />
131
			</fileset>
132
			<fileset dir="lib/lsid_lib">
133
				<include name="*.jar" />
134
			</fileset>
135
			<!-- Include maven -->
136
			<fileset dir="${libdir.mvn}">
137
				<include name="*.jar" />
138
			</fileset>
139
		</path>
140
		
141
		<!-- define the maven tasks -->
142
		<taskdef uri="antlib:org.apache.maven.artifact.ant"
143
			       resource="org/apache/maven/artifact/ant/antlib.xml"
144
			       classpathref="base.classpath" />
145

    
146
	   	<!-- Resolve maven dependencies -->
147
		<artifact:pom id="metacatPom" file="pom.xml" />
148
		<artifact:dependencies filesetId="dependency.fileset" pomrefid="metacatPom" usescope="runtime"/>
149
		<artifact:dependencies pathId="dependency.classpath" pomrefid="metacatPom"/>
150
	   		   	
151
	   	<!-- combine base and dependencies for the classpath -->
152
	   	<path id="compile.classpath">
153
	   		<path refid="base.classpath" />	
154
	   		<path refid="dependency.classpath" />	
155
		</path>
156

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

    
209

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

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

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

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

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

    
278

    
279
		<!-- MCD BYE filter token="timedreplication"     value="${timedreplication}" / -->
280
		<!-- MCD BYE filter token="firsttimedreplication" value="${firsttimedreplication}" / -->
281
		<!-- MCD BYE filter token="timedreplicationinterval" value="${timedreplicationinterval}" / -->
282

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

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

    
328
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
329

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

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

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

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

    
411
	</target>
412
	
413
	<target name="resolveDependencies" depends="init" description="retrieve dependencies with maven">
414
			<echo>Moving Maven dependencies (${dependency.fileset}) to ${libdir.mvn} </echo>
415
			<!-- Clear out mvn dir -->
416
			<delete dir="${libdir.mvn}"></delete>
417
			<!-- Copy all dependencies to the correct location. -->
418
			<copy todir="${libdir.mvn}">
419
				<fileset refid="dependency.fileset" />
420
				<!-- This mapper strips off all leading directory information -->
421
				<mapper type="flatten" />
422
			</copy>
423
		</target>
424

    
425
	<target name="prepare" depends="init, resolveDependencies">
426
		<mkdir dir="${build.dir}" />
427
		<mkdir dir="${build.src}" />
428
		<mkdir dir="${build.dest}" />
429
		<mkdir dir="${build.docs}" />
430
		<mkdir dir="${build.javadocs}" />
431
		<mkdir dir="${build.tmp}" />
432

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

    
449
	<target name="generateStubs" depends="prepare">
450
		<echo
451
			message=" Generating stubs for execution service from ${/tmp/KeplerWebService.wsdl}" />
452
		<axis-wsdl2java verbose="true" output="${srcdir}"
453
			url="/tmp/KeplerWebService.wsdl" />
454
	</target>
455

    
456
	<target name="compile" depends="prepare, utilities, build-metacat-common"
457
		description="Compiles java code to build dir, and copies metacat props files there">
458

    
459
		<javac srcdir="${build.src}" destdir="${build.dest}"
460
			debug="${debug}"
461
			excludes="**/*.sql **/client/*.java **/harvesterClient/*.java">
462
			<classpath>
463
				<path refid="compile.classpath" />
464
			</classpath>
465
		</javac>
466
	</target>
467

    
468
	<target name="jar" depends="compile,geteml"
469
		description="Compiles and jars metacat java code to metacat.jar in build dir ">
470

    
471
		<delete file="${build.dir}/${name}.jar" />
472
		<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
473
			excludes="**/protocols/ **/harvesterClient/" />
474
	</target>
475

    
476
	<target name="protocol" depends="compile"
477
		description="Compiles and jars protocol java code to protocol.jar in build dir">
478
		<delete file="${build.dir}/protocol.jar" />
479
		<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
480
			includes="**/protocols/" />
481
	</target>
482

    
483
	<target name="utilities" depends="config,getpeerutilities"
484
		if="utilities.required">
485
		<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
486
		<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
487
		<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
488
	</target>
489

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

    
499
		<!--  ant dir="${utilitiesdir}" inheritAll="false"  target="dist" / -->
500
	</target>
501

    
502
	<target name="getutilities" depends="prepare"
503
		description="Checks utility out of svn and copies it to your metacat sandbox">
504
		<svn>
505
			<export srcUrl="${svn.utilitiesUrl}"
506
				destPath="${utilitiesdir}" force="true" />
507
		</svn>
508
	</target>
509

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

    
520
	<target name="clientjar" depends="client"
521
		description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
522
		<delete file="${build.dir}/${name}-client.jar" />
523
		<jar jarfile="${build.dir}/${name}-client.jar"
524
			basedir="${build.dest}" includes="**/metacat/client/" />
525
	</target>
526

    
527
	<target name="advancedsearchjar" depends="compile"
528
		description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
529
		<delete file="${build.dir}/advancedsearch.jar" />
530
		<jar jarfile="${build.dir}/advancedsearch.jar"
531
			basedir="${build.dest}" includes="**/metacat/advancedsearch/" />
532
	</target>
533

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

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

    
575
	<target name="geteml" depends="getemlpre2,getemlpre2beta4,geteml2+,getConversionXSL"
576
		if="eml.required" description="Calls getemlpre2 and geteml2+ targets" />
577

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

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

    
618
			<!--
619
			<copy todir="${style-common-cvsrelpath}" filtering="yes">
620
				<fileset
621
					dir="${build.tmp}/eml_${eml-beta4-tag}/style">
622
					<include name="**/*.xsl" />
623
				</fileset>
624
			</copy>
625
			-->
626
		</target>
627

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

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

    
647
		</copy>
648
		<!-- <antcall target="copyxsl">
649
			<param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
650
			<param name="dirname" value="eml-2.0.0" />
651
			</antcall> -->
652

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

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

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

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

    
715
	<target name="copyxsl"
716
		description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
717

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

    
720
		<copy todir="${style-common-cvsrelpath}/${dirname}"
721
			filtering="yes">
722
			<fileset
723
				dir="${build.tmp}/eml_${cvs.tagname}/style/eml">
724
				<include name="**/*.xsl" />
725
			</fileset>
726
		</copy>
727

    
728

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

    
735
	</target>
736

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

    
752
	<target name="install-spatial" depends="jar,clientjar,harvesterjar"
753
		description="Installs spatial option for metacat">
754
		
755
		<copy todir="${dist.dir}">
756
			<fileset dir="./lib/spatial/geoserver" includes="*.war" />
757
		</copy>
758

    
759
	</target>
760

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

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

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

    
804

    
805
	</target>
806

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

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

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

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

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

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

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

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

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

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

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

    
1001
		<copy file="src/perl/register-dataset.cgi"
1002
			todir="${war.context.cgi}" />
1003
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1004
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1005

    
1006
		<!-- registry cgi section -->
1007
		<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
1008
			used in readDocumentFromMetacat -->
1009
		<!-- TODO MCD copy temp files to actual location using config util?? -->
1010
		<copy todir="${war.context.temp}" filtering="yes">
1011
			<fileset dir="lib/style/common/emlb6toeml2">
1012
				<include name="*.xsl" />
1013
				<include name="*.xml" />
1014
			</fileset>
1015
		</copy>
1016
		<available file="lib/style/common/emlb6toeml2" type="dir"
1017
			property="styles.not.needed" />
1018

    
1019
		<!-- ldap cgi section -->
1020
		<copy todir="${war.context.templates}">
1021
			<fileset dir="lib/style/common/templates">
1022
				<!-- SCW: Copy all files -->
1023
			</fileset>
1024
		</copy>
1025
	</target>
1026

    
1027
	<target name="cgiPrepare" if="build.perl">
1028
		<exec dir="src/perl/Metacat/" executable="make">
1029
			<arg value="clean" />
1030
		</exec>
1031
		<exec dir="src/perl/Metacat/" executable="perl">
1032
			<arg value="Makefile.PL" />
1033
		</exec>
1034
		<exec dir="src/perl/Metacat/" executable="make" />
1035
	</target>
1036

    
1037
	<target name="testPrepare"
1038
		description="Copies test files into the war directories">
1039
		<echo>in testPrepare</echo>
1040
		<property name="war.context.test"
1041
			value="${build.war}/${metacat.context}/test" />
1042
		<mkdir dir="${war.context.test}" />
1043
		<copy todir="${war.context.test}" filtering="yes">
1044
			<fileset dir="test/servertestfiles">
1045
				<include name="*/**" />
1046
			</fileset>
1047
		</copy>
1048
	</target>
1049

    
1050
	<target name="getConversionXSL" depends="prepare"
1051
		unless="styles.not.needed"
1052
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1053

    
1054
		<svn>
1055
			<export srcUrl="${svn.eml2StyleUrl}"
1056
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1057
		</svn>
1058

    
1059
		<mkdir dir="lib/style/common/emlb6toeml2" />
1060
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1061
			<fileset
1062
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1063
				<include name="*.xsl" />
1064
				<include name="*.xml" />
1065
			</fileset>
1066
		</copy>
1067
	</target>
1068

    
1069
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1070
		<mkdir dir="${build.tests}" />
1071
		<copy todir="${build.tests}" encoding="UTF-8">
1072
			<fileset dir="${testdir}">
1073
				<include name="edu/**" />
1074
			</fileset>
1075
		</copy>
1076
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1077

    
1078
		<path id="test.classpath">
1079
			<path refid="compile.classpath" />
1080
			<fileset dir="${build.dir}">
1081
				<include name="${name}.jar" />
1082
				<include name="${name}-client.jar" />
1083
				<include name="harvester.jar" />
1084
			</fileset>
1085
		</path>
1086
		
1087
		<pathconvert pathsep="${line.separator}|  |--" 
1088
		             property="echo.test.classpath"
1089
		             refid="test.classpath">
1090
		</pathconvert>
1091
		<echo message="|--test classpath" />
1092
		<echo message="|  |" />
1093
		<echo message="|  |-- ${echo.test.classpath}" />
1094
		
1095
		<!-- copy and compile the tests into a jar file -->
1096
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1097
			debug="on" includes="**/*.java" encoding="UTF-8">
1098
			<classpath refid="test.classpath" />
1099
		</javac>
1100

    
1101
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1102
			basedir="${build.tests}" >
1103
			<include name="**/*.class"/>
1104
			<include name="**/*.xml"/>
1105
		</jar>	
1106
		
1107
	</target>
1108

    
1109
	<target name="runoneclass" depends="testprep"
1110
		description="Uses the ant to run a class">
1111
		
1112
		<java classname="${classtorun}" fork="true">
1113
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1114
			<classpath>
1115
				<path refid="test.classpath" />
1116
				<fileset dir="${build.dir}">
1117
					<include name="${name}.jar" />
1118
					<include name="${name}-client.jar" />
1119
					<include name="harvester.jar" />
1120
					<include name="${name}-junittests.jar" />
1121
				</fileset>
1122
			</classpath>
1123
		</java>
1124
	</target>
1125
	
1126
	<target name="test" depends="testprep"
1127
		description="Uses the ant junit task to run all JUnit tests">
1128

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

    
1143
			<formatter type="plain" />
1144

    
1145
			<batchtest fork="yes" todir="${build.dir}">
1146
				<fileset dir="${build.tests}">
1147
					<include name="**/*.class" />
1148
					<exclude name="**/MCTestCase.class" />
1149
					<exclude name="**/ClientViewHelperTest.class" />
1150
					<!-- these are not test cases -->
1151
					<exclude name="**/MockCNode.class" />
1152
					<exclude name="**/D1NodeServiceTest.class" />
1153
					<exclude name="**/QueryRunner.class" />
1154
					<exclude name="**/MockObjectPathMap.class" />
1155
					<exclude name="**/HzObjectPathMapTest$1.class" />
1156
					<exclude name="**/HzObjectPathMapTest$2.class" />
1157
				</fileset>
1158
			</batchtest>
1159
		</junit>
1160
	</target>
1161

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

    
1165
		<echo>testtorun: ${testtorun}</echo>
1166

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

    
1181
			<formatter type="plain" />
1182

    
1183
			<batchtest fork="yes" todir="${build.dir}">
1184
				<fileset dir="${build.tests}">
1185
					<include name="**/${testtorun}.class" />
1186
				</fileset>
1187
			</batchtest>
1188
		</junit>
1189
	</target>
1190
	
1191
	<target name="run" depends="testprep"
1192
			description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1193

    
1194
			<echo>testtorun: ${testtorun}</echo>
1195

    
1196
			<!-- use the ant "junit" task to run JUnit tests. -->
1197
			<junit printsummary="yes" haltonfailure="no" fork="yes"
1198
				haltonerror="no" showoutput="yes">
1199
				<jvmarg value="-Dfile.encoding=UTF-8"/>
1200
				<classpath>
1201
					<path refid="test.classpath" />
1202
					<fileset dir="${build.dir}">
1203
						<include name="${name}.jar" />
1204
						<include name="${name}-client.jar" />
1205
						<include name="harvester.jar" />
1206
						<include name="${name}-junittests.jar" />
1207
					</fileset>
1208
				</classpath>
1209

    
1210
				<formatter type="plain" />
1211

    
1212
				<batchtest fork="yes" todir="${build.dir}">
1213
					<fileset dir="${build.tests}">
1214
						<include name="**/${testtorun}.class" />
1215
					</fileset>
1216
				</batchtest>
1217
			</junit>
1218
		</target>
1219

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

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

    
1246
		<echo>
1247
			*********************************** Please run ant
1248
			gethttpclient first! ***********************************
1249
		</echo>
1250
		<!-- copy and compile the tests into a jar file -->
1251
		<mkdir dir="${build.metacatnettest}" />
1252
		<javac srcdir="${junitnettestsdir}"
1253
			destdir="${build.metacatnettest}" includes="**/*.java">
1254
			<classpath>
1255
				<path refid="compile.classpath" />
1256
				<fileset dir="${build.dir}">
1257
					<include name="${name}.jar" />
1258
				</fileset>
1259
			</classpath>
1260
		</javac>
1261

    
1262
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1263
			basedir="${build.metacatnettest}" includes="**/*.class" />
1264

    
1265
		<!-- use the ant "junit" task to run JUnit tests. -->
1266
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1267
			haltonerror="no">
1268
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1269
			<classpath>
1270
				<path refid="compile.classpath" />
1271
				<fileset dir="${build.dir}">
1272
					<include name="${name}.jar" />
1273
					<include name="${name}-junitnettests.jar" />
1274
				</fileset>
1275
			</classpath>
1276

    
1277
			<formatter type="plain" />
1278

    
1279
			<batchtest fork="yes" todir="${build.dir}">
1280
				<fileset dir="${build.metacatnettest}">
1281
					<include name="**/*.class" />
1282
				</fileset>
1283
			</batchtest>
1284
		</junit>
1285
	</target>
1286

    
1287
	<target name="cleanweb" depends="clean"
1288
		description="deletes tomcat web context dir and all its contents">
1289
		<delete dir="${installdir}" />
1290
	</target>
1291

    
1292

    
1293
	<target name="clean" depends="init"
1294
		description="deletes build dir and files that can be regenerated form the release">
1295
		<delete dir="${build.dir}" />
1296
		<delete dir="${dist.dir}" />
1297
	</target>
1298

    
1299
	<target name="localclean" depends="clean"
1300
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1301
		<delete file="lib/utilities.jar" />
1302
	</target>
1303

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

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

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

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

    
1388
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1389
		<copy todir="${ver.dir}/test/servertestfiles">
1390
			<fileset dir="./test/servertestfiles" />
1391
		</copy>
1392
	</target>
1393

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

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

    
1424
		<mkdir dir="${ecogrid-dist-dir}" />
1425
		<copy todir="${ecogrid-dist-dir}">
1426
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1427
		</copy>
1428

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

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

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

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

    
1462
		<copy file="${dist.dir}/knb.war"
1463
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1464
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1465
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1466

    
1467
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1468
			failonerror="true">
1469
			<arg line="--build debian" />
1470
		</exec>
1471

    
1472
		<move file="${pkg.dir}/debian.deb"
1473
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1474
	</target>
1475

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

    
1490
	<target name="spatial_option" depends="prepare"
1491
		description=" -- compiles code for the spatial option">
1492

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

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

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

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

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

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

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

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

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

    
1677
	<!-- build metacat-index war -->
1678
	<target name="build-metacat-index" description="Calls the Maven build for metacat-index.war" >		
1679
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1680
			<arg value="clean"/>
1681
		</artifact:mvn>
1682
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1683
			<arg value="package"/>
1684
			<!--<arg value="-Dmaven.test.skip=true"/>-->
1685
		</artifact:mvn>
1686
	</target>
1687
	
1688
	<target name="dist-metacat-index" depends="init, build-metacat-index" description="Copy metacat-index.war to dist folder" >		
1689
		<copy tofile="${dist.dir}/metacat-index.war" >
1690
			<fileset dir="metacat-index/target" includes="metacat-index*.war"></fileset>
1691
		</copy>	
1692
	</target>
1693
	
1694
	<target name="install-metacat-index" depends="dist-metacat-index" description="Copy metacat-index.war to deploy folder" >		
1695
		<copy todir="${app.deploy.dir}" file="${dist.dir}/metacat-index.war" />
1696
	</target>
1697
	
1698
</project>
(5-5/7)