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