Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2 1311 berkley
<!--
3 4969 daigle
	*   '$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$'
10
	*    '$Date$'
11
	*    '$Revision$'
12
	*
13
	* Build file for the Ant cross-platform build system for metacat
14
	* See http://jakarta.apache.org for details on Ant
15
	*
16
	* usage: ant [compile|jar|install|jdoc]
17
	*
18
	* This program is free software; you can redistribute it and/or modify
19
	* it under the terms of the GNU General Public License as published by
20
	* the Free Software Foundation; either version 2 of the License, or
21
	* (at your option) any later version.
22
	*
23
	* This program is distributed in the hope that it will be useful,
24
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
	* GNU General Public License for more details.
27
	*
28
	* You should have received a copy of the GNU General Public License
29
	* along with this program; if not, write to the Free Software
30
	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31 1311 berkley
-->
32 5295 jones
<project name="metacat" default="jar" basedir="."
33
         xmlns:artifact="antlib:org.apache.maven.artifact.ant">
34 4969 daigle
	<property environment="env" />
35
	<property file="build.properties" /><!-- USER SPECIFIC PROPS -->
36 3034 perry
37 1801 tao
38 5295 jones
    <!-- 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 2175 tao
44 5815 leinfelder
	<!-- 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 4969 daigle
	<!-- Determine if ecogrid should be installed-->
55
	<condition property="enable.ecogrid">
56
		<equals arg1="${install.ecogrid}" arg2="true" />
57
	</condition>
58 3034 perry
59 4969 daigle
	<!-- Determine if perl should be built-->
60
	<condition property="build.perl">
61
		<equals arg1="${make.perl.code}" arg2="true" />
62
	</condition>
63 3034 perry
64 5295 jones
	<!-- Determine if dataone-service should be built-->
65
	<condition property="d1.available">
66
        <and>
67
	        <available file="${d1.dir}"/>
68
	        <available file="${maven.home}"/>
69
        </and>
70
	</condition>
71
72 5311 daigle
	<available file="${build.tomcat.dir}/common/lib/servlet-api.jar"
73
			property="tomcat.common.exists" />
74 5294 jones
75 5311 daigle
	<target name="config" depends="setTomcatCommon, setTomcatNoCommon">
76 4969 daigle
		<!-- usr for client testing, generally you don't need change-->
77
		<property name="mcuser"
78
			value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org" />
79
		<property name="mcpassword" value="kepler" />
80
		<property name="mcanotheruser"
81
			value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org" />
82
		<property name="mcanotherpassword" value="yourpass" />
83
		<property name="piscouser"
84
			value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org" />
85
		<property name="piscopassword" value="yourpass" />
86
		<property name="lteruser"
87
			value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org" />
88
		<property name="lterpassword" value="yourpass" />
89 4943 costa
90 4969 daigle
		<property name="debug" value="on" />
91
		<property name="morphosourcedir" value="../morpho" />
92
		<property name="utilitiesdir" value="../utilities" />
93
		<property name="installdir"
94
			value="${app.deploy.dir}/${metacat.context}" />
95 1929 brooke
96 4969 daigle
		<echo>*********** set jsdk to ${jsdk}</echo>
97
	</target>
98 5311 daigle
99
	<target name="setTomcatCommon" if="tomcat.common.exists" >
100
		<property name="jsdk"
101
			value="${build.tomcat.dir}/common/lib/servlet-api.jar" />
102
	</target>
103
104
	<target name="setTomcatNoCommon" unless="tomcat.common.exists" >
105
		<property name="jsdk"
106
			value="${build.tomcat.dir}/lib/servlet-api.jar" />
107
	</target>
108
109 4969 daigle
	<target name="init" depends="config">
110
		<path id="compile.classpath">
111
			<pathelement location="${jsdk}" />
112
			<pathelement location="lib" />
113
			<fileset dir="lib">
114
				<include name="*.jar" />
115
			</fileset>
116
			<fileset dir="lib">
117
				<include name="xalan.jar" />
118
			</fileset>
119
			<fileset dir="lib/lsid_lib">
120
				<include name="*.jar" />
121
			</fileset>
122 2343 sgarg
123 4969 daigle
			<!-- Include geoserver, geotools, et. al. -->
124
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
125
				<include name="*.jar" />
126
			</fileset>
127 1487 tao
128 4969 daigle
			<!-- Include OAI-PMH -->
129
			<fileset dir="lib/oaipmh">
130
				<include name="*.jar" />
131
			</fileset>
132 806 jones
133 4969 daigle
		</path>
134 5311 daigle
135
		<path id="test.classpath">
136
			<pathelement location="${jsdk}" />
137
			<pathelement location="lib" />
138
			<fileset dir="lib">
139
				<include name="*.jar" />
140
				<exclude name="maven-ant-tasks-2.1.0.jar" />
141
			</fileset>
142
			<fileset dir="lib">
143
				<include name="xalan.jar" />
144
			</fileset>
145
			<fileset dir="lib/lsid_lib">
146
				<include name="*.jar" />
147
			</fileset>
148 2599 jones
149 5311 daigle
			<!-- Include geoserver, geotools, et. al. -->
150
			<fileset dir="lib/spatial/geoserver/WEB-INF/lib">
151
				<include name="*.jar" />
152
			</fileset>
153 5829 leinfelder
154 5311 daigle
155
			<!-- Include OAI-PMH -->
156
			<fileset dir="lib/oaipmh">
157
				<include name="*.jar" />
158
			</fileset>
159
160
		</path>
161
162 4969 daigle
		<!-- It is less likely you'll need to make any changes from here down,
163
			but customization is possible -->
164
		<property name="name" value="metacat" />
165
		<property name="Name" value="MetaCat" />
166
		<property name="debugprefix" value="${Name}:" />
167
		<property name="release" value="${metacat.version}" />
168
		<property name="style-common-relpath" value="/style/common" />
169
		<property name="style-shared-relpath" value="/style/shared" />
170
		<property name="schema-relpath" value="/schema" />
171
		<property name="style-common-cvsrelpath"
172
			value="lib${style-common-relpath}" />
173
		<property name="schema-cvsrelpath" value="lib${schema-relpath}" />
174
		<property name="style-skins-relpath" value="/style/skins" />
175
		<property name="util-module" value="utilities" />
176 5809 leinfelder
		<!-- property name="utilities-tag" value="trunk" / -->
177
		<property name="utilities-tag" value="tags/UTILITIES_1_1_0_RC1" />
178 5892 leinfelder
		<property name="seek-tag" value="tags/ECOGRID_1_2_2_RC2" />
179 4969 daigle
		<property name="eml-module" value="eml" />
180
		<property name="eml-version" value="2.0.0beta6" />
181
		<property name="eml-beta-tag"
182
			value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT" />
183
		<property name="eml2_0_0-schema-tag"
184
			value="RELEASE_EML_2_0_0_UPDATE_1" />
185
		<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
186
		<property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0" />
187 5809 leinfelder
		<property name="eml2_1_1-schema-tag" value="RELEASE_EML_2_1_1_RC_2" />
188 5657 berkley
		<property name="dataone-schema-tag" value="D1_SCHEMA_0_5_1" />
189 5964 leinfelder
		<property name="eml2-style-tag" value="RELEASE_EML_UTILS_1_0_0_RC10" />
190 4969 daigle
		<property name="eml2_0_0namespace"
191
			value="eml://ecoinformatics.org/eml-2.0.0" />
192
		<property name="eml2_0_1namespace"
193
			value="eml://ecoinformatics.org/eml-2.0.1" />
194
		<property name="eml2_1_0namespace"
195
			value="eml://ecoinformatics.org/eml-2.1.0" />
196 5709 leinfelder
		<property name="eml2_1_1namespace"
197
			value="eml://ecoinformatics.org/eml-2.1.1" />
198 4969 daigle
		<property name="stmmlnamespace"
199
			value="http://www.xml-cml.org/schema/stmml" />
200
		<property name="eml-css" value="eml_xsl.css" />
201
		<property name="eml-module.default.css" value="default.css" />
202
		<property name="systemidserver" value="" />
203
		<property name="html-path" value="" />
204 5919 tao
		<property name ="metacat-properties-file" value="build/war/WEB-INF/metacat.properties"/>
205 1311 berkley
206 348 jones
207 4969 daigle
		<!-- Config for registry variables -->
208
		<!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
209
		<property name="scope" value="obfs" />
210
		<property name="responseForm" value="genericResponse.tmpl" />
211
		<property name="entryForm" value="entryForm.tmpl" />
212
		<property name="guide" value="genericGuide.tmpl" />
213
		<property name="loginForm" value="loginForm.tmpl" />
214
		<property name="confirmData" value="confirmData.tmpl" />
215
		<property name="deleteData" value="deleteData.tmpl" />
216
		<property name="genericHeader" value="genericHeader.tmpl" />
