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