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 8242 leinfelder
	        <git command = "pull" dir = "@{dest}" >
76
	        	<args>
77
	                <arg value = "@{repository}" />
78
	                <arg value = "@{refname}" />
79
	            </args>
80
	        </git>
81
	        <git command = "checkout" dir = "@{dest}">
82
	        	<args>
83
	                <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 6913 leinfelder
		<property name="seek-tag" value="tags/ECOGRID_1_2_2" />
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 8242 leinfelder
		<property name="metacatui.git.repository.refname"
419 8373 leinfelder
							value="METACATUI_1_2_0" />
420 8363 leinfelder
		<!--<property name="metacatui.git.repository.refname"
421
									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 6438 leinfelder
	<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 7661 tao
		<copy file="lib/solrQueryFieldDescriptions.properties" todir="${war.webinf}"/>
1014 4969 daigle
		<copy file="lib/metacat.properties.metadata.xml"
1015
			todir="${war.webinf}" filtering="no" />
1016
		<copy file="lib/org.properties.metadata.xml"
1017
			todir="${war.webinf}" filtering="no" />
1018
		<copy file="lib/auth.properties.metadata.xml"
1019
			todir="${war.webinf}" filtering="no" />
1020
		<copy todir="${war.webinf}" filtering="yes">
1021
			<fileset dir="lib">
1022
				<include name="skin.configs/**" />
1023
			</fileset>
1024
		</copy>
1025
		<copy file="lib/log4j.properties" todir="${war.webinf}"
1026
			filtering="yes" />
1027 6486 leinfelder
		<copy file="lib/hazelcast.xml" todir="${war.webinf}"
1028
			filtering="yes" />
1029 7737 leinfelder
		<copy file="lib/oa4mp_client.xml" todir="${war.webinf}"
1030
			filtering="yes" />
1031 4969 daigle
		<copy todir="${war.context}" filtering="no">
1032
			<fileset dir="lib">
1033
				<include name="**/*.jpg" />
1034
				<include name="**/*.png" />
1035
				<include name="**/*.gif" />
1036
				<include name="LiveMap_30/**" />
1037
				<include name="oaipmh/**" />
1038
			</fileset>
1039
		</copy>
1040
		<copy todir="${war.context}" filtering="yes">
1041
			<fileset dir="lib">
1042
				<exclude name="*.jar" />
1043
				<exclude name="*.properties" />
1044
				<exclude name="*.metadata.xml" />
1045
				<exclude name="web.xml" />
1046
				<exclude name="**/*.jpg" />
1047
				<exclude name="**/*.png" />
1048
				<exclude name="**/*.gif" />
1049
				<exclude name="lsid_lib/**" />
1050
				<exclude name="lsid_conf/**" />
1051
				<exclude name="LiveMap_30/**" />
1052
				<exclude name="oaipmh/**" />
1053 7770 leinfelder
				<exclude name="maven/**" />
1054 4969 daigle
				<exclude name="skin.configs/**" />
1055 5865 leinfelder
				<exclude name="spatial/geoserver/**" />
1056 4969 daigle
			</fileset>
1057
		</copy>
1058 5865 leinfelder
		<copy todir="${war.context}" filtering="no">
1059
			<fileset dir="lib">
1060
				<include name="spatial/geoserver/data/**" />
1061
			</fileset>
1062
		</copy>
1063 4969 daigle
		<copy todir="${war.context.docs}" filtering="no">
1064 6898 jones
			<fileset dir="${build.docs}" />
1065 4969 daigle
		</copy>
1066
		<copy todir="${war.webinf.sql}" filtering="yes">
1067
			<fileset dir="src">
1068
				<include name="**/*.sql" />
1069
			</fileset>
1070
		</copy>
1071
		<copy todir="${war.webinf.scripts}" filtering="yes">
1072
			<fileset dir="src/scripts" />
1073
		</copy>
1074
		<copy todir="${war.webinf.scripts}"
1075
			file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
1076
			failonerror="false" />
1077
1078
		<copy file="src/perl/register-dataset.cgi"
1079
			todir="${war.context.cgi}" />
1080
		<copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
1081
		<copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
1082
1083
		<!-- registry cgi section -->
1084
		<!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
1085
			used in readDocumentFromMetacat -->
1086
		<!-- TODO MCD copy temp files to actual location using config util?? -->
1087
		<copy todir="${war.context.temp}" filtering="yes">
1088
			<fileset dir="lib/style/common/emlb6toeml2">