217
		<property name="genericFooter" value="genericFooter.tmpl" />
218 348 jones
219 4969 daigle
		<filter token="scope" value="${scope}" />
220
		<filter token="responseForm" value="${responseForm}" />
221
		<filter token="entryForm" value="${entryForm}" />
222
		<filter token="guide" value="${guide}" />
223
		<filter token="loginForm" value="${loginForm}" />
224
		<filter token="confirmData" value="${confirmData}" />
225
		<filter token="deleteData" value="${deleteData}" />
226
		<filter token="genericHeader" value="${genericHeader}" />
227
		<filter token="genericFooter" value="${genericFooter}" />
228
		<filter token="adminname" value="${adminname}" />
229
		<filter token="recipient" value="${recipient}" />
230
		<filter token="metacatVersion" value="${metacat.version}" />
231
		<filter token="metacatRC" value="${metacat.releaseCandidate}" />
232
		<filter token="build.context" value="${metacat.context}" />
233
234
		<filter token="docrooturl" value="./" />
235
		<filter token="mcuser" value="${mcuser}" />
236
		<filter token="mcpassword" value="${mcpassword}" />
237
		<filter token="mcanotheruser" value="${mcanotheruser}" />
238
		<filter token="mcanotherpassword" value="${mcanotherpassword}" />
239
		<filter token="eml-css" value="${eml-css}" />
240
		<filter token="style-skins-relpath"
241
			value="${style-skins-relpath}" />
242
		<filter token="style-common-relpath"
243
			value="${style-common-relpath}" />
244
245
		<filter token="eml-version" value="${eml-version}" />
246
		<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}" />
247
		<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}" />
248
		<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}" />
249 5709 leinfelder
		<filter token="eml2_1_1namespace" value="${eml2_1_1namespace}" />
250 4969 daigle
		<filter token="stmmlnamespace" value="${stmmlnamespace}" />
251
		<filter token="debugprefix" value="${debugprefix}" />
252
253
		<filter token="defaultStage" value="${defaultStage}" />
254
		<filter token="defaultHeader" value="${defaultHeader}" />
255
		<filter token="defaultFooter" value="${defaultFooter}" />
256
		<filter token="defaultChangePass" value="${defaultChangePass}" />
257
		<filter token="defaultResetPass" value="${defaultResetPass}" />
258
		<filter token="changePassSuccess" value="${changePassSuccess}" />
259
		<filter token="resetPassSuccess" value="${resetPassSuccess}" />
260
		<filter token="registerFailed" value="${registerFailed}" />
261
		<filter token="registerLter" value="${registerLter}" />
262
		<filter token="registerMatch" value="${registerMatch}" />
263
		<filter token="registerSuccess" value="${registerSuccess}" />
264
		<filter token="register" value="${register}" />
265
		<filter token="searchResults" value="${searchResults}" />
266
		<filter token="ldapMainServerFailure"
267
			value="${ldapMainServerFailure}" />
268
		<filter token="lter-user" value="${lteruser}" />
269
		<filter token="lter-pass" value="${lterpassword}" />
270
		<filter token="pisco-user" value="${piscouser}" />
271
		<filter token="pisco-pass" value="${piscopassword}" />
272
273
274
		<!-- MCD BYE filter token="timedreplication"     value="${timedreplication}" / -->
275
		<!-- MCD BYE filter token="firsttimedreplication" value="${firsttimedreplication}" / -->
276
		<!-- MCD BYE filter token="timedreplicationinterval" value="${timedreplicationinterval}" / -->
277
278
		<property name="srcdir" value="./src" />
279
		<property name="lib.dir" value="./lib" />
280
		<property name="docdir" value="./docs" />
281
		<property name="cgidir" value="./cgi-bin" />
282
		<property name="testdir" value="./test" />
283 5772 leinfelder
		<property name="testtorun" value="InternationalizationTest" />
284 4969 daigle
		<property name="junittestsdir"
285
			value="./test/edu/ucsb/nceas/metacattest" />
286
		<property name="junitnettestsdir"
287
			value="./test/edu/ucsb/nceas/metacatnettest" />
288
		<property name="build.dir" value="./build" />
289
		<property name="build.src" value="${build.dir}/src" />
290
		<property name="build.dest" value="${build.dir}/classes" />
291
		<property name="build.samples" value="${build.dir}/samples" />
292
		<property name="build.tests" value="${build.dir}/tests" />
293
		<property name="build.tmp" value="${build.dir}/tmp" />
294
		<property name="build.metacattest"
295
			value="${build.tests}/metacattest" />
296
		<property name="build.metacatnettest"
297
			value="${build.tests}/metacatnettest" />
298
		<property name="build.data" value="${build.dir}/data" />
299
		<property name="build.javadocs" value="${build.dir}/docs/api" />
300
		<property name="build.war" value="${build.dir}/war" />
301
		<property name="dist.dir" value="dist" />
302
		<property name="ver.dir" value="${dist.dir}/${name}-${release}" />
303
		<property name="ver.src" value="${ver.dir}/src" />
304
		<property name="util.dir" value="${dist.dir}/${util-module}" />
305
		<property name="test.dir" value="${dist.dir}/test" />
306
		<!-- directories for creating a Harvest List Editor distribution -->
307
		<property name="dist.dir.hle" value="disthle" />
308
		<property name="ver.dir.hle"
309
			value="${dist.dir.hle}/harvest-list-editor-${release}" />
310
		<property name="pkg.dir" value="./package" />
311
		<property name="deb.pkg.dir" value="${pkg.dir}/debian" />
312
313
		<property name="ecogrid-target-name" value="metacatImpl" />
314
		<property name="ecogrid-module-dest-dir" value=".." />
315
		<property name="ecogrid-module" value="seek/projects/ecogrid" />
316
		<property name="ecogrid-dist-dir"
317
			value="${dist.dir}/${ecogrid-module}" />
318
		<property name="ecogrid-dir"
319
			value="${ecogrid-module-dest-dir}/${ecogrid-module}" />
320
321
		<property name="package.home" value="edu/ucsb/nceas/metacat" />
322
323
		<!-- set up svn -->
324
		<property name="svnant.lib" value="lib" />
325
		<property name="svnant.jar" value="${svnant.lib}/svnant.jar" />
326
		<property name="svnClientAdapter.jar"
327
			value="${svnant.lib}/svnClientAdapter.jar" />
328
		<property name="svnjavahl.jar"
329
			value="${svnant.lib}/svnjavahl.jar" />
330
		<property name="svn.utilitiesUrl"
331 5051 daigle
			value="https://code.ecoinformatics.org/code/utilities/${utilities-tag}" />
332 4969 daigle
		<property name="svn.ecogridUrl"
333 5809 leinfelder
			value="https://code.ecoinformatics.org/code/seek/${seek-tag}/projects/ecogrid/" />
334 5176 daigle
		<property name="svn.emlBetaUrl"
335
			value="https://code.ecoinformatics.org/code/eml/branches/${eml-beta-tag}" />
336
		<property name="svn.eml200SchemaUrl"
337
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_0-schema-tag}" />
338
		<property name="svn.eml201SchemaUrl"
339
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_0_1-schema-tag}" />
340
		<property name="svn.eml210SchemaUrl"
341
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_0-schema-tag}" />
342 5709 leinfelder
		<property name="svn.eml211SchemaUrl"
343
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2_1_1-schema-tag}" />
344 5328 jones
		<property name="svn.dataone-0.1-schema-url"
345 5625 berkley
			value="https://repository.dataone.org/software/cicore/tags/${dataone-schema-tag}" />
346 5176 daigle
		<property name="svn.eml2StyleUrl"
347
			value="https://code.ecoinformatics.org/code/eml/tags/${eml2-style-tag}" />
348 4969 daigle
349
		<!-- load the svn task -->
350
		<path id="svn.classpath">
351
			<pathelement location="${svnjavahl.jar}" />
352
			<pathelement location="${svnant.jar}" />
353
			<pathelement location="${svnClientAdapter.jar}" />
354
		</path>
355
		<taskdef resource="svntask.properties"
356
			classpathref="svn.classpath" />
357
358
		<condition property="utilities.required">
359
			<or>
360
				<not>
361
					<available file="lib/utilities.jar" />
362
				</not>
363
				<not>
364
					<available file="${utilitiesdir}" type="dir" />
365
				</not>
366
			</or>
367
		</condition>
368
		<!-- peer.utilities.required is used when there is no utilities
369
			directory at ${utilitiesdir} -->
370
		<condition property="peer.utilities.required">
371
			<or>
372
				<not>
373
					<available file="${utilitiesdir}" type="dir" />
374
				</not>
375
			</or>
376
		</condition>
377
		<condition property="eml.required">
378
			<or>
379
				<not>
380
					<available file="lib/schema/eml-2.0.1/eml.xsd" />
