Project

General

Profile

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