1089
				<include name="*.xsl" />
1090
				<include name="*.xml" />
1091
			</fileset>
1092
		</copy>
1093
		<available file="lib/style/common/emlb6toeml2" type="dir"
1094
			property="styles.not.needed" />
1095
1096
		<!-- ldap cgi section -->
1097
		<copy todir="${war.context.templates}">
1098
			<fileset dir="lib/style/common/templates">
1099
				<!-- SCW: Copy all files -->
1100
			</fileset>
1101
		</copy>
1102
	</target>
1103
1104
	<target name="cgiPrepare" if="build.perl">
1105
		<exec dir="src/perl/Metacat/" executable="make">
1106 4820 daigle
			<arg value="clean" />
1107 4969 daigle
		</exec>
1108
		<exec dir="src/perl/Metacat/" executable="perl">
1109 4369 daigle
			<arg value="Makefile.PL" />
1110
		</exec>
1111 4820 daigle
		<exec dir="src/perl/Metacat/" executable="make" />
1112 4369 daigle
	</target>
1113 4969 daigle
1114 4550 daigle
	<target name="testPrepare"
1115 4435 daigle
		description="Copies test files into the war directories">
1116
		<echo>in testPrepare</echo>
1117 4969 daigle
		<property name="war.context.test"
1118
			value="${build.war}/${metacat.context}/test" />
1119 4435 daigle
		<mkdir dir="${war.context.test}" />
1120 4969 daigle
		<copy todir="${war.context.test}" filtering="yes">
1121
			<fileset dir="test/servertestfiles">
1122
				<include name="*/**" />
1123
			</fileset>
1124 4435 daigle
		</copy>
1125
	</target>
1126 1929 brooke
1127 4969 daigle
	<target name="getConversionXSL" depends="prepare"
1128
		unless="styles.not.needed"
1129
		description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1130 2497 sgarg
1131 5176 daigle
		<svn>
1132
			<export srcUrl="${svn.eml2StyleUrl}"
1133
				destPath="${build.tmp}/conv_eml_${eml2-style-tag}" />
1134
		</svn>
1135 2343 sgarg
1136 4969 daigle
		<mkdir dir="lib/style/common/emlb6toeml2" />
1137
		<copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1138
			<fileset
1139 5176 daigle
				dir="${build.tmp}/conv_eml_${eml2-style-tag}/lib/beta6toeml2/xsl">
1140 4969 daigle
				<include name="*.xsl" />
1141
				<include name="*.xml" />
1142
			</fileset>
1143
		</copy>
1144
	</target>
1145 1929 brooke
1146 4969 daigle
	<target name="testprep" depends="jar,clientjar,harvesterjar">
1147
		<mkdir dir="${build.tests}" />
1148 5753 leinfelder
		<copy todir="${build.tests}" encoding="UTF-8">
1149 4969 daigle
			<fileset dir="${testdir}">
1150
				<include name="edu/**" />
1151
			</fileset>
1152
		</copy>
1153 5753 leinfelder
		<copy todir="${build.tests}" file="${testdir}/test.properties" />
1154 4121 daigle
1155 6003 cjones
		<path id="test.classpath">
1156
			<path refid="compile.classpath" />
1157
			<fileset dir="${build.dir}">
1158
				<include name="${name}.jar" />
1159
				<include name="${name}-client.jar" />
1160
				<include name="harvester.jar" />
1161
			</fileset>
1162
		</path>
1163
1164
		<pathconvert pathsep="${line.separator}|  |--"
1165
		             property="echo.test.classpath"
1166
		             refid="test.classpath">
1167
		</pathconvert>
1168
		<echo message="|--test classpath" />
1169
		<echo message="|  |" />
1170
		<echo message="|  |-- ${echo.test.classpath}" />
1171
1172 4969 daigle
		<!-- copy and compile the tests into a jar file -->
1173
		<javac srcdir="${build.tests}" destdir="${build.tests}"
1174 5753 leinfelder
			debug="on" includes="**/*.java" encoding="UTF-8">
1175 6003 cjones
			<classpath refid="test.classpath" />
1176 4969 daigle
		</javac>
1177 204 jones
1178 4969 daigle
		<jar jarfile="${build.dir}/${name}-junittests.jar"
1179 6565 leinfelder
			basedir="${build.tests}" >
1180
			<include name="**/*.class"/>
1181
			<include name="**/*.xml"/>
1182
		</jar>
1183 6003 cjones
1184 4969 daigle
	</target>
