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