381
				</not>
382
				<not>
383
					<available file="lib/schema/eml-2.0.0/eml.xsd" />
384
				</not>
385
				<not>
386
					<available file="lib/schema/eml-2.1.0/eml.xsd" />
387
				</not>
388
				<not>
389
					<available
390
						file="lib/dtd/eml-dataset-2.0.0beta6.dtd" />
391
				</not>
392
			</or>
393
		</condition>
394
395
		<condition property="ecogrid.required">
396
			<or>
397
				<not>
398
					<available file="${ecogrid-dir}/build.properties" />
399
				</not>
400
				<not>
401
					<available
402
						file="${ecogrid-dir}/buildfiles/metacatImpl.xml" />
403
				</not>
404
			</or>
405
		</condition>
406
407
	</target>
408
409
	<target name="prepare" depends="init">
410
		<mkdir dir="${build.dir}" />
411
		<mkdir dir="${build.src}" />
412
		<mkdir dir="${build.dest}" />
413
		<mkdir dir="${build.javadocs}" />
414
		<mkdir dir="${build.tmp}" />
415
416
		<copy todir="${build.src}" filtering="yes">
417
			<fileset dir="${srcdir}">
418
				<include name="edu/**" />
419
				<include name="com/**" />
420
				<include name="org/**" />
421
				<!-- include name="java/**" / -->
422
				<include name="**/*.sql" />
423
				<exclude name="**/CVS*" />
424
				<exclude name="**/.#*" />
425 5034 daigle
				<exclude name="edu/ucsb/nceas/workflowscheduler/**" />
426 4969 daigle
			</fileset>
427
		</copy>
428
		<available file="lib/style/common/emlb6toeml2" type="dir"
429
			property="styles.not.needed" />
430
	</target>
431
432 4962 leinfelder
	<target name="generateStubs" depends="prepare">
433 4969 daigle
		<echo
434
			message=" Generating stubs for execution service from ${/tmp/KeplerWebService.wsdl}" />
435
		<axis-wsdl2java verbose="true" output="${srcdir}"
436
			url="/tmp/KeplerWebService.wsdl" />
437 4962 leinfelder
	</target>
438 1939 brooke
439 5295 jones
	<target name="compile" depends="dataone-service,prepare,utilities"
440 4969 daigle
		description="Compiles java code to build dir, and copies metacat props files there">
441 113 jones
442 4969 daigle
		<javac srcdir="${build.src}" destdir="${build.dest}"
443
			debug="${debug}"
444
			excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
445
			<classpath>
446
				<path refid="compile.classpath" />
447
			</classpath>
448
		</javac>
449
	</target>
450 1939 brooke
451 5328 jones
	<target name="jar" depends="compile,geteml,getd1schemas"
452 4969 daigle
		description="Compiles and jars metacat java code to metacat.jar in build dir ">
453 1311 berkley
454 4969 daigle
		<delete file="${build.dir}/${name}.jar" />
455
		<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
456
			excludes="**/protocols/ **/harvesterClient/" />
457
	</target>
458 113 jones
459 4969 daigle
	<target name="protocol" depends="compile"
460
		description="Compiles and jars protocol java code to protocol.jar in build dir">
461
		<delete file="${build.dir}/protocol.jar" />
462
		<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
463
			includes="**/protocols/" />
464
	</target>
465 4959 daigle
466 4969 daigle
	<target name="utilities" depends="config,getpeerutilities"
467
		if="utilities.required">
468
		<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
469
		<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
470
		<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
471
	</target>
472 1780 jones
473 4969 daigle
	<target name="getpeerutilities" depends="prepare"
474
		if="peer.utilities.required"
475
		description="Checks utilities out of svn and copies it to your utilitiesdir if it does not already exist">
476 5176 daigle
		<echo message="Exporting utilities files from svn repository:" />
477 4969 daigle
		<svn>
478
			<export srcUrl="${svn.utilitiesUrl}"
479
				destPath="${utilitiesdir}" />
480
		</svn>
481 2461 sgarg
482 4969 daigle
		<!--  ant dir="${utilitiesdir}" inheritAll="false"  target="dist" / -->
483
	</target>
484 1780 jones
485 4969 daigle
	<target name="getutilities" depends="prepare"
486 5176 daigle
		description="Checks utility out of svn and copies it to your metacat sandbox">
487 5051 daigle
		<svn>
488
			<export srcUrl="${svn.utilitiesUrl}"
489 5866 leinfelder
				destPath="${utilitiesdir}" force="true" />
490 5051 daigle
		</svn>
491 4969 daigle
	</target>
492 1780 jones
493 4969 daigle
	<target name="client" depends="utilities, prepare"
494
		description="Compiles metacat-client java code to build dir">
495
		<javac srcdir="${build.src}" destdir="${build.dest}"
496
			includes="edu/ucsb/nceas/metacat/client/*">
497
			<classpath>
498
				<path refid="compile.classpath" />
499
			</classpath>
500
		</javac>
501
	</target>
502 2748 costa
503 4969 daigle
	<target name="clientjar" depends="client"
504
		description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
505
		<delete file="${build.dir}/${name}-client.jar" />
506
		<jar jarfile="${build.dir}/${name}-client.jar"
507
			basedir="${build.dest}" includes="**/metacat/client/" />
508
	</target>
509 1950 costa
510 4969 daigle
	<target name="advancedsearchjar" depends="compile"
511
		description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
512
		<delete file="${build.dir}/advancedsearch.jar" />
513
		<jar jarfile="${build.dir}/advancedsearch.jar"
514
			basedir="${build.dest}" includes="**/metacat/advancedsearch/" />
515
	</target>
516 1950 costa
517 4969 daigle
	<target name="harvester" depends="client"
518
		description="Compiles harvester java code to build dir">
519
		<javac srcdir="${build.src}" destdir="${build.dest}"
520
			includes="edu/ucsb/nceas/metacat/harvesterClient/*">
521
			<classpath>
522
				<path refid="compile.classpath" />
523
			</classpath>
524
		</javac>
525
	</target>
526 1939 brooke
527 4969 daigle
	<target name="harvesterjar" depends="harvester"
528
		description="Compiles and jars harvester java code to harvester.jar in build dir">
529
		<delete file="${build.dir}/harvester.jar" />
530
		<jar jarfile="${build.dir}/harvester.jar"
531
			basedir="${build.dest}" includes="**/metacat/harvesterClient/" />
532
	</target>
533 2228 sgarg
534 4969 daigle
	<target name="harvestListEditorDist" depends="harvesterjar"
535
		description="Prepares a distribution of the Harvest List Editor tool">
536
		<mkdir dir="${dist.dir.hle}" />
537
		<delete dir="${ver.dir.hle}" />
538
		<mkdir dir="${ver.dir.hle}" />
539
		<copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar" />
540
		<copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar" />
541
		<copy todir="${ver.dir.hle}"
542
			file="lib/harvester/harvestList.xsd" />
543
		<copy todir="${ver.dir.hle}"
544
			file="lib/harvester/harvestListEditor.bat" />
545
		<copy todir="${ver.dir.hle}"
546
			file="lib/harvester/harvestListEditor.sh" />
547
		<delete file="./harvest-list-editor-${release}.zip" />
548
		<zip zipfile="./harvest-list-editor-${release}.zip"
549
			basedir="${ver.dir.hle}" />
550
		<delete file="./harvest-list-editor-${release}.tar.gz" />
551
		<tar tarfile="./harvest-list-editor-${release}.tar"
552
			basedir="${ver.dir.hle}" />
553
		<gzip zipfile="./harvest-list-editor-${release}.tar.gz"
554
			src="./harvest-list-editor-${release}.tar" />
555
		<delete file="./harvest-list-editor-${release}.tar" />
556
	</target>
557 1939 brooke
558 4969 daigle
	<target name="geteml" depends="getemlpre2,geteml2+,getConversionXSL"
559
		if="eml.required" description="Calls getemlpre2 and geteml2+ targets" />
560 2175 tao
561 4969 daigle
	<target name="getemlpre2" depends="prepare" if="eml.required"
562 5176 daigle
		description="Checks EML-beta6 out of svn and copies dtds and xsl to your metacat sandbox">
563
		<svn>
564
			<export srcUrl="${svn.emlBetaUrl}"
565
				destPath="${build.tmp}/eml_${eml-beta-tag}" />
566
		</svn>
567 4969 daigle
		<mkdir dir="lib/dtd" />
568
		<copy todir="lib/dtd" filtering="yes">
569
			<fileset
570 5176 daigle
				dir="${build.tmp}/eml_${eml-beta-tag}">
571 4969 daigle
				<include name="*.dtd" />
572
			</fileset>
573
			<mapper type="glob" from="eml-*.dtd"
574
				to="eml-*-${eml-version}.dtd" />