1185 971 tao
1186 6966 leinfelder
	<target name="runoneclass" depends="testprep"
1187
		description="Uses the ant to run a class">
1188
1189
		<java classname="${classtorun}" fork="true">
1190 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1191 4969 daigle
			<classpath>
1192 5311 daigle
				<path refid="test.classpath" />
1193 4969 daigle
				<fileset dir="${build.dir}">
1194
					<include name="${name}.jar" />
1195
					<include name="${name}-client.jar" />
1196
					<include name="harvester.jar" />
1197
					<include name="${name}-junittests.jar" />
1198
				</fileset>
1199
			</classpath>
1200 6966 leinfelder
		</java>
1201 4969 daigle
	</target>
1202 7011 leinfelder
1203
	<target name="test" depends="testprep"
1204
		description="Uses the ant junit task to run all JUnit tests">
1205 1103 tao
1206 7011 leinfelder
		<!-- use the ant "junit" task to run JUnit tests. -->
1207
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1208
			haltonerror="no">
1209
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1210
			<classpath>
1211
				<path refid="test.classpath" />
1212
				<fileset dir="${build.dir}">
1213
					<include name="${name}.jar" />
1214
					<include name="${name}-client.jar" />
1215
					<include name="harvester.jar" />
1216
					<include name="${name}-junittests.jar" />
1217
				</fileset>
1218
			</classpath>
1219
1220
			<formatter type="plain" />
1221
1222
			<batchtest fork="yes" todir="${build.dir}">
1223
				<fileset dir="${build.tests}">
1224
					<include name="**/*.class" />
1225
					<exclude name="**/MCTestCase.class" />
1226
					<exclude name="**/ClientViewHelperTest.class" />
1227
					<!-- these are not test cases -->
1228
					<exclude name="**/MockCNode.class" />
1229
					<exclude name="**/D1NodeServiceTest.class" />
1230 7237 tao
					<exclude name="**/QueryRunner.class" />
1231 7238 tao
					<exclude name="**/MockObjectPathMap.class" />
1232 7267 tao
					<exclude name="**/HzObjectPathMapTest$1.class" />
1233
					<exclude name="**/HzObjectPathMapTest$2.class" />
1234 7011 leinfelder
				</fileset>
1235
			</batchtest>
1236
		</junit>
1237
	</target>
1238
1239 4969 daigle
	<target name="runonetest" depends="testprep"
1240
		description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1241 1500 tao
1242 4969 daigle
		<echo>testtorun: ${testtorun}</echo>
1243 1939 brooke
1244 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1245
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1246
			haltonerror="no" showoutput="yes">
1247 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1248 4969 daigle
			<classpath>
1249 5311 daigle
				<path refid="test.classpath" />
1250 4969 daigle
				<fileset dir="${build.dir}">
1251
					<include name="${name}.jar" />
1252
					<include name="${name}-client.jar" />
1253
					<include name="harvester.jar" />
1254
					<include name="${name}-junittests.jar" />
1255
				</fileset>
1256
			</classpath>
1257 1500 tao
1258 4969 daigle
			<formatter type="plain" />
1259 1500 tao
1260 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1261
				<fileset dir="${build.tests}">
1262
					<include name="**/${testtorun}.class" />
1263
				</fileset>
1264
			</batchtest>
1265
		</junit>
1266
	</target>
1267 6966 leinfelder
1268
	<target name="run" depends="testprep"
1269
			description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1270 1500 tao
1271 6966 leinfelder
			<echo>testtorun: ${testtorun}</echo>
1272
1273
			<!-- use the ant "junit" task to run JUnit tests. -->
1274
			<junit printsummary="yes" haltonfailure="no" fork="yes"
1275
				haltonerror="no" showoutput="yes">
1276
				<jvmarg value="-Dfile.encoding=UTF-8"/>
1277
				<classpath>
1278
					<path refid="test.classpath" />
1279
					<fileset dir="${build.dir}">
1280
						<include name="${name}.jar" />
1281
						<include name="${name}-client.jar" />
1282
						<include name="harvester.jar" />
1283
						<include name="${name}-junittests.jar" />
1284
					</fileset>
1285
				</classpath>
1286
1287
				<formatter type="plain" />
1288
1289
				<batchtest fork="yes" todir="${build.dir}">
1290
					<fileset dir="${build.tests}">
1291
						<include name="**/${testtorun}.class" />
1292
					</fileset>
1293
				</batchtest>
1294
			</junit>
1295
		</target>
