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