Project

General

Profile

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