1296
1297 4969 daigle
	<target name="testharvester" depends="testprep"
1298
		description="Uses the ant junit task to test only the Harvester code">
1299
		<junit printsummary="yes" haltonfailure="off" fork="yes"
1300
			haltonerror="off">
1301
			<classpath>
1302
				<path refid="compile.classpath" />
1303
				<fileset dir="${build.dir}">
1304
					<include name="${name}.jar" />
1305
					<include name="${name}-client.jar" />
1306
					<include name="harvester.jar" />
1307
					<include name="${name}-junittests.jar" />
1308
				</fileset>
1309
			</classpath>
1310
			<formatter type="plain" />
1311
			<batchtest fork="yes" todir="${build.dir}">
1312
				<fileset dir="${build.tests}">
1313
					<include name="**/harvesterClient/*.class" />
1314
				</fileset>
1315
			</batchtest>
1316
		</junit>
1317
	</target>
1318 2135 costa
1319 4969 daigle
	<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1320
	<target name="nettest" depends="install"
1321
		description="compiles and runs the metacatnettest code">
1322 2175 tao
1323 4969 daigle
		<echo>
1324
			*********************************** Please run ant
1325
			gethttpclient first! ***********************************
1326
		</echo>
1327
		<!-- copy and compile the tests into a jar file -->
1328
		<mkdir dir="${build.metacatnettest}" />
1329
		<javac srcdir="${junitnettestsdir}"
1330
			destdir="${build.metacatnettest}" includes="**/*.java">
1331
			<classpath>
1332
				<path refid="compile.classpath" />
1333
				<fileset dir="${build.dir}">
1334
					<include name="${name}.jar" />
1335
				</fileset>
1336
			</classpath>
1337
		</javac>
1338 1103 tao
1339 4969 daigle
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1340
			basedir="${build.metacatnettest}" includes="**/*.class" />
1341 1103 tao
1342 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1343
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1344
			haltonerror="no">
1345
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1346
			<classpath>
1347
				<path refid="compile.classpath" />
1348
				<fileset dir="${build.dir}">
1349
					<include name="${name}.jar" />
1350
					<include name="${name}-junitnettests.jar" />
1351
				</fileset>
1352
			</classpath>
1353 1103 tao
1354 4969 daigle
			<formatter type="plain" />
1355 1103 tao
1356 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1357
				<fileset dir="${build.metacatnettest}">
1358
					<include name="**/*.class" />
1359
				</fileset>
1360
			</batchtest>
1361
		</junit>
1362
	</target>
1363 1103 tao
1364 4969 daigle
	<target name="cleanweb" depends="clean"
1365
		description="deletes tomcat web context dir and all its contents">
1366
		<delete dir="${installdir}" />
1367
	</target>
1368 1522 berkley
1369
1370 4969 daigle
	<target name="clean" depends="init"
1371
		description="deletes build dir and files that can be regenerated form the release">
1372
		<delete dir="${build.dir}" />
1373
		<delete dir="${dist.dir}" />
1374
	</target>
1375 2320 jones
1376 4098 daigle
	<target name="localclean" depends="clean"
1377 4969 daigle
		description="deletes even jars that depend on external sources such as stylesheets and jars">
1378
		<delete file="lib/utilities.jar" />
1379
	</target>
1380 113 jones
1381 4969 daigle
	<target name="fullclean" depends="localclean"
1382
		description="deletes code and eml">
1383
		<delete includeEmptyDirs="true" failonerror="false">
1384
			<fileset dir="${style-common-cvsrelpath}">
1385
				<include name="${eml-css}" />
1386
				<include name="eml-*/*.xsl" />
1387
				<include name="eml-*" />
1388
			</fileset>
1389
			<fileset dir="${schema-cvsrelpath}">
1390
				<include name="eml-*/*.xsd" />
1391
			</fileset>
1392 5841 tao
			<fileset dir="${ecogrid-dir}"/>
1393 5809 leinfelder
			<fileset dir="lib/style/common/emlb6toeml2"/>
1394
			<fileset dir="lib/dtd"/>
1395
			<fileset dir="lib/schema"/>
1396 6184 tao
			<fileset dir="${utilitiesdir}"/>
1397 7624 leinfelder
			<fileset dir="${libdir.mvn}"/>
1398 4969 daigle
		</delete>
1399 8371 leinfelder
		<!-- remove the entire directory -->
1400
		<delete includeemptydirs="true" dir="${metacatui.build.dir}" />
1401 7250 leinfelder
		<!-- clean up the distribution files if they exist-->
