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