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