1402
		<delete file="./${name}-bin-${release}.tar.gz" />
1403
		<delete file="./${name}-src-${release}.tar.gz" />
1404
		<delete file="./${name}-bin-${release}.zip" />
1405
		<delete file="./${name}-src-${release}.zip" />
1406 4969 daigle
	</target>
1407 6897 jones
1408
	<target name="documentation" depends="javadoc,admindoc"
1409
	    description="generates Javadoc API documentation and Admin Guide">
1410
    </target>
1411
1412
	<target name="admindoc" depends="prepare">
1413
		<!-- Build the administrator's guide, which is a Sphinx RST project
1414
		     For this to succeed, you must have Sphinx installed on your machine
1415
		     See: http://sphinx.pocoo.org/ for details
1416
		     And you must also have the 'make' build tool installed
1417
		-->
1418
		<exec dir="${docdir}/user/metacat" executable="make">
1419 7521 leinfelder
		        <arg value="plantuml"/>
1420
		</exec>
1421
1422
		<exec dir="${docdir}/user/metacat" executable="make">
1423 6897 jones
		        <arg value="html"/>
1424
		</exec>
1425 7521 leinfelder
1426 6897 jones
    </target>
1427 113 jones
1428 6897 jones
	<target name="javadoc" depends="prepare"
1429
		description="generates Javadoc API documentation">
1430 4969 daigle
		<javadoc packagenames="edu.ucsb.nceas.*"
1431
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1432
			version="true" use="true" windowtitle="${Name} API"
1433
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1434 6897 jones
			bottom="&lt;i&gt;Copyright &#169; ${copyright}. All Rights Reserved.&lt;/i&gt;">
1435 4969 daigle
			<classpath>
1436
				<path refid="compile.classpath" />
1437
			</classpath>
1438
		</javadoc>
1439
	</target>
1440 882 jones
1441 4969 daigle
	<target name="dist"
1442 6897 jones
		depends="geteml,get-ecogrid,jar,protocol,documentation,getConversionXSL,getutilities"
1443 4969 daigle
		description="prepares a full release distribution">
1444
		<mkdir dir="${dist.dir}" />
1445
		<delete dir="${ver.dir}" />
1446
		<mkdir dir="${ver.dir}" />
1447
		<copy todir="${ver.dir}">
1448
			<fileset dir="."
1449
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1450
		</copy>
1451
		<copy todir="${ver.dir}" file="build.xml" />
1452
		<copy todir="${ver.dir}" file="build.properties" />
1453 806 jones
1454 4969 daigle
		<copy todir="${ver.dir}/docs" filtering="yes">
1455
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1456
		</copy>
1457
		<copy todir="${ver.dir}/docs" filtering="no">
1458
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1459
		</copy>
1460
		<copy todir="${ver.dir}/docs/dev">
1461
			<fileset dir="${build.dir}/docs" />
1462
		</copy>
1463
		<copy todir="${ver.dir}/src">
1464
			<fileset dir="${build.dir}/src" />
1465
		</copy>
1466
1467
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1468
		<copy todir="${ver.dir}/test/servertestfiles">
1469
			<fileset dir="./test/servertestfiles" />
1470
		</copy>
1471
	</target>
1472
1473 7257 leinfelder
	<target name="fulldist" depends="distbin, distsrc"
1474
			description="full distribution - source and bin"/>
1475
1476 4969 daigle
	<target name="distbin" depends="build-metacat,war-lsid"
1477
		description="prepares a binary distribution">
1478 4372 daigle
		<copy todir="${dist.dir}">
1479 4969 daigle
			<fileset dir="./src/scripts" />
1480
		</copy>
1481 4372 daigle
		<delete file="./${name}-bin-${release}.zip" />
1482 4969 daigle
		<zip zipfile="./${name}-bin-${release}.zip"
1483 8146 leinfelder
			basedir="${dist.dir}" />
1484 4372 daigle
		<delete file="./${name}-bin-${release}.tar.gz" />
1485 4969 daigle
		<tar tarfile="./${name}-bin-${release}.tar"
1486 8146 leinfelder
			basedir="${dist.dir}" />
1487 4969 daigle
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1488
			src="./${name}-bin-${release}.tar" />
1489 4372 daigle
		<delete file="./${name}-bin-${release}.tar" />
1490
	</target>
1491 806 jones
1492 4969 daigle
	<target name="distsrc" depends="dist"
1493
		description="prepares a source distribution">
