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-04-19 09:08:14 -0700 (Fri, 19 Apr 2013) $'
11
	*    '$Revision: 7583 $'
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
	<property name="maven.home" value="/usr/share/maven" />
45
	
46
	<!-- defining the axis tasks -->
47
	<path id="axis.ant.classpath">
48
		<fileset dir="lib/lsid_lib">
49
			<include name="*.jar" />
50
		</fileset>
51
	</path>
52
    	
53
	<taskdef resource="axis-tasks.properties"
54
		classpathref="axis.ant.classpath" />
55
	
56
	<!-- Determine if ecogrid should be installed-->
57
	<condition property="enable.ecogrid">
58
		<equals arg1="${install.ecogrid}" arg2="true" />
59
	</condition>
60

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

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

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

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

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

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

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

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

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

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

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

    
161
		</path>
162

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

    
215

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

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

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

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

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

    
284

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

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

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

    
334
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
335

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

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

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

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

    
420
	</target>
421

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
725

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

    
732
	</target>
733

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

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

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

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

    
769
	</target>
770

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

    
789
	<target name="build-metacat" depends="install-ecogrid, install-spatial, install-metacat-index"
790
		description="Build Metacat">
791
	</target>
792

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

    
814

    
815
	</target>
816

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

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

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

    
841
	<target name="install-skin" depends="init"
842
		description="Install a Skin">
843

    
844
		<input message="Please enter name of the skin"
845
			addproperty="skin-name" />
846

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

    
891
		<echo message="Install Skin completed." />
892
	</target>
893

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

    
905
	<target name="warPrepare"
906
		depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare,documentation"
907
		description="Prepare files for creating a web archive (WAR)">
908

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

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

    
1022
		<copy file="src/perl/register-dataset.cgi"
1023
			todir="${war.context.cgi}" />
1024
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1025
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1026

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

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

    
1048
	<target name="cgiPrepare" if="build.perl">
1049
		<exec dir="src/perl/Metacat/" executable="make">
1050
			<arg value="clean" />
1051
		</exec>
1052
		<exec dir="src/perl/Metacat/" executable="perl">
1053
			<arg value="Makefile.PL" />
1054
		</exec>
1055
		<exec dir="src/perl/Metacat/" executable="make" />
1056
	</target>
1057

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

    
1071
	<target name="getConversionXSL" depends="prepare"
1072
		unless="styles.not.needed"
1073
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1074

    
1075
		<svn>
1076
			<export srcUrl="${svn.eml2StyleUrl}"
1077
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1078
		</svn>
1079

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

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

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

    
1122
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1123
			basedir="${build.tests}" >
1124
			<include name="**/*.class"/>
1125
			<include name="**/*.xml"/>
1126
		</jar>	
1127
		
1128
	</target>
1129

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

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

    
1164
			<formatter type="plain" />
1165

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

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

    
1186
		<echo>testtorun: ${testtorun}</echo>
1187

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

    
1202
			<formatter type="plain" />
1203

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

    
1215
			<echo>testtorun: ${testtorun}</echo>
1216

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

    
1231
				<formatter type="plain" />
1232

    
1233
				<batchtest fork="yes" todir="${build.dir}">
1234
					<fileset dir="${build.tests}">
1235
						<include name="**/${testtorun}.class" />
1236
					</fileset>
1237
				</batchtest>
1238
			</junit>
1239
		</target>
1240

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

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

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

    
1283
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1284
			basedir="${build.metacatnettest}" includes="**/*.class" />
1285

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

    
1298
			<formatter type="plain" />
1299

    
1300
			<batchtest fork="yes" todir="${build.dir}">
1301
				<fileset dir="${build.metacatnettest}">
1302
					<include name="**/*.class" />
1303
				</fileset>
1304
			</batchtest>
1305
		</junit>
1306
	</target>
1307

    
1308
	<target name="cleanweb" depends="clean"
1309
		description="deletes tomcat web context dir and all its contents">
1310
		<delete dir="${installdir}" />
1311
	</target>
1312

    
1313

    
1314
	<target name="clean" depends="init"
1315
		description="deletes build dir and files that can be regenerated form the release">
1316
		<delete dir="${build.dir}" />
1317
		<delete dir="${dist.dir}" />
1318
	</target>
1319

    
1320
	<target name="localclean" depends="clean"
1321
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1322
		<delete file="lib/utilities.jar" />
1323
	</target>
1324

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

    
1369
	<target name="javadoc" depends="prepare"
1370
		description="generates Javadoc API documentation">
1371
		<javadoc packagenames="edu.ucsb.nceas.*"
