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