575
		</copy>
576 2175 tao
577 4969 daigle
		<copy todir="${style-common-cvsrelpath}" filtering="yes">
578
			<fileset
579 5176 daigle
				dir="${build.tmp}/eml_${eml-beta-tag}/style">
580 4969 daigle
				<include name="**/*.xsl" />
581
			</fileset>
582
		</copy>
583
	</target>
584 2175 tao
585 4969 daigle
	<target name="geteml2+" depends="prepare" if="eml.required"
586 5176 daigle
		description="Checks eml-2 out of svn and copies schema and xsl to your metacat sandbox">
587
		<svn>
588
			<export srcUrl="${svn.eml200SchemaUrl}"
589
				destPath="${build.tmp}/eml_${eml2_0_0-schema-tag}" />
590
		</svn>
591 4969 daigle
		<mkdir dir="lib/schema/eml-2.0.0" />
592
		<copy todir="lib/schema/eml-2.0.0" filtering="yes">
593
			<fileset
594 5176 daigle
				dir="${build.tmp}/eml_${eml2_0_0-schema-tag}">
595 4969 daigle
				<include name="*.xsd" />
596
			</fileset>
597 1939 brooke
598 4969 daigle
			<!-- shouldn't we have a mapper here like this??
599
				<mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
600
601
				Jing's code didn't nave one - does it need to be added?
602
				NOTE that eml-version is set to beta 6, so this would need changing -->
603 4080 daigle
604 4969 daigle
		</copy>
605
		<!-- <antcall target="copyxsl">
606
			<param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
607
			<param name="dirname" value="eml-2.0.0" />
608
			</antcall> -->
609 2175 tao
610 4969 daigle
		<!-- Checkout eml201 for given schema tag-->
611 5176 daigle
		<svn>
612
			<export srcUrl="${svn.eml201SchemaUrl}"
613
				destPath="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
614
		</svn>
615 4969 daigle
		<mkdir dir="lib/schema/eml-2.0.1" />
616
		<copy todir="lib/schema/eml-2.0.1" filtering="yes">
617
			<fileset
618 5176 daigle
				dir="${build.tmp}/eml_${eml2_0_1-schema-tag}">
619 4969 daigle
				<include name="*.xsd" />
620
			</fileset>
621
		</copy>
622 1939 brooke
623 4969 daigle
		<!-- Checkout eml201 again for given style sheet tag-->
624
		<!-- echo>Enter CVS password: </echo>
625
			<cvs cvsRoot="${cvsroot}"
626
			package="${eml-module}"
627
			tag="${eml2_0_1-style-tag}"
628
			dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
629
			<antcall target="copyxsl">
630
			<param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
631
			<param name="dirname" value="eml-2.0.1" />
632
			</antcall -->
633 2175 tao
634 4969 daigle
		<!-- Checkout eml210 for given schema tag-->
635 5176 daigle
		<svn>
636
			<export srcUrl="${svn.eml210SchemaUrl}"
637
				destPath="${build.tmp}/eml_${eml2_1_0-schema-tag}" />
638
		</svn>
639 4969 daigle
		<mkdir dir="lib/schema/eml-2.1.0" />
640
		<copy todir="lib/schema/eml-2.1.0" filtering="yes">
641
			<fileset
642 5176 daigle
				dir="${build.tmp}/eml_${eml2_1_0-schema-tag}">
643 4969 daigle
				<include name="*.xsd" />
644
			</fileset>
645
		</copy>
646 1612 tao
647 4969 daigle
		<!-- Checkout eml210 for given style sheet tag-->
648 5176 daigle
		<svn>
649
			<export srcUrl="${svn.eml2StyleUrl}"
650
				destPath="${build.tmp}/eml_${eml2-style-tag}" />
651
		</svn>
652 4969 daigle
		<antcall target="copyxsl">
653
			<param name="cvs.tagname" value="${eml2-style-tag}" />
654
			<!-- param name="dirname" value="eml-2.1.0" / -->
655
			<param name="dirname" value="eml-2" />
656
		</antcall>
657 5709 leinfelder
658
		<!-- Checkout eml210 for given schema tag-->
659
		<svn>
660
			<export srcUrl="${svn.eml211SchemaUrl}"
661
				destPath="${build.tmp}/eml_${eml2_1_1-schema-tag}" />
662
		</svn>
663
		<mkdir dir="lib/schema/eml-2.1.1" />
664
		<copy todir="lib/schema/eml-2.1.1" filtering="yes">
665
			<fileset
666
				dir="${build.tmp}/eml_${eml2_1_1-schema-tag}">
667
				<include name="*.xsd" />
668
			</fileset>
669
		</copy>
670 4969 daigle
	</target>
671 5347 berkley
672
	<!-- copies the dataone schemas from a local source if you don't want
673
	     to have to make a ton of svn calls when you're testing (see getd1schemas) -->
674
	<target name="install-dataone" depends="init">
675
	  <property name="dataone-shema-dir" value="../cicore/schemas"/>
676 5625 berkley
	  <property name="install-dataone-schema-dir" value="${installdir}/schema/${dataone-schema-tag}"/>
677 5347 berkley
	  <mkdir dir="${install-dataone-schema-dir}"/>
678
	  <copy todir="${install-dataone-schema-dir}">
679
	    <fileset dir="${dataone-shema-dir}">
680
	      <include name="**/*.xsd"/>
681
	    </fileset>
682
	  </copy>
683
	</target>
684 2353 sgarg
685 5347 berkley
	<!-- get the dataone schemas from svn -->
686 5328 jones
	<target name="getd1schemas" depends="prepare"
687
		description="Checkout dataone schemas from svn and copy to metacat sandbox">
688 5625 berkley
		<delete dir="${build.tmp}/${dataone-schema-tag}"/>
689 5328 jones
        <svn>
690
            <export srcUrl="${svn.dataone-0.1-schema-url}"
691 5625 berkley
                destPath="${build.tmp}/${dataone-schema-tag}" />
692 5328 jones
        </svn>
693 5625 berkley
        <mkdir dir="lib/schema/${dataone-schema-tag}" />
694
        <copy todir="lib/schema/${dataone-schema-tag}" filtering="yes">
695
            <fileset dir="${build.tmp}/${dataone-schema-tag}">
696 5328 jones
                <include name="*.xsd" />
697
            </fileset>
698
        </copy>
699
    </target>
700
701 4969 daigle
	<target name="copyxsl"
702 5176 daigle
		description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
703 3034 perry
704 4969 daigle
		<delete file="${style-common-cvsrelpath}/${eml-css}" />
705 3034 perry
706 4969 daigle
		<copy todir="${style-common-cvsrelpath}/${dirname}"
707
			filtering="yes">
708
			<fileset
709 5176 daigle
				dir="${build.tmp}/eml_${cvs.tagname}/style/eml">
710 4969 daigle
				<include name="**/*.xsl" />
711
			</fileset>
712
		</copy>
713 3034 perry
714
715 4969 daigle
		<!-- now copy default css from eml module and put it in style-common-path
716
			dir with a new name, so other skin-specific css can import it if reqd -->
717
		<copy
718 5176 daigle
			file="${build.tmp}/eml_${cvs.tagname}/${eml-module.default.css}"
719 4969 daigle
			tofile="${style-common-cvsrelpath}/${eml-css}" />
720 3034 perry
721 4969 daigle
	</target>
722 3034 perry
723 4969 daigle
	<target name="correctEML201Docs" depends="jar"
724
		description="Uses the ant  task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
725
		<copy todir="${build.dir}" file="lib/metacat.properties"
726
			filtering="yes" />
727
		<java
728
			classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector">
729
			<classpath>
730
				<path refid="compile.classpath" />
731
				<fileset dir="${build.dir}">
732
					<include name="${name}.jar" />
733
				</fileset>
734
			</classpath>
735
		</java>
736
	</target>
737 3034 perry
738 4969 daigle
	<target name="install-spatial" depends="jar,clientjar,harvesterjar"
739
		description="Installs spatial option for metacat">
740 3034 perry
741 4969 daigle
		<property name="spatial.dir" value="./lib/spatial" />
742
		<property name="spatial.geoserver.dir"
743
			value="${spatial.dir}/geoserver" />
744
		<property name="spatial.webinf-mods"
745
			value="${spatial.dir}/WEB-INF" />
746 3034 perry
747 4969 daigle
		<!-- Copy geoserver libs into ${war.lib} -->
748
		<copy todir="${war.lib}" filtering="no">
749
			<fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
750
				<include name="**" />
751
			</fileset>
752
		</copy>
753 5872 leinfelder
754
		<copy todir="${dist.dir}">
755
			<fileset dir="./lib/spatial/geoserver" includes="*.war" />
756
		</copy>
757 1952 jones
758 4969 daigle
	</target>
759 4080 daigle
760 4969 daigle
	<target name="install" depends="build-metacat"
