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