1494
		<mkdir dir="${ver.src}" />
1495
		<copy todir="${ver.src}">
1496
			<fileset dir="./src" />
1497
		</copy>
1498
		<mkdir dir="${util.dir}" />
1499
		<copy todir="${util.dir}">
1500 7248 leinfelder
			<fileset dir="${utilitiesdir}" excludes="**/CVS*" />
1501 4969 daigle
		</copy>
1502 3131 perry
1503 4969 daigle
		<mkdir dir="${ecogrid-dist-dir}" />
1504
		<copy todir="${ecogrid-dist-dir}">
1505
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1506
		</copy>
1507 806 jones
1508 4969 daigle
		<delete file="${ver.dir}/lib/utilities.jar" />
1509 2175 tao
1510 4969 daigle
		<delete file="./${name}-src-${release}.zip" />
1511
		<zip zipfile="./${name}-src-${release}.zip"
1512
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1513
		<delete file="./${name}-src-${release}.tar.gz" />
1514
		<tar tarfile="./${name}-src-${release}.tar"
1515
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1516
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1517
			src="./${name}-src-${release}.tar" />
1518
		<delete file="./${name}-src-${release}.tar" />
1519
		<!--delete dir="${dist.dir}"/ -->
1520
	</target>
1521 2175 tao
1522 4969 daigle
	<target name="deb-package" depends="distbin"
1523
		description="create a debian installation package">
1524
		<delete dir="${deb.pkg.dir}" />
1525
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1526
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1527
			<fileset dir="./src/scripts/debian"
1528
				includes="control postinst" />
1529
		</copy>
1530 2598 harris
1531 4969 daigle
		<mkdir
1532
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1533
		<copy
1534
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1535
			filtering="yes">
1536
			<fileset dir="./src/scripts/debian"
1537
				excludes="control postinst" />
1538
		</copy>
1539
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1540 2598 harris
1541 8265 leinfelder
		<copy file="${dist.dir}/${metacat.context}.war"
1542 4969 daigle
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1543
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1544
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1545 2737 jones
1546 4969 daigle
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1547
			failonerror="true">
1548
			<arg line="--build debian" />
1549
		</exec>
1550 2737 jones
1551 4969 daigle
		<move file="${pkg.dir}/debian.deb"
1552
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1553
	</target>
1554
1555
	<target name="stylesheettest">
1556
		<xslt in="${input}" out="eml.html"
1557
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1558
			<param name="displaymodule" expression="${displaymodule}" />
1559
			<param name="docid" expression="${input}" />
1560
			<param name="entitytype" expression="${entitytype}" />
1561
			<param name="entityindex" expression="${entityindex}" />
1562
			<outputproperty name="method" value="html" />
1563
			<outputproperty name="standalone" value="yes" />
1564
			<outputproperty name="encoding" value="iso8859_1" />
1565
			<outputproperty name="indent" value="yes" />
1566
		</xslt>
1567
	</target>
1568
1569
	<target name="spatial_option" depends="prepare"
1570
		description=" -- compiles code for the spatial option">
1571
1572
		<echo message="Compiling the metatcat shapefile creator" />
1573
		<echo message="using the shapelib at: ${shapelib.dir}" />
1574
		<exec dir="." executable="g++" os="Linux, Unix"
1575
			failonerror="true">
1576
			<arg
1577
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1578
		</exec>
1579
1580
		<exec dir="." executable="g++" os="Linux, Unix"
1581
			failonerror="true">
1582
			<arg
1583
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1584
		</exec>
1585
	</target>
1586
1587
	<!-- LSID Authority support -->
1588
	<patternset id="lsid.jars">
1589
		<include name="axis.jar" />
1590
		<include name="commons-discovery-0.2.jar" />
1591
		<include name="jaxrpc.jar" />
1592
		<include name="lsid-client-1.1.1.jar" />
1593
		<include name="lsid-server-1.1.1.jar" />
1594
		<include name="saaj.jar" />
1595
		<include name="wsdl4j-1.5.1.jar" />
1596
		<include name="activation.jar" />
1597
		<include name="castor-0.9.5.jar" />
1598
		<include name="dnsjava-1.3.2.jar" />
1599
		<include name="mail.jar" />
1600
		<include name="commons-logging-1.0.4.jar" />
1601
		<!-- These jars may be needed but seem to not actually be,
1602
			so leaving them out for now
1603
			<include name="axis-ant.jar" />
1604
		-->
1605
		<!--<include name="GenCastor.class" />-->