761
		description="* Full Install For Development *">
762
		<copy file="${dist.dir}/${metacat.context}.war"
763
			todir="${app.deploy.dir}" />
764 5347 berkley
               <!-- <copy file="${dist.dir}/${metacat.context}.war"
765
                        todir="${app.deploy.dir2}" />-->
766 4969 daigle
		<delete dir="${app.deploy.dir}/${metacat.context}" />
767 5347 berkley
		<!--<delete dir="${app.deploy.dir2}/${metacat.context}" />-->
768 5872 leinfelder
		<copy file="${dist.dir}/geoserver.war"
769
					todir="${app.deploy.dir}" />
770 4969 daigle
		<tstamp>
771
			<format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa" />
772
		</tstamp>
773
		<echo>Dev install completed at ${NOW}</echo>
774
	</target>
775 2343 sgarg
776 5872 leinfelder
	<target name="build-metacat" depends="install-ecogrid, install-spatial"
777 4969 daigle
		description="Build Metacat">
778
	</target>
779 2343 sgarg
780 4969 daigle
	<target name="install-ecogrid" depends="warPrepare, get-ecogrid"
781
		if="enable.ecogrid" description="Install Ecogrid Compentent">
782
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="clean"
783
			inheritall="false">
784
			<property name="context" value="${metacat.context}" />
785
			<property name="target" value="${ecogrid-target-name}" />
786
		</ant>
787
		<ant antfile="build.xml" dir="${ecogrid-dir}" target="war"
788
			inheritall="false">
789
			<property name="context" value="${metacat.context}" />
790
			<property name="target" value="${ecogrid-target-name}" />
791 5473 berkley
			<property name="metacat.dir" value="${basedir}"/>
792 4969 daigle
		</ant>
793
		<!-- war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
794
			<webinf dir="${ecogrid-dir}/lib">
795
			<include name="server-config.wsdd"/>
796
			</webinf>
797
			</war -->
798
		<copy file="${ecogrid-dir}/build/${metacat.context}.war"
799
			todir="${dist.dir}" overwrite="true" />
800 2052 sgarg
801
802 4969 daigle
	</target>
803 2052 sgarg
804 4969 daigle
	<target name="get-ecogrid" depends="init"
805
		description="Check out ecogrid module" if="ecogrid.required">
806
		<svn>
807 5709 leinfelder
			<export srcUrl="${svn.ecogridUrl}" force="true"
808 4969 daigle
				destPath="${ecogrid-dir}" />
809
		</svn>
810
	</target>
811 2052 sgarg
812 4969 daigle
	<!-- target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
813
		<ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
814
		<property name="context" value="${metacat.context}"/>
815
		<property name="target" value="${ecogrid-target-name}"/>
816
		<property name="metacat.dir" value="."/>
817
		<property name="hostname" value="${ecogrid.hostname}"/>
818
		<property name="port" value="${config.port}"/>
819
		</ant>
820
		</target -->
821 1952 jones
822 4969 daigle
	<target name="clean-ecogrid-server-config-wsdd" depends="init"
823
		description="Automately generate wsdd for ecogrid service">
824
		<delete
825
			file="${app.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd" />
826
	</target>
827
828
	<target name="install-skin" depends="init"
829
		description="Install a Skin">
830
831
		<input message="Please enter name of the skin"
832
			addproperty="skin-name" />
833
834
		<mkdir dir="${installdir}/style/skins/${skin-name}" />
835
		<copy todir="${installdir}/style/skins/${skin-name}"
836
			filtering="yes">
837
			<fileset dir="lib/style/skins/${skin-name}">
838
				<exclude name="**/*.png" />
839
				<exclude name="**/*.gif" />
840
				<exclude name="**/*.jpg" />
841
				<exclude name="**/CVS*" />
842
				<exclude name="**/.#*" />
843
			</fileset>
844
		</copy>
845
		<copy todir="${installdir}/style/skins/${skin-name}"
846
			filtering="no">
847
			<fileset dir="lib/style/skins/${skin-name}">
848
				<include name="**/*.png" />
849
				<include name="**/*.gif" />
850
				<include name="**/*.jpg" />
851
				<exclude name="**/CVS*" />
852
				<exclude name="**/.#*" />
853
			</fileset>
854
		</copy>
855
		<copy todir="${installdir}/style/common" filtering="yes">
856
			<fileset dir="lib/style/common">
857
				<include name="*.js" />
858
				<include name="*.jsp" />
859
				<include name="*.css" />
860
				<exclude name="*.png" />
861
				<exclude name="*.gif" />
862
				<exclude name="*.jpg" />
863
				<exclude name="**/CVS*" />
864
				<exclude name="**/.#*" />
865
			</fileset>
866
		</copy>
867
		<!--
868
			<mkdir dir="${installdir}/style/skins/${skin-name}/images" />
869
			<copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
870
			<fileset dir="lib/style/skins/${skin-name}/images">
871
			<include name="*.png"/>
872
			<include name="*.gif"/>
873
			<include name="*.jpg"/>
874
			</fileset>
875
			</copy>
876
		-->
877
878
		<echo message="Install Skin completed." />
879
	</target>
880
881
	<target name="war" depends="warPrepare,install-spatial"
882
		description="Create a web archive (WAR) for servlet deployment">
883
		<mkdir dir="${dist.dir}" />
884
		<war destfile="${dist.dir}/${metacat.context}.war"
885
			webxml="${build.war}/web.xml">
886
			<fileset dir="${war.context}" />
887
			<lib dir="${war.lib}" />
888
			<webinf dir="${war.webinf}" />
889
		</war>
890
	</target>
891
892
	<target name="warPrepare"
893
		depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare"
894
		description="Prepare files for creating a web archive (WAR)">
895
896
		<property name="war.lib" value="${build.war}/lib" />
897
		<property name="war.webinf" value="${build.war}/WEB-INF" />
898
		<property name="war.context"
899
			value="${build.war}/${metacat.context}" />
900
		<property name="war.webinf.sql" value="${war.webinf}/sql" />
901
		<property name="war.webinf.scripts"
902
			value="${war.webinf}/scripts" />
903
		<property name="war.context.cgi" value="${war.context}/cgi-bin" />
904
		<property name="war.context.docs" value="${war.context}/docs" />
905
		<property name="war.context.temp" value="${war.context}/temp" />
906
		<property name="war.context.templates"
907
			value="${war.context}${style-common-relpath}/templates" />
908
		<mkdir dir="${war.lib}" />
909
		<mkdir dir="${war.webinf}" />
910
		<mkdir dir="${war.context}" />
911
		<mkdir dir="${war.webinf.sql}" />
912
		<mkdir dir="${war.context.cgi}" />
913
		<mkdir dir="${war.context.docs}" />
914
		<mkdir dir="${war.context.temp}" />
915
		<mkdir dir="${war.context.templates}" />
916
917
		<!--copy file="${lib.dir}/${jdbc.lib.postgres}" todir="${war.lib}" / -->
918
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver1}" todir="${war.lib}" / -->
919
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver2}" todir="${war.lib}" / -->
920
		<!--copy file="${lib.dir}/${jdbc.lib.sqlserver3}" todir="${war.lib}" / -->
921
		<copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
922
		<copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
923
		<copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
924
		<copy todir="${war.lib}" filtering="no">
925
			<fileset dir="lib">
926
				<!--
927
					<not>
928
					<filename name="${jdbc-jar-name}"/>
929
					</not>
930
				-->
931
				<include name="*.jar" />
932 5297 jones
				<exclude name="maven-ant-tasks*.jar" />
933 4969 daigle
			</fileset>
934
			<fileset dir="lib">
935
				<include name="xalan.jar" />
936
				<include name="gwt*.jar" />
937
			</fileset>
938
			<fileset dir="lib/oaipmh">
939
				<include name="oaicat.jar" />
940
			</fileset>
941
		</copy>
942
		<!-- MCD copy file="lib/web.xml.${tomcatversion}"
943
			tofile="${build.war}/web.xml" / -->
944
		<!-- MCD added next - Remove the tomcat5 reference-->
945
		<copy file="lib/web.xml.tomcat5" tofile="${build.war}/web.xml" />
946
		<copy file="lib/metacat.properties" todir="${war.webinf}"
947
			filtering="yes" />
948
		<copy file="lib/metacat.properties.metadata.xml"
949
			todir="${war.webinf}" filtering="no" />
950
		<copy file="lib/org.properties.metadata.xml"
951
			todir="${war.webinf}" filtering="no" />
952
		<copy file="lib/auth.properties.metadata.xml"
953
			todir="${war.webinf}" filtering="no" />
954
		<copy todir="${war.webinf}" filtering="yes">
955
			<fileset dir="lib">
956
				<include name="skin.configs/**" />
957
			</fileset>
