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