1372
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1373
			version="true" use="true" windowtitle="${Name} API"
1374
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1375
			bottom="&lt;i&gt;Copyright &#169; ${copyright}. All Rights Reserved.&lt;/i&gt;">
1376
			<classpath>
1377
				<path refid="compile.classpath" />
1378
			</classpath>
1379
		</javadoc>
1380
	</target>
1381

    
1382
	<target name="dist"
1383
		depends="geteml,get-ecogrid,jar,protocol,documentation,getConversionXSL,getutilities"
1384
		description="prepares a full release distribution">
1385
		<mkdir dir="${dist.dir}" />
1386
		<delete dir="${ver.dir}" />
1387
		<mkdir dir="${ver.dir}" />
1388
		<copy todir="${ver.dir}">
1389
			<fileset dir="."
1390
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1391
		</copy>
1392
		<copy todir="${ver.dir}" file="build.xml" />
1393
		<copy todir="${ver.dir}" file="build.properties" />
1394

    
1395
		<copy todir="${ver.dir}/docs" filtering="yes">
1396
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1397
		</copy>
1398
		<copy todir="${ver.dir}/docs" filtering="no">
1399
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1400
		</copy>
1401
		<copy todir="${ver.dir}/docs/dev">
1402
			<fileset dir="${build.dir}/docs" />
1403
		</copy>
1404
		<copy todir="${ver.dir}/src">
1405
			<fileset dir="${build.dir}/src" />
1406
		</copy>
1407

    
1408
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1409
		<copy todir="${ver.dir}/test/servertestfiles">
1410
			<fileset dir="./test/servertestfiles" />
1411
		</copy>
1412
	</target>
1413

    
1414
	<target name="fulldist" depends="distbin, distsrc"
1415
			description="full distribution - source and bin"/>
1416
		
1417
	<target name="distbin" depends="build-metacat,war-lsid"
1418
		description="prepares a binary distribution">
1419
		<copy todir="${dist.dir}">
1420
			<fileset dir="./src/scripts" />
1421
		</copy>
1422
		<delete file="./${name}-bin-${release}.zip" />
1423
		<zip zipfile="./${name}-bin-${release}.zip"
1424
			basedir="${dist.dir}" excludes="metacat-*/**" />
1425
		<delete file="./${name}-bin-${release}.tar.gz" />
1426
		<tar tarfile="./${name}-bin-${release}.tar"
1427
			basedir="${dist.dir}" excludes="metacat-*/**" />
1428
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1429
			src="./${name}-bin-${release}.tar" />
1430
		<delete file="./${name}-bin-${release}.tar" />
1431
	</target>
1432

    
1433
	<target name="distsrc" depends="dist"
1434
		description="prepares a source distribution">
1435
		<mkdir dir="${ver.src}" />
1436
		<copy todir="${ver.src}">
1437
			<fileset dir="./src" />
1438
		</copy>
1439
		<mkdir dir="${util.dir}" />
1440
		<copy todir="${util.dir}">
1441
			<fileset dir="${utilitiesdir}" excludes="**/CVS*" />
1442
		</copy>
1443

    
1444
		<mkdir dir="${ecogrid-dist-dir}" />
1445
		<copy todir="${ecogrid-dist-dir}">
1446
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1447
		</copy>
1448

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

    
1451
		<delete file="./${name}-src-${release}.zip" />
1452
		<zip zipfile="./${name}-src-${release}.zip"
1453
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1454
		<delete file="./${name}-src-${release}.tar.gz" />
1455
		<tar tarfile="./${name}-src-${release}.tar"
1456
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1457
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1458
			src="./${name}-src-${release}.tar" />
1459
		<delete file="./${name}-src-${release}.tar" />
1460
		<!--delete dir="${dist.dir}"/ -->
1461
	</target>
1462

    
1463
	<target name="deb-package" depends="distbin"
1464
		description="create a debian installation package">
1465
		<delete dir="${deb.pkg.dir}" />
1466
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1467
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1468
			<fileset dir="./src/scripts/debian"
1469
				includes="control postinst" />
1470
		</copy>
1471

    
1472
		<mkdir
1473
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1474
		<copy
1475
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1476
			filtering="yes">
1477
			<fileset dir="./src/scripts/debian"
1478
				excludes="control postinst" />
1479
		</copy>
1480
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1481

    
1482
		<copy file="${dist.dir}/knb.war"
1483
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1484
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1485
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1486

    
1487
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1488
			failonerror="true">
1489
			<arg line="--build debian" />
1490
		</exec>
1491

    
1492
		<move file="${pkg.dir}/debian.deb"
1493
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1494
	</target>