958
		</copy>
959
		<copy file="lib/log4j.properties" todir="${war.webinf}"
960
			filtering="yes" />
961
		<copy todir="${war.context}" filtering="no">
962
			<fileset dir="lib">
963
				<include name="**/*.jpg" />
964
				<include name="**/*.png" />
965
				<include name="**/*.gif" />
966
				<include name="LiveMap_30/**" />
967
				<include name="oaipmh/**" />
968
			</fileset>
969
		</copy>
970
		<copy todir="${war.context}" filtering="yes">
971
			<fileset dir="lib">
972
				<exclude name="*.jar" />
973
				<exclude name="*.properties" />
974
				<exclude name="*.metadata.xml" />
975
				<exclude name="web.xml" />
976
				<exclude name="**/*.jpg" />
977
				<exclude name="**/*.png" />
978
				<exclude name="**/*.gif" />
979
				<exclude name="lsid_lib/**" />
980
				<exclude name="lsid_conf/**" />
981
				<exclude name="LiveMap_30/**" />
982
				<exclude name="oaipmh/**" />
983
				<exclude name="skin.configs/**" />
984 5865 leinfelder
				<exclude name="spatial/geoserver/**" />
985 4969 daigle
			</fileset>
986
		</copy>
987 5865 leinfelder
		<copy todir="${war.context}" filtering="no">
988
			<fileset dir="lib">
989
				<include name="spatial/geoserver/data/**" />
990
			</fileset>
991
		</copy>
992 4969 daigle
		<copy todir="${war.context.docs}" filtering="yes">
993
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
994
		</copy>
995
		<copy todir="${war.context.docs}" filtering="no">
996
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
997
		</copy>
998
		<copy todir="${war.webinf.sql}" filtering="yes">
999
			<fileset dir="src">
1000
				<include name="**/*.sql" />
1001
			</fileset>
1002
		</copy>
1003
		<copy todir="${war.webinf.scripts}" filtering="yes">
1004
			<fileset dir="src/scripts" />
1005
		</copy>
1006
		<copy todir="${war.webinf.scripts}"
1007
			file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
1008
			failonerror="false" />
1009
1010
		<copy file="src/perl/register-dataset.cgi"
1011
			todir="${war.context.cgi}" />
1012
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1013
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1014
1015
		<!-- registry cgi section -->
1016
		<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
1017
			used in readDocumentFromMetacat -->
1018
		<!-- TODO MCD copy temp files to actual location using config util?? -->
1019
		<copy todir="${war.context.temp}" filtering="yes">
1020
			<fileset dir="lib/style/common/emlb6toeml2">
1021
				<include name="*.xsl" />
1022
				<include name="*.xml" />
1023
			</fileset>
1024
		</copy>
1025
		<available file="lib/style/common/emlb6toeml2" type="dir"
1026
			property="styles.not.needed" />
1027
1028
		<!-- ldap cgi section -->
1029
		<copy todir="${war.context.templates}">
1030
			<fileset dir="lib/style/common/templates">
1031
				<!-- SCW: Copy all files -->
1032
			</fileset>
1033
		</copy>
1034
	</target>
1035
1036
	<target name="cgiPrepare" if="build.perl">
1037
		<exec dir="src/perl/Metacat/" executable="make">
1038 4820 daigle
			<arg value="clean" />
1039 4969 daigle
		</exec>
1040
		<exec dir="src/perl/Metacat/" executable="perl">
1041 4369 daigle
			<arg value="Makefile.PL" />
1042
		</exec>
1043 4820 daigle
		<exec dir="src/perl/Metacat/" executable="make" />
1044 4369 daigle
	</target>
1045 4969 daigle
1046 4550 daigle
	<target name="testPrepare"
1047 4435 daigle
		description="Copies test files into the war directories">
1048
		<echo>in testPrepare</echo>
1049 4969 daigle
		<property name="war.context.test"
1050
			value="${build.war}/${metacat.context}/test" />
1051 4435 daigle
		<mkdir dir="${war.context.test}" />
1052 4969 daigle
		<copy todir="${war.context.test}" filtering="yes">
1053
			<fileset dir="test/servertestfiles">
1054
				<include name="*/**" />
1055
			</fileset>
1056 4435 daigle
		</copy>
1057
	</target>
1058 1929 brooke
1059 4969 daigle
	<target name="getConversionXSL" depends="prepare"
1060
		unless="styles.not.needed"
1061
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1062 2497 sgarg
1063 5176 daigle
		<svn>
1064
			<export srcUrl="${svn.eml2StyleUrl}"
1065
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1066
		</svn>
1067 2343 sgarg
1068 4969 daigle
		<mkdir dir="lib/style/common/emlb6toeml2" />
1069
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1070
			<fileset
1071 5176 daigle
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1072 4969 daigle
				<include name="*.xsl" />
1073
				<include name="*.xml" />
1074
			</fileset>
1075
		</copy>
1076
	</target>
1077 1929 brooke
1078 4969 daigle
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1079
		<mkdir dir="${build.tests}" />
1080 5753 leinfelder
		<copy todir="${build.tests}" encoding="UTF-8">
1081 4969 daigle
			<fileset dir="${testdir}">
1082
				<include name="edu/**" />
1083
			</fileset>
1084
		</copy>
1085 5753 leinfelder
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1086 4121 daigle
1087 4969 daigle
		<!-- copy and compile the tests into a jar file -->
1088
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1089 5753 leinfelder
			debug="on" includes="**/*.java" encoding="UTF-8">
1090 4969 daigle
			<classpath>
1091
				<path refid="compile.classpath" />
1092
				<fileset dir="${build.dir}">
1093
					<include name="${name}.jar" />
1094
					<include name="${name}-client.jar" />
1095
					<include name="harvester.jar" />
1096
				</fileset>
1097
			</classpath>
1098
		</javac>
1099 204 jones
1100 4969 daigle
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1101
			basedir="${build.tests}" includes="**/*.class" />
1102
	</target>
1103 971 tao
1104 4969 daigle
	<target name="test" depends="testprep"
1105
		description="Uses the ant junit task to run all JUnit tests">
1106 1822 jones
1107 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1108
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1109
			haltonerror="no">
1110 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1111 4969 daigle
			<classpath>
1112 5311 daigle
				<path refid="test.classpath" />
1113 4969 daigle
				<fileset dir="${build.dir}">
1114
					<include name="${name}.jar" />
1115
					<include name="${name}-client.jar" />
1116
					<include name="harvester.jar" />
1117
					<include name="${name}-junittests.jar" />
1118
				</fileset>
1119
			</classpath>
1120 971 tao
1121 4969 daigle
			<formatter type="plain" />
1122 971 tao
1123 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1124
				<fileset dir="${build.tests}">
1125 5009 daigle
					<include name="**/*.class" />
1126 4969 daigle
					<exclude name="**/MCTestCase.class" />
1127
					<exclude name="**/ClientViewHelperTest.class" />
1128
				</fileset>
1129
			</batchtest>
1130
		</junit>
1131
	</target>
1132 1103 tao
1133 4969 daigle
	<target name="runonetest" depends="testprep"
1134
		description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1135 1500 tao
1136 4969 daigle
		<echo>testtorun: ${testtorun}</echo>
1137 1939 brooke
1138 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1139
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1140
			haltonerror="no" showoutput="yes">
1141 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1142 4969 daigle
			<classpath>
1143 5311 daigle
				<path refid="test.classpath" />
1144 4969 daigle
				<fileset dir="${build.dir}">
1145
					<include name="${name}.jar" />
1146
					<include name="${name}-client.jar" />
1147
					<include name="harvester.jar" />
1148
					<include name="${name}-junittests.jar" />
1149
				</fileset>
1150
			</classpath>
1151 1500 tao
1152 4969 daigle
			<formatter type="plain" />
1153 1500 tao
1154 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1155
				<fileset dir="${build.tests}">
1156
					<include name="**/${testtorun}.class" />
1157
				</fileset>
1158
			</batchtest>
1159
		</junit>
1160
	</target>
1161 1500 tao
1162 4969 daigle
	<target name="testharvester" depends="testprep"
1163
		description="Uses the ant junit task to test only the Harvester code">
1164
		<junit printsummary="yes" haltonfailure="off" fork="yes"
1165
			haltonerror="off">
1166
			<classpath>
1167
				<path refid="compile.classpath" />
1168
				<fileset dir="${build.dir}">
1169
					<include name="${name}.jar" />
1170
					<include name="${name}-client.jar" />
1171
					<include name="harvester.jar" />
1172
					<include name="${name}-junittests.jar" />
1173
				</fileset>
1174
			</classpath>
1175
			<formatter type="plain" />
1176
			<batchtest fork="yes" todir="${build.dir}">
1177
				<fileset dir="${build.tests}">
1178
					<include name="**/harvesterClient/*.class" />