1606
	</patternset>
1607
	<patternset id="lib.jars">
1608
		<include name="log4j-1.2.12.jar" />
1609
		<include name="utilities.jar" />
1610 5866 leinfelder
		<include name="xerces*.jar" />
1611
		<include name="xalan*.jar" />
1612 7271 leinfelder
		<include name="xml-apis*.jar" />
1613 4969 daigle
	</patternset>
1614
1615
	<path id="lsid.classpath">
1616
		<fileset dir="${lsid.lib.dir}">
1617
			<patternset refid="lsid.jars" />
1618
		</fileset>
1619
		<fileset dir="${lib.dir}">
1620 5866 leinfelder
			<patternset refid="lib.jars" />
1621 4969 daigle
		</fileset>
1622
		<fileset dir="${build.dir}">
1623
			<include name="metacat-client.jar" />
1624 5866 leinfelder
			<include name="metacat.jar" />
1625 4969 daigle
		</fileset>
1626
	</path>
1627
1628
	<filterset id="configFilters">
1629
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1630
			value="${config.hostname}" / -->
1631
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1632
			value="${config.port}" / -->
1633
		<!-- MCD BYE filter token="METADATA_LABELS"
1634
			value="${config.metadataLabelLsid}" / -->
1635
		<!-- MCD BYE filter token="METACAT_SERVER"
1636
			value="${config.metacatserver}" / -->
1637
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1638
			value="${config.lsidauthority}" / -->
1639
	</filterset>
1640
1641
	<target name="prepare-lsid" depends="prepare,utilities,clientjar"
1642
		description="Configure files prior to compilation">
1643
		<mkdir dir="${lsid.build.dir}" />
1644
		<!-- Copy the properties file into the build -->
1645
		<copy file="${conf.dir}/metacat-lsid.properties"
1646
			tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1647
			overwrite="true">
1648
			<filterset refid="configFilters" />
1649
		</copy>
1650
		<copy file="${conf.dir}/log4j.properties"
1651
			tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1652
			overwrite="true">
1653
			<filterset refid="configFilters" />
1654
		</copy>
1655
		<!-- Copy config files into the build -->
1656
		<copy todir="${lsid.build.dir}/WEB-INF">
1657
			<fileset dir="${webinf.dir}" includes="**/*.wsdd" />
1658
		</copy>
1659
		<!-- Copy the metadata configuration files into the build -->
1660
		<mkdir
1661
			dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1662
		<copy
1663
			todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1664
			<fileset dir="${conf.dir}" includes="**/*.xml" />
1665
			<fileset dir="${conf.dir}" includes="**/*.xslt" />
1666
			<filterset refid="configFilters" />
1667
		</copy>
1668
		<!-- Copy services files into the build -->
1669
		<mkdir dir="${lsid.build.dir}/services" />
1670
		<copy todir="${lsid.build.dir}/services">
1671
			<fileset dir="${services.dir}" />
1672
			<filterset refid="configFilters" />
1673
		</copy>
1674
		<!-- Copy axis files into the build -->
1675
		<mkdir dir="${lsid.build.dir}" />
1676
		<copy todir="${lsid.build.dir}">
1677
			<fileset dir="${conf.dir}/axis" excludes="*.properties" />
1678
		</copy>
1679
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1680
		<copy todir="${lsid.build.dir}/WEB-INF/classes">
1681
			<fileset dir="${conf.dir}/axis" includes="*.properties" />
1682
		</copy>
1683
	</target>
1684
1685
	<target name="compile-lsid" depends="prepare-lsid"
1686
		description="Compile Java sources">
1687
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1688
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1689
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1690
			deprecation="${compile.deprecation}"
1691
			optimize="${compile.optimize}">
1692 8104 leinfelder
			<classpath>
1693
				<path refid="compile.classpath" />
1694
				<fileset dir="${build.dir}">
1695
					<include name="${name}.jar" />
1696
				</fileset>
1697
			</classpath>
1698 4969 daigle
		</javac>
1699
	</target>
1700
1701
	<target name="war-lsid" depends="compile-lsid"
1702
		description="Create a war file for the application">
1703
		<mkdir dir="${dist.dir}" />
1704
		<war destfile="${dist.dir}/${authority.context}.war"
1705
			webxml="${webinf.dir}/web.xml">
1706
			<fileset dir="${lsid.build.dir}" />
1707
			<lib dir="${lsid.lib.dir}">
1708
				<patternset refid="lsid.jars" />
1709
			</lib>
