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