1179
				</fileset>
1180
			</batchtest>
1181
		</junit>
1182
	</target>
1183 2135 costa
1184 4969 daigle
	<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1185
	<target name="nettest" depends="install"
1186
		description="compiles and runs the metacatnettest code">
1187 2175 tao
1188 4969 daigle
		<echo>
1189
			*********************************** Please run ant
1190
			gethttpclient first! ***********************************
1191
		</echo>
1192
		<!-- copy and compile the tests into a jar file -->
1193
		<mkdir dir="${build.metacatnettest}" />
1194
		<javac srcdir="${junitnettestsdir}"
1195
			destdir="${build.metacatnettest}" includes="**/*.java">
1196
			<classpath>
1197
				<path refid="compile.classpath" />
1198
				<fileset dir="${build.dir}">
1199
					<include name="${name}.jar" />
1200
				</fileset>
1201
			</classpath>
1202
		</javac>
1203 1103 tao
1204 4969 daigle
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1205
			basedir="${build.metacatnettest}" includes="**/*.class" />
1206 1103 tao
1207 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1208
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1209
			haltonerror="no">
1210
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1211
			<classpath>
1212
				<path refid="compile.classpath" />
1213
				<fileset dir="${build.dir}">
1214
					<include name="${name}.jar" />
1215
					<include name="${name}-junitnettests.jar" />
1216
				</fileset>
1217
			</classpath>
1218 1103 tao
1219 4969 daigle
			<formatter type="plain" />
1220 1103 tao
1221 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1222
				<fileset dir="${build.metacatnettest}">
1223
					<include name="**/*.class" />
1224
				</fileset>
1225
			</batchtest>
1226
		</junit>
1227
	</target>
1228 1103 tao
1229 4969 daigle
	<target name="cleanweb" depends="clean"
1230
		description="deletes tomcat web context dir and all its contents">
1231
		<delete dir="${installdir}" />
1232
	</target>
1233 1522 berkley
1234
1235 4969 daigle
	<target name="clean" depends="init"
1236
		description="deletes build dir and files that can be regenerated form the release">
1237
		<delete dir="${build.dir}" />
1238
		<delete dir="${dist.dir}" />
1239
	</target>
1240 2320 jones
1241 4098 daigle
	<target name="localclean" depends="clean"
1242 4969 daigle
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1243
		<delete file="lib/utilities.jar" />
1244
	</target>
1245 113 jones
1246 4969 daigle
	<target name="fullclean" depends="localclean"
1247
		description="deletes code and eml">
1248
		<delete includeEmptyDirs="true" failonerror="false">
1249
			<fileset dir="${style-common-cvsrelpath}">
1250
				<include name="${eml-css}" />
1251
				<include name="eml-*/*.xsl" />
1252
				<include name="eml-*" />
1253
			</fileset>
1254
			<fileset dir="${schema-cvsrelpath}">
1255
				<include name="eml-*/*.xsd" />
1256
			</fileset>
1257 5841 tao
			<fileset dir="${ecogrid-dir}"/>
1258 5809 leinfelder
			<fileset dir="lib/style/common/emlb6toeml2"/>
1259
			<fileset dir="lib/dtd"/>
1260
			<fileset dir="lib/schema"/>
1261 4969 daigle
		</delete>
1262
	</target>
1263 113 jones
1264 4969 daigle
	<target name="jdoc" depends="prepare"
1265
		description="generates javadoc documentation">
1266
		<javadoc packagenames="edu.ucsb.nceas.*"
1267
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1268
			version="true" use="true" windowtitle="${Name} API"
1269
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1270
			bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1271
			<classpath>
1272
				<path refid="compile.classpath" />
1273
			</classpath>
1274
		</javadoc>
1275
	</target>
1276 882 jones
1277 4969 daigle
	<target name="dist"
1278 5328 jones
		depends="geteml,getd1schemas,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1279 4969 daigle
		description="prepares a full release distribution">
1280
		<mkdir dir="${dist.dir}" />
1281
		<delete dir="${ver.dir}" />
1282
		<mkdir dir="${ver.dir}" />
1283
		<copy todir="${ver.dir}">
1284
			<fileset dir="."
1285
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1286
		</copy>
1287
		<copy todir="${ver.dir}" file="build.xml" />
1288
		<copy todir="${ver.dir}" file="build.properties" />
1289 806 jones
1290 4969 daigle
		<copy todir="${ver.dir}/docs" filtering="yes">
1291
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1292
		</copy>
1293
		<copy todir="${ver.dir}/docs" filtering="no">
1294
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1295
		</copy>
1296
		<copy todir="${ver.dir}/docs/dev">
1297
			<fileset dir="${build.dir}/docs" />
1298
		</copy>
1299
		<copy todir="${ver.dir}/src">
1300
			<fileset dir="${build.dir}/src" />
1301
		</copy>
1302
1303
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1304
		<copy todir="${ver.dir}/test/servertestfiles">
1305
			<fileset dir="./test/servertestfiles" />
1306
		</copy>
1307
	</target>
1308
1309
	<target name="distbin" depends="build-metacat,war-lsid"
1310
		description="prepares a binary distribution">
1311 4372 daigle
		<copy todir="${dist.dir}">
1312 4969 daigle
			<fileset dir="./src/scripts" />
1313
		</copy>
1314 4372 daigle
		<delete file="./${name}-bin-${release}.zip" />
1315 4969 daigle
		<zip zipfile="./${name}-bin-${release}.zip"
1316
			basedir="${dist.dir}" excludes="metacat-*/**" />
1317 4372 daigle
		<delete file="./${name}-bin-${release}.tar.gz" />
1318 4969 daigle
		<tar tarfile="./${name}-bin-${release}.tar"
1319
			basedir="${dist.dir}" excludes="metacat-*/**" />
1320
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1321
			src="./${name}-bin-${release}.tar" />
1322 4372 daigle
		<delete file="./${name}-bin-${release}.tar" />
1323
	</target>
1324 806 jones
1325 4969 daigle
	<target name="distsrc" depends="dist"
1326
		description="prepares a source distribution">
1327
		<mkdir dir="${ver.src}" />
1328
		<copy todir="${ver.src}">
1329
			<fileset dir="./src" />
1330
		</copy>
1331
		<mkdir dir="${util.dir}" />
1332
		<copy todir="${util.dir}">
1333
			<fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1334
		</copy>
1335 3131 perry
1336 4969 daigle
		<mkdir dir="${ecogrid-dist-dir}" />
1337
		<copy todir="${ecogrid-dist-dir}">
1338
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1339
		</copy>
1340 806 jones
1341 4969 daigle
		<delete file="${ver.dir}/lib/utilities.jar" />
1342 2175 tao
1343 4969 daigle
		<delete file="./${name}-src-${release}.zip" />
1344
		<zip zipfile="./${name}-src-${release}.zip"
1345
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1346
		<delete file="./${name}-src-${release}.tar.gz" />
1347
		<tar tarfile="./${name}-src-${release}.tar"
1348
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1349
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1350
			src="./${name}-src-${release}.tar" />
1351
		<delete file="./${name}-src-${release}.tar" />
1352
		<!--delete dir="${dist.dir}"/ -->
1353
	</target>
1354 2175 tao
1355 4969 daigle
	<target name="deb-package" depends="distbin"
1356
		description="create a debian installation package">
1357
		<delete dir="${deb.pkg.dir}" />
1358
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1359
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1360
			<fileset dir="./src/scripts/debian"
1361
				includes="control postinst" />
1362
		</copy>
1363 2598 harris
1364 4969 daigle
		<mkdir
1365
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1366
		<copy
1367
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1368
			filtering="yes">
1369
			<fileset dir="./src/scripts/debian"
1370
				excludes="control postinst" />
1371
		</copy>
1372
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1373 2598 harris
1374 4969 daigle
		<copy file="${dist.dir}/knb.war"
1375
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1376
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1377
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1378 2737 jones
1379 4969 daigle
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1380
			failonerror="true">
1381
			<arg line="--build debian" />
1382
		</exec>
1383 2737 jones
1384 4969 daigle
		<move file="${pkg.dir}/debian.deb"
1385
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1386
	</target>
1387
1388
	<target name="stylesheettest">
1389
		<xslt in="${input}" out="eml.html"
1390
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1391
			<param name="displaymodule" expression="${displaymodule}" />
1392
			<param name="docid" expression="${input}" />
1393
			<param name="entitytype" expression="${entitytype}" />
1394
			<param name="entityindex" expression="${entityindex}" />
1395
			<outputproperty name="method" value="html" />
1396
			<outputproperty name="standalone" value="yes" />
1397
			<outputproperty name="encoding" value="iso8859_1" />
1398
			<outputproperty name="indent" value="yes" />
1399
		</xslt>
1400
	</target>
1401
1402
1403
	<target name="compilewebclient" depends="prepare">
