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