1495

    
1496
	<target name="stylesheettest">
1497
		<xslt in="${input}" out="eml.html"
1498
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1499
			<param name="displaymodule" expression="${displaymodule}" />
1500
			<param name="docid" expression="${input}" />
1501
			<param name="entitytype" expression="${entitytype}" />
1502
			<param name="entityindex" expression="${entityindex}" />
1503
			<outputproperty name="method" value="html" />
1504
			<outputproperty name="standalone" value="yes" />
1505
			<outputproperty name="encoding" value="iso8859_1" />
1506
			<outputproperty name="indent" value="yes" />
1507
		</xslt>
1508
	</target>
1509

    
1510
	<target name="spatial_option" depends="prepare"
1511
		description=" -- compiles code for the spatial option">
1512

    
1513
		<echo message="Compiling the metatcat shapefile creator" />
1514
		<echo message="using the shapelib at: ${shapelib.dir}" />
1515
		<exec dir="." executable="g++" os="Linux, Unix"
1516
			failonerror="true">
1517
			<arg
1518
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1519
		</exec>
1520

    
1521
		<exec dir="." executable="g++" os="Linux, Unix"
1522
			failonerror="true">
1523
			<arg
1524
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1525
		</exec>
1526
	</target>
1527

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

    
1556
	<path id="lsid.classpath">
1557
		<fileset dir="${lsid.lib.dir}">
1558
			<patternset refid="lsid.jars" />
1559
		</fileset>
1560
		<fileset dir="${lib.dir}">
1561
			<patternset refid="lib.jars" />
1562
		</fileset>
1563
		<fileset dir="${build.dir}">
1564
			<include name="metacat-client.jar" />
1565
			<include name="metacat.jar" />
1566
		</fileset>
1567
	</path>
1568

    
1569
	<filterset id="configFilters">
1570
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1571
			value="${config.hostname}" / -->
1572
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1573
			value="${config.port}" / -->
1574
		<!-- MCD BYE filter token="METADATA_LABELS"
1575
			value="${config.metadataLabelLsid}" / -->
1576
		<!-- MCD BYE filter token="METACAT_SERVER"
1577
			value="${config.metacatserver}" / -->
1578
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1579
			value="${config.lsidauthority}" / -->
1580
	</filterset>
1581

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

    
1626
	<target name="compile-lsid" depends="prepare-lsid"
1627
		description="Compile Java sources">
1628
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1629
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1630
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1631
			deprecation="${compile.deprecation}"
1632
			optimize="${compile.optimize}">
1633
			<classpath refid="lsid.classpath" />
1634
		</javac>
1635
	</target>
1636

    
1637
	<target name="war-lsid" depends="compile-lsid"
1638
		description="Create a war file for the application">
1639
		<mkdir dir="${dist.dir}" />
1640
		<war destfile="${dist.dir}/${authority.context}.war"
1641
			webxml="${webinf.dir}/web.xml">
1642
			<fileset dir="${lsid.build.dir}" />
1643
			<lib dir="${lsid.lib.dir}">
1644
				<patternset refid="lsid.jars" />
1645
			</lib>
1646
			<lib dir="${lib.dir}">
1647
				<patternset refid="lib.jars" />
1648
			</lib>
1649
			<lib dir="${lib.dir}">
1650
				<include name="xalan.jar" />
1651
				<include name="xml-apis.jar" />
1652
			</lib>
1653
			<lib dir="${build.dir}">
1654
				<include name="metacat-client.jar" />
1655
			</lib>
1656
		</war>
1657
	</target>
1658

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

    
1687
	<!-- build metacat-index war -->
1688
	<target name="build-metacat-index" description="Calls the Maven build for metacat-index.war" >		
1689
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1690
			<arg value="clean"/>
1691
		</artifact:mvn>
1692
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1693
			<arg value="package"/>
1694
			<!--<arg value="-Dmaven.test.skip=true"/>-->
1695
		</artifact:mvn>
1696
	</target>
1697
	
1698
	<target name="dist-metacat-index" depends="init, build-metacat-index" description="Copy metacat-index.war to dist folder" >		
1699
		<copy tofile="${dist.dir}/metacat-index.war" >
1700
			<fileset dir="metacat-index/target" includes="metacat-index*.war"></fileset>
1701
		</copy>	
1702
	</target>
1703
	
1704
	<target name="install-metacat-index" depends="dist-metacat-index" description="Copy metacat-index.war to deploy folder" >		
1705
		<copy todir="${app.deploy.dir}" file="${dist.dir}/metacat-index.war" />
1706
	</target>
1707
	
1708
</project>
(5-5/6)