1404
		<javac srcdir="${build.src}" destdir="${build.dest}"
1405
			includes="**/application/*.java" classpathref="webservicepath" />
1406
	</target>
1407
1408
	<target name="runwebclient" depends="compilewebclient">
1409
		<java
1410
			classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1411
			dir="${build.dest}" fork="yes" classpathref="webservicepath"
1412
			classpath="./lib/utilities.jar" failonerror="true">
1413
			<arg value="${serviceUrl}" />
1414
			<arg value="${docid}" />
1415
		</java>
1416
	</target>
1417
1418
	<target name="spatial_option" depends="prepare"
1419
		description=" -- compiles code for the spatial option">
1420
1421
		<echo message="Compiling the metatcat shapefile creator" />
1422
		<echo message="using the shapelib at: ${shapelib.dir}" />
1423
		<exec dir="." executable="g++" os="Linux, Unix"
1424
			failonerror="true">
1425
			<arg
1426
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1427
		</exec>
1428
1429
		<exec dir="." executable="g++" os="Linux, Unix"
1430
			failonerror="true">
1431
			<arg
1432
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1433
		</exec>
1434
	</target>
1435
1436
	<!-- LSID Authority support -->
1437
	<patternset id="lsid.jars">
1438
		<include name="axis.jar" />
1439
		<include name="commons-discovery-0.2.jar" />
1440
		<include name="jaxrpc.jar" />
1441
		<include name="lsid-client-1.1.1.jar" />
1442
		<include name="lsid-server-1.1.1.jar" />
1443
		<include name="saaj.jar" />
1444
		<include name="wsdl4j-1.5.1.jar" />
1445
		<include name="activation.jar" />
1446
		<include name="castor-0.9.5.jar" />
1447
		<include name="dnsjava-1.3.2.jar" />
1448
		<include name="mail.jar" />
1449
		<include name="commons-logging-1.0.4.jar" />
1450
		<!-- These jars may be needed but seem to not actually be,
1451
			so leaving them out for now
1452
			<include name="axis-ant.jar" />
1453
		-->
1454
		<!--<include name="GenCastor.class" />-->
1455
	</patternset>
1456
	<patternset id="lib.jars">
1457
		<include name="log4j-1.2.12.jar" />
1458
		<include name="utilities.jar" />
1459 5866 leinfelder
		<include name="xerces*.jar" />
1460
		<include name="xalan*.jar" />
1461 4969 daigle
		<include name="xml-apis.jar" />
1462
	</patternset>
1463
1464
	<path id="lsid.classpath">
1465
		<fileset dir="${lsid.lib.dir}">
1466
			<patternset refid="lsid.jars" />
1467
		</fileset>
1468
		<fileset dir="${lib.dir}">
1469 5866 leinfelder
			<patternset refid="lib.jars" />
1470 4969 daigle
		</fileset>
1471
		<fileset dir="${build.dir}">
1472
			<include name="metacat-client.jar" />
1473 5866 leinfelder
			<include name="metacat.jar" />
1474 4969 daigle
		</fileset>
1475
	</path>
1476
1477
	<filterset id="configFilters">
1478
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1479
			value="${config.hostname}" / -->
1480
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1481
			value="${config.port}" / -->
1482
		<!-- MCD BYE filter token="METADATA_LABELS"
1483
			value="${config.metadataLabelLsid}" / -->
1484
		<!-- MCD BYE filter token="METACAT_SERVER"
1485
			value="${config.metacatserver}" / -->
1486
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1487
			value="${config.lsidauthority}" / -->
1488
	</filterset>
1489
1490
	<target name="prepare-lsid" depends="prepare,utilities,clientjar"
1491
		description="Configure files prior to compilation">
1492
		<mkdir dir="${lsid.build.dir}" />
1493
		<!-- Copy the properties file into the build -->
1494
		<copy file="${conf.dir}/metacat-lsid.properties"
1495
			tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1496
			overwrite="true">
1497
			<filterset refid="configFilters" />
1498
		</copy>
1499
		<copy file="${conf.dir}/log4j.properties"
1500
			tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1501
			overwrite="true">
1502
			<filterset refid="configFilters" />
1503
		</copy>
1504
		<!-- Copy config files into the build -->
1505
		<copy todir="${lsid.build.dir}/WEB-INF">
1506
			<fileset dir="${webinf.dir}" includes="**/*.wsdd" />
1507
		</copy>
1508
		<!-- Copy the metadata configuration files into the build -->
1509
		<mkdir
1510
			dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1511
		<copy
1512
			todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1513
			<fileset dir="${conf.dir}" includes="**/*.xml" />
1514
			<fileset dir="${conf.dir}" includes="**/*.xslt" />
1515
			<filterset refid="configFilters" />
1516
		</copy>
1517
		<!-- Copy services files into the build -->
1518
		<mkdir dir="${lsid.build.dir}/services" />
1519
		<copy todir="${lsid.build.dir}/services">
1520
			<fileset dir="${services.dir}" />
1521
			<filterset refid="configFilters" />
1522
		</copy>
1523
		<!-- Copy axis files into the build -->
1524
		<mkdir dir="${lsid.build.dir}" />
1525
		<copy todir="${lsid.build.dir}">
1526
			<fileset dir="${conf.dir}/axis" excludes="*.properties" />
1527
		</copy>
1528
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1529
		<copy todir="${lsid.build.dir}/WEB-INF/classes">
1530
			<fileset dir="${conf.dir}/axis" includes="*.properties" />
1531
		</copy>
1532
	</target>
1533
1534
	<target name="compile-lsid" depends="prepare-lsid"
1535
		description="Compile Java sources">
1536
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1537
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1538
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1539
			deprecation="${compile.deprecation}"
1540
			optimize="${compile.optimize}">
1541
			<classpath refid="lsid.classpath" />
1542
		</javac>
1543
	</target>
1544
1545
	<target name="war-lsid" depends="compile-lsid"
1546
		description="Create a war file for the application">
1547
		<mkdir dir="${dist.dir}" />
1548
		<war destfile="${dist.dir}/${authority.context}.war"
1549
			webxml="${webinf.dir}/web.xml">
1550
			<fileset dir="${lsid.build.dir}" />
1551
			<lib dir="${lsid.lib.dir}">
1552
				<patternset refid="lsid.jars" />
1553
			</lib>
1554
			<lib dir="${lib.dir}">
1555
				<patternset refid="lib.jars" />
1556
			</lib>
1557
			<lib dir="${lib.dir}">
1558
				<include name="xalan.jar" />
1559
				<include name="xml-apis.jar" />
1560
			</lib>
1561
			<lib dir="${build.dir}">
1562
				<include name="metacat-client.jar" />
1563
			</lib>
1564
		</war>
1565
	</target>
1566
1567
	<target name="deploy-lsid" depends="war-lsid"
1568
		description="Deploy LSID war to servlet container">
1569
		<delete dir="${app.deploy.dir}/${authority.context}" />
1570
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1571
		<mkdir dir="${app.deploy.dir}" />
1572
		<copy todir="${app.deploy.dir}">
1573
			<fileset dir="${dist.dir}" />
1574
		</copy>
1575
	</target>
1576 5919 tao
1577
	<target name="change-metacat-properties" depends="warPrepare"
1578
        description="Chage some default values of metacat.properties">
1579 5924 tao
       <echo file="${metacat-properties-file}" append="true">
1580
		   configutil.propertiesConfigured=true
1581
		   configutil.authConfigured=true
1582
           configutil.skinsConfigured=true
1583
		   configutil.databaseConfigured=true
1584
		   configutil.geoserverConfigured=true
1585
	   </echo>
1586 5919 tao
    </target>
1587
1588 5925 tao
	<!-- This target will use default values in svn metacat.properties to build a configured
1589
		metacat (except configuti.* properties, they will be set true). Those default settings
1590
		are for a test machine. It may not work on your system-->
1591 5924 tao
	<target name="install-configured-metacat" depends="change-metacat-properties, install"
1592 5919 tao
        description="Install a metacat by the default value in metacat.properties without additional configutaion">
1593
    </target>
1594
1595 5295 jones
1596
    <!-- Build the dataone service, but only if it is checked out as a
1597
         sibling of the current build directory. Requires maven2 to
1598
         be installed and on the path. -->
1599
    <target name="dataone-service" if="d1.available">
1600 5320 jones
        <property name="d1.jar" value="dataone-service-api-0.3.0.jar"/>
1601 5295 jones
1602
        <artifact:mvn pom="${d1.dir}/pom.xml" fork="true"
1603
                      mavenHome="${maven.home}">
1604
            <arg value="install"/>
1605
        </artifact:mvn>
1606
		<copy file="${d1.dir}/target/${d1.jar}" todir="${lib.dir}" />
1607
    </target>
1608 113 jones
</project>