1710
			<lib dir="${lib.dir}">
1711
				<patternset refid="lib.jars" />
1712
			</lib>
1713
			<lib dir="${lib.dir}">
1714
				<include name="xalan.jar" />
1715
				<include name="xml-apis.jar" />
1716
			</lib>
1717
			<lib dir="${build.dir}">
1718
				<include name="metacat-client.jar" />
1719
			</lib>
1720
		</war>
1721
	</target>
1722
1723
	<target name="deploy-lsid" depends="war-lsid"
1724
		description="Deploy LSID war to servlet container">
1725
		<delete dir="${app.deploy.dir}/${authority.context}" />
1726
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1727
		<mkdir dir="${app.deploy.dir}" />
1728
		<copy todir="${app.deploy.dir}">
1729
			<fileset dir="${dist.dir}" />
1730
		</copy>
1731
	</target>
1732 5919 tao
1733
	<target name="change-metacat-properties" depends="warPrepare"
1734
        description="Chage some default values of metacat.properties">
1735 5924 tao
       <echo file="${metacat-properties-file}" append="true">
1736
		   configutil.propertiesConfigured=true
1737
		   configutil.authConfigured=true
1738
           configutil.skinsConfigured=true
1739
		   configutil.databaseConfigured=true
1740
		   configutil.geoserverConfigured=true
1741
	   </echo>
1742 6003 cjones
  </target>
1743 5919 tao
1744 5925 tao
	<!-- This target will use default values in svn metacat.properties to build a configured
1745
		metacat (except configuti.* properties, they will be set true). Those default settings
1746
		are for a test machine. It may not work on your system-->
1747 5924 tao
	<target name="install-configured-metacat" depends="change-metacat-properties, install"
1748 5919 tao
        description="Install a metacat by the default value in metacat.properties without additional configutaion">
1749
    </target>
1750 7633 tao
1751
	<!-- build metacat-common jar -->
1752 7803 tao
	<target name="build-metacat-common" description="Calls the Maven build for metacat-common jar" unless="build-metacat-common-called" >
1753 7633 tao
		<artifact:mvn pom="metacat-common/pom.xml" mavenhome="${maven.home}" fork="true">
1754
		            <arg value="clean"/>
1755
		</artifact:mvn>
1756
		<artifact:mvn pom="metacat-common/pom.xml" mavenhome="${maven.home}" fork="true">
1757
		   <arg value="install"/>
1758
		</artifact:mvn>
1759 7803 tao
		<property name="build-metacat-common-called" value="true"/>
1760 7633 tao
	</target>
1761 7561 leinfelder
1762
	<!-- build metacat-index war -->
1763
	<target name="build-metacat-index" description="Calls the Maven build for metacat-index.war" >
1764
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1765 7583 leinfelder
			<arg value="clean"/>
1766
		</artifact:mvn>
1767
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1768 7561 leinfelder
			<arg value="package"/>
1769 7583 leinfelder
			<!--<arg value="-Dmaven.test.skip=true"/>-->
1770 7561 leinfelder
		</artifact:mvn>
1771
	</target>
1772 5919 tao
1773 7568 leinfelder
	<target name="dist-metacat-index" depends="init, build-metacat-index" description="Copy metacat-index.war to dist folder" >
1774
		<copy tofile="${dist.dir}/metacat-index.war" >
1775 7561 leinfelder
			<fileset dir="metacat-index/target" includes="metacat-index*.war"></fileset>
1776
		</copy>
1777
	</target>
1778
1779 7568 leinfelder
	<target name="install-metacat-index" depends="dist-metacat-index" description="Copy metacat-index.war to deploy folder" >
1780
		<copy todir="${app.deploy.dir}" file="${dist.dir}/metacat-index.war" />
1781
	</target>
1782
1783 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 -->
1784
	<target name="war-account" 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">
1785
		  <property name="war-name" value="account" />
1786
		  <mkdir dir="${dist.dir}" />
1787
		     <war destfile="${dist.dir}/${war-name}.war"
1788 8375 tao
		            webxml="lib/account-web-info/web.xml">
1789 8342 tao
		      <webinf dir="${war.webinf}">
1790
		        <include name="metacat.properties"/>
1791
		      </webinf>
1792
		      <fileset dir="${war.context}">
1793
		        <include name="cgi-bin/**"/>
1794
		      	<include name="style/**"/>
1795
		      </fileset>
1796
1797
		   </war>
1798
	</target>
1799
1800 113 jones
</project>