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 9188 tao
	<property name="java.target.version" value="1.7" /> <!-- the target version for java compilation-->
37
	<property name="java.source.version" value="1.7" /> <!-- 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 9197 tao
		<property name="seek-tag" value="tags/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 9439 tao
							value="METACATUI_1_8_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 9205 tao
		<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 9193 tao
		<!--<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 9262 tao
					<exclude name="**/D1NodeServiceTest$1.class" />
1199 7237 tao
					<exclude name="**/QueryRunner.class" />
1200 7238 tao
					<exclude name="**/MockObjectPathMap.class" />
1201 7267 tao
					<exclude name="**/HzObjectPathMapTest$1.class" />
1202
					<exclude name="**/HzObjectPathMapTest$2.class" />
1203 7011 leinfelder
				</fileset>
1204
			</batchtest>
1205
		</junit>
1206
	</target>
1207
1208 4969 daigle
	<target name="runonetest" depends="testprep"
1209
		description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1210 1500 tao
1211 4969 daigle
		<echo>testtorun: ${testtorun}</echo>
1212 1939 brooke
1213 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1214
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1215
			haltonerror="no" showoutput="yes">
1216 5753 leinfelder
			<jvmarg value="-Dfile.encoding=UTF-8"/>
1217 4969 daigle
			<classpath>
1218 5311 daigle
				<path refid="test.classpath" />
1219 4969 daigle
				<fileset dir="${build.dir}">
1220
					<include name="${name}.jar" />
1221
					<include name="${name}-client.jar" />
1222
					<include name="harvester.jar" />
1223
					<include name="${name}-junittests.jar" />
1224
				</fileset>
1225
			</classpath>
1226 1500 tao
1227 4969 daigle
			<formatter type="plain" />
1228 1500 tao
1229 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1230
				<fileset dir="${build.tests}">
1231
					<include name="**/${testtorun}.class" />
1232
				</fileset>
1233
			</batchtest>
1234
		</junit>
1235
	</target>
1236 6966 leinfelder
1237
	<target name="run" depends="testprep"
1238
			description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1239 1500 tao
1240 6966 leinfelder
			<echo>testtorun: ${testtorun}</echo>
1241
1242
			<!-- use the ant "junit" task to run JUnit tests. -->
1243
			<junit printsummary="yes" haltonfailure="no" fork="yes"
1244
				haltonerror="no" showoutput="yes">
1245
				<jvmarg value="-Dfile.encoding=UTF-8"/>
1246
				<classpath>
1247
					<path refid="test.classpath" />
1248
					<fileset dir="${build.dir}">
1249
						<include name="${name}.jar" />
1250
						<include name="${name}-client.jar" />
1251
						<include name="harvester.jar" />
1252
						<include name="${name}-junittests.jar" />
1253
					</fileset>
1254
				</classpath>
1255
1256
				<formatter type="plain" />
1257
1258
				<batchtest fork="yes" todir="${build.dir}">
1259
					<fileset dir="${build.tests}">
1260
						<include name="**/${testtorun}.class" />
1261
					</fileset>
1262
				</batchtest>
1263
			</junit>
1264
		</target>
1265
1266 4969 daigle
	<target name="testharvester" depends="testprep"
1267
		description="Uses the ant junit task to test only the Harvester code">
1268
		<junit printsummary="yes" haltonfailure="off" fork="yes"
1269
			haltonerror="off">
1270
			<classpath>
1271
				<path refid="compile.classpath" />
1272
				<fileset dir="${build.dir}">
1273
					<include name="${name}.jar" />
1274
					<include name="${name}-client.jar" />
1275
					<include name="harvester.jar" />
1276
					<include name="${name}-junittests.jar" />
1277
				</fileset>
1278
			</classpath>
1279
			<formatter type="plain" />
1280
			<batchtest fork="yes" todir="${build.dir}">
1281
				<fileset dir="${build.tests}">
1282
					<include name="**/harvesterClient/*.class" />
1283
				</fileset>
1284
			</batchtest>
1285
		</junit>
1286
	</target>
1287 2135 costa
1288 4969 daigle
	<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1289
	<target name="nettest" depends="install"
1290
		description="compiles and runs the metacatnettest code">
1291 2175 tao
1292 4969 daigle
		<echo>
1293
			*********************************** Please run ant
1294
			gethttpclient first! ***********************************
1295
		</echo>
1296
		<!-- copy and compile the tests into a jar file -->
1297
		<mkdir dir="${build.metacatnettest}" />
1298
		<javac srcdir="${junitnettestsdir}"
1299
			destdir="${build.metacatnettest}" includes="**/*.java">
1300
			<classpath>
1301
				<path refid="compile.classpath" />
1302
				<fileset dir="${build.dir}">
1303
					<include name="${name}.jar" />
1304
				</fileset>
1305
			</classpath>
1306
		</javac>
1307 1103 tao
1308 4969 daigle
		<jar jarfile="${build.dir}/${name}-junitnettests.jar"
1309
			basedir="${build.metacatnettest}" includes="**/*.class" />
1310 1103 tao
1311 4969 daigle
		<!-- use the ant "junit" task to run JUnit tests. -->
1312
		<junit printsummary="yes" haltonfailure="no" fork="yes"
1313
			haltonerror="no">
1314
			<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1315
			<classpath>
1316
				<path refid="compile.classpath" />
1317
				<fileset dir="${build.dir}">
1318
					<include name="${name}.jar" />
1319
					<include name="${name}-junitnettests.jar" />
1320
				</fileset>
1321
			</classpath>
1322 1103 tao
1323 4969 daigle
			<formatter type="plain" />
1324 1103 tao
1325 4969 daigle
			<batchtest fork="yes" todir="${build.dir}">
1326
				<fileset dir="${build.metacatnettest}">
1327
					<include name="**/*.class" />
1328
				</fileset>
1329
			</batchtest>
1330
		</junit>
1331
	</target>
1332 1103 tao
1333 4969 daigle
	<target name="cleanweb" depends="clean"
1334
		description="deletes tomcat web context dir and all its contents">
1335
		<delete dir="${installdir}" />
1336
	</target>
1337 1522 berkley
1338
1339 4969 daigle
	<target name="clean" depends="init"
1340
		description="deletes build dir and files that can be regenerated form the release">
1341
		<delete dir="${build.dir}" />
1342
		<delete dir="${dist.dir}" />
1343 9476 tao
	    <delete dir="${metacatui.build.dir}" />
1344 4969 daigle
	</target>
1345 2320 jones
1346 8803 leinfelder
	<target name="fullclean" depends="clean"
1347 4969 daigle
		description="deletes code and eml">
1348
		<delete includeEmptyDirs="true" failonerror="false">
1349
			<fileset dir="${style-common-cvsrelpath}">
1350
				<include name="${eml-css}" />
1351
				<include name="eml-*/*.xsl" />
1352
				<include name="eml-*" />
1353
			</fileset>
1354
			<fileset dir="${schema-cvsrelpath}">
1355
				<include name="eml-*/*.xsd" />
1356
			</fileset>
1357 5841 tao
			<fileset dir="${ecogrid-dir}"/>
1358 5809 leinfelder
			<fileset dir="lib/style/common/emlb6toeml2"/>
1359
			<fileset dir="lib/dtd"/>
1360 7624 leinfelder
			<fileset dir="${libdir.mvn}"/>
1361 4969 daigle
		</delete>
1362 8371 leinfelder
		<!-- remove the entire directory -->
1363
		<delete includeemptydirs="true" dir="${metacatui.build.dir}" />
1364 7250 leinfelder
		<!-- clean up the distribution files if they exist-->
1365
		<delete file="./${name}-bin-${release}.tar.gz" />
1366
		<delete file="./${name}-src-${release}.tar.gz" />
1367
		<delete file="./${name}-bin-${release}.zip" />
1368
		<delete file="./${name}-src-${release}.zip" />
1369 4969 daigle
	</target>
1370 6897 jones
1371
	<target name="documentation" depends="javadoc,admindoc"
1372
	    description="generates Javadoc API documentation and Admin Guide">
1373
    </target>
1374
1375
	<target name="admindoc" depends="prepare">
1376
		<!-- Build the administrator's guide, which is a Sphinx RST project
1377
		     For this to succeed, you must have Sphinx installed on your machine
1378
		     See: http://sphinx.pocoo.org/ for details
1379
		     And you must also have the 'make' build tool installed
1380
		-->
1381
		<exec dir="${docdir}/user/metacat" executable="make">
1382 7521 leinfelder
		        <arg value="plantuml"/>
1383
		</exec>
1384
1385
		<exec dir="${docdir}/user/metacat" executable="make">
1386 6897 jones
		        <arg value="html"/>
1387
		</exec>
1388 7521 leinfelder
1389 6897 jones
    </target>
1390 113 jones
1391 6897 jones
	<target name="javadoc" depends="prepare"
1392
		description="generates Javadoc API documentation">
1393 4969 daigle
		<javadoc packagenames="edu.ucsb.nceas.*"
1394
			sourcepath="${build.src}" destdir="${build.javadocs}" author="true"
1395
			version="true" use="true" windowtitle="${Name} API"
1396
			doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1397 6897 jones
			bottom="&lt;i&gt;Copyright &#169; ${copyright}. All Rights Reserved.&lt;/i&gt;">
1398 4969 daigle
			<classpath>
1399
				<path refid="compile.classpath" />
1400
			</classpath>
1401
		</javadoc>
1402
	</target>
1403 882 jones
1404 4969 daigle
	<target name="dist"
1405 8803 leinfelder
		depends="geteml,get-ecogrid,jar,protocol,documentation,getConversionXSL"
1406 4969 daigle
		description="prepares a full release distribution">
1407
		<mkdir dir="${dist.dir}" />
1408
		<delete dir="${ver.dir}" />
1409
		<mkdir dir="${ver.dir}" />
1410
		<copy todir="${ver.dir}">
1411
			<fileset dir="."
1412
				excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip" />
1413
		</copy>
1414
		<copy todir="${ver.dir}" file="build.xml" />
1415
		<copy todir="${ver.dir}" file="build.properties" />
1416 806 jones
1417 4969 daigle
		<copy todir="${ver.dir}/docs" filtering="yes">
1418
			<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1419
		</copy>
1420
		<copy todir="${ver.dir}/docs" filtering="no">
1421
			<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1422
		</copy>
1423
		<copy todir="${ver.dir}/docs/dev">
1424
			<fileset dir="${build.dir}/docs" />
1425
		</copy>
1426
		<copy todir="${ver.dir}/src">
1427
			<fileset dir="${build.dir}/src" />
1428
		</copy>
1429
1430
		<mkdir dir="${ver.dir}/tests/servertestfiles" />
1431
		<copy todir="${ver.dir}/test/servertestfiles">
1432
			<fileset dir="./test/servertestfiles" />
1433
		</copy>
1434
	</target>
1435
1436 7257 leinfelder
	<target name="fulldist" depends="distbin, distsrc"
1437
			description="full distribution - source and bin"/>
1438
1439 4969 daigle
	<target name="distbin" depends="build-metacat,war-lsid"
1440
		description="prepares a binary distribution">
1441 4372 daigle
		<copy todir="${dist.dir}">
1442 4969 daigle
			<fileset dir="./src/scripts" />
1443
		</copy>
1444 4372 daigle
		<delete file="./${name}-bin-${release}.zip" />
1445 4969 daigle
		<zip zipfile="./${name}-bin-${release}.zip"
1446 8146 leinfelder
			basedir="${dist.dir}" />
1447 4372 daigle
		<delete file="./${name}-bin-${release}.tar.gz" />
1448 4969 daigle
		<tar tarfile="./${name}-bin-${release}.tar"
1449 8146 leinfelder
			basedir="${dist.dir}" />
1450 4969 daigle
		<gzip zipfile="./${name}-bin-${release}.tar.gz"
1451
			src="./${name}-bin-${release}.tar" />
1452 4372 daigle
		<delete file="./${name}-bin-${release}.tar" />
1453
	</target>
1454 806 jones
1455 4969 daigle
	<target name="distsrc" depends="dist"
1456
		description="prepares a source distribution">
1457
		<mkdir dir="${ver.src}" />
1458
		<copy todir="${ver.src}">
1459
			<fileset dir="./src" />
1460
		</copy>
1461 8803 leinfelder
1462 3131 perry
1463 4969 daigle
		<mkdir dir="${ecogrid-dist-dir}" />
1464
		<copy todir="${ecogrid-dist-dir}">
1465
			<fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1466
		</copy>
1467 806 jones
1468 2175 tao
1469 4969 daigle
		<delete file="./${name}-src-${release}.zip" />
1470
		<zip zipfile="./${name}-src-${release}.zip"
1471
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1472
		<delete file="./${name}-src-${release}.tar.gz" />
1473
		<tar tarfile="./${name}-src-${release}.tar"
1474
			basedir="${dist.dir}" excludes="metacat*.tar.gz,metacat*.zip" />
1475
		<gzip zipfile="./${name}-src-${release}.tar.gz"
1476
			src="./${name}-src-${release}.tar" />
1477
		<delete file="./${name}-src-${release}.tar" />
1478
		<!--delete dir="${dist.dir}"/ -->
1479
	</target>
1480 2175 tao
1481 4969 daigle
	<target name="deb-package" depends="distbin"
1482
		description="create a debian installation package">
1483
		<delete dir="${deb.pkg.dir}" />
1484
		<mkdir dir="${deb.pkg.dir}/DEBIAN" />
1485
		<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1486
			<fileset dir="./src/scripts/debian"
1487
				includes="control postinst" />
1488
		</copy>
1489 2598 harris
1490 4969 daigle
		<mkdir
1491
			dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1492
		<copy
1493
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1494
			filtering="yes">
1495
			<fileset dir="./src/scripts/debian"
1496
				excludes="control postinst" />
1497
		</copy>
1498
		<chmod file="${deb.pkg.dir}/DEBIAN/postinst" perm="755" />
1499 2598 harris
1500 8265 leinfelder
		<copy file="${dist.dir}/${metacat.context}.war"
1501 4969 daigle
			todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}" />
1502
		<copy file="./metacat-bin-${metacat.version}.tar.gz"
1503
			tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1504 2737 jones
1505 4969 daigle
		<exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix"
1506
			failonerror="true">
1507
			<arg line="--build debian" />
1508
		</exec>
1509 2737 jones
1510 4969 daigle
		<move file="${pkg.dir}/debian.deb"
1511
			tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb" />
1512
	</target>
1513
1514
	<target name="stylesheettest">
1515
		<xslt in="${input}" out="eml.html"
1516
			style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1517
			<param name="displaymodule" expression="${displaymodule}" />
1518
			<param name="docid" expression="${input}" />
1519
			<param name="entitytype" expression="${entitytype}" />
1520
			<param name="entityindex" expression="${entityindex}" />
1521
			<outputproperty name="method" value="html" />
1522
			<outputproperty name="standalone" value="yes" />
1523
			<outputproperty name="encoding" value="iso8859_1" />
1524
			<outputproperty name="indent" value="yes" />
1525
		</xslt>
1526
	</target>
1527
1528
	<target name="spatial_option" depends="prepare"
1529
		description=" -- compiles code for the spatial option">
1530
1531
		<echo message="Compiling the metatcat shapefile creator" />
1532
		<echo message="using the shapelib at: ${shapelib.dir}" />
1533
		<exec dir="." executable="g++" os="Linux, Unix"
1534
			failonerror="true">
1535
			<arg
1536
				line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1537
		</exec>
1538
1539
		<exec dir="." executable="g++" os="Linux, Unix"
1540
			failonerror="true">
1541
			<arg
1542
				line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1543
		</exec>
1544
	</target>
1545
1546
	<!-- LSID Authority support -->
1547
	<patternset id="lsid.jars">
1548
		<include name="axis.jar" />
1549
		<include name="commons-discovery-0.2.jar" />
1550
		<include name="jaxrpc.jar" />
1551
		<include name="lsid-client-1.1.1.jar" />
1552
		<include name="lsid-server-1.1.1.jar" />
1553
		<include name="saaj.jar" />
1554
		<include name="wsdl4j-1.5.1.jar" />
1555
		<include name="activation.jar" />
1556
		<include name="castor-0.9.5.jar" />
1557
		<include name="dnsjava-1.3.2.jar" />
1558
		<include name="mail.jar" />
1559
		<include name="commons-logging-1.0.4.jar" />
1560
		<!-- These jars may be needed but seem to not actually be,
1561
			so leaving them out for now
1562
			<include name="axis-ant.jar" />
1563
		-->
1564
		<!--<include name="GenCastor.class" />-->
1565
	</patternset>
1566
	<patternset id="lib.jars">
1567
		<include name="log4j-1.2.12.jar" />
1568 8803 leinfelder
		<include name="utilities-*.jar" />
1569 5866 leinfelder
		<include name="xerces*.jar" />
1570
		<include name="xalan*.jar" />
1571 7271 leinfelder
		<include name="xml-apis*.jar" />
1572 4969 daigle
	</patternset>
1573
1574
	<path id="lsid.classpath">
1575
		<fileset dir="${lsid.lib.dir}">
1576
			<patternset refid="lsid.jars" />
1577
		</fileset>
1578
		<fileset dir="${lib.dir}">
1579 5866 leinfelder
			<patternset refid="lib.jars" />
1580 4969 daigle
		</fileset>
1581
		<fileset dir="${build.dir}">
1582
			<include name="metacat-client.jar" />
1583 5866 leinfelder
			<include name="metacat.jar" />
1584 4969 daigle
		</fileset>
1585
	</path>
1586
1587
	<filterset id="configFilters">
1588
		<!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1589
			value="${config.hostname}" / -->
1590
		<!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1591
			value="${config.port}" / -->
1592
		<!-- MCD BYE filter token="METADATA_LABELS"
1593
			value="${config.metadataLabelLsid}" / -->
1594
		<!-- MCD BYE filter token="METACAT_SERVER"
1595
			value="${config.metacatserver}" / -->
1596
		<!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1597
			value="${config.lsidauthority}" / -->
1598
	</filterset>
1599
1600 8803 leinfelder
	<target name="prepare-lsid" depends="prepare,clientjar"
1601 4969 daigle
		description="Configure files prior to compilation">
1602
		<mkdir dir="${lsid.build.dir}" />
1603
		<!-- Copy the properties file into the build -->
1604
		<copy file="${conf.dir}/metacat-lsid.properties"
1605
			tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1606
			overwrite="true">
1607
			<filterset refid="configFilters" />
1608
		</copy>
1609
		<copy file="${conf.dir}/log4j.properties"
1610
			tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1611
			overwrite="true">
1612
			<filterset refid="configFilters" />
1613
		</copy>
1614
		<!-- Copy config files into the build -->
1615
		<copy todir="${lsid.build.dir}/WEB-INF">
1616
			<fileset dir="${webinf.dir}" includes="**/*.wsdd" />
1617
		</copy>
1618
		<!-- Copy the metadata configuration files into the build -->
1619
		<mkdir
1620
			dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1621
		<copy
1622
			todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1623
			<fileset dir="${conf.dir}" includes="**/*.xml" />
1624
			<fileset dir="${conf.dir}" includes="**/*.xslt" />
1625
			<filterset refid="configFilters" />
1626
		</copy>
1627
		<!-- Copy services files into the build -->
1628
		<mkdir dir="${lsid.build.dir}/services" />
1629
		<copy todir="${lsid.build.dir}/services">
1630
			<fileset dir="${services.dir}" />
1631
			<filterset refid="configFilters" />
1632
		</copy>
1633
		<!-- Copy axis files into the build -->
1634
		<mkdir dir="${lsid.build.dir}" />
1635
		<copy todir="${lsid.build.dir}">
1636
			<fileset dir="${conf.dir}/axis" excludes="*.properties" />
1637
		</copy>
1638
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1639
		<copy todir="${lsid.build.dir}/WEB-INF/classes">
1640
			<fileset dir="${conf.dir}/axis" includes="*.properties" />
1641
		</copy>
1642
	</target>
1643
1644
	<target name="compile-lsid" depends="prepare-lsid"
1645
		description="Compile Java sources">
1646
		<mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1647
		<javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1648
			destdir="${lsid.build.dir}/WEB-INF/classes" debug="${compile.debug}"
1649
			deprecation="${compile.deprecation}"
1650 8825 tao
			target="${java.target.version}"
1651 8828 tao
			source="${java.source.version}"
1652 4969 daigle
			optimize="${compile.optimize}">
1653 8104 leinfelder
			<classpath>
1654
				<path refid="compile.classpath" />
1655
				<fileset dir="${build.dir}">
1656
					<include name="${name}.jar" />
1657
				</fileset>
1658
			</classpath>
1659 4969 daigle
		</javac>
1660
	</target>
1661
1662
	<target name="war-lsid" depends="compile-lsid"
1663
		description="Create a war file for the application">
1664
		<mkdir dir="${dist.dir}" />
1665
		<war destfile="${dist.dir}/${authority.context}.war"
1666
			webxml="${webinf.dir}/web.xml">
1667
			<fileset dir="${lsid.build.dir}" />
1668
			<lib dir="${lsid.lib.dir}">
1669
				<patternset refid="lsid.jars" />
1670
			</lib>
1671
			<lib dir="${lib.dir}">
1672
				<patternset refid="lib.jars" />
1673
			</lib>
1674
			<lib dir="${lib.dir}">
1675
				<include name="xalan.jar" />
1676
				<include name="xml-apis.jar" />
1677
			</lib>
1678
			<lib dir="${build.dir}">
1679
				<include name="metacat-client.jar" />
1680
			</lib>
1681
		</war>
1682
	</target>
1683
1684
	<target name="deploy-lsid" depends="war-lsid"
1685
		description="Deploy LSID war to servlet container">
1686
		<delete dir="${app.deploy.dir}/${authority.context}" />
1687
		<delete file="${app.deploy.dir}/${authority.context}.war" />
1688
		<mkdir dir="${app.deploy.dir}" />
1689
		<copy todir="${app.deploy.dir}">
1690
			<fileset dir="${dist.dir}" />
1691
		</copy>
1692
	</target>
1693 5919 tao
1694
	<target name="change-metacat-properties" depends="warPrepare"
1695
        description="Chage some default values of metacat.properties">
1696 5924 tao
       <echo file="${metacat-properties-file}" append="true">
1697
		   configutil.propertiesConfigured=true
1698
		   configutil.authConfigured=true
1699
           configutil.skinsConfigured=true
1700
		   configutil.databaseConfigured=true
1701
		   configutil.geoserverConfigured=true
1702
	   </echo>
1703 6003 cjones
  </target>
1704 5919 tao
1705 5925 tao
	<!-- This target will use default values in svn metacat.properties to build a configured
1706
		metacat (except configuti.* properties, they will be set true). Those default settings
1707
		are for a test machine. It may not work on your system-->
1708 5924 tao
	<target name="install-configured-metacat" depends="change-metacat-properties, install"
1709 5919 tao
        description="Install a metacat by the default value in metacat.properties without additional configutaion">
1710
    </target>
1711 7633 tao
1712
	<!-- build metacat-common jar -->
1713 7803 tao
	<target name="build-metacat-common" description="Calls the Maven build for metacat-common jar" unless="build-metacat-common-called" >
1714 7633 tao
		<artifact:mvn pom="metacat-common/pom.xml" mavenhome="${maven.home}" fork="true">
1715
		            <arg value="clean"/>
1716
		</artifact:mvn>
1717
		<artifact:mvn pom="metacat-common/pom.xml" mavenhome="${maven.home}" fork="true">
1718
		   <arg value="install"/>
1719
		</artifact:mvn>
1720 7803 tao
		<property name="build-metacat-common-called" value="true"/>
1721 7633 tao
	</target>
1722 7561 leinfelder
1723
	<!-- build metacat-index war -->
1724
	<target name="build-metacat-index" description="Calls the Maven build for metacat-index.war" >
1725
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1726 7583 leinfelder
			<arg value="clean"/>
1727
		</artifact:mvn>
1728
		<artifact:mvn pom="metacat-index/pom.xml" mavenhome="${maven.home}" fork="true">
1729 7561 leinfelder
			<arg value="package"/>
1730 7583 leinfelder
			<!--<arg value="-Dmaven.test.skip=true"/>-->
1731 7561 leinfelder
		</artifact:mvn>
1732
	</target>
1733 5919 tao
1734 7568 leinfelder
	<target name="dist-metacat-index" depends="init, build-metacat-index" description="Copy metacat-index.war to dist folder" >
1735
		<copy tofile="${dist.dir}/metacat-index.war" >
1736 7561 leinfelder
			<fileset dir="metacat-index/target" includes="metacat-index*.war"></fileset>
1737
		</copy>
1738
	</target>
1739
1740 7568 leinfelder
	<target name="install-metacat-index" depends="dist-metacat-index" description="Copy metacat-index.war to deploy folder" >
1741
		<copy todir="${app.deploy.dir}" file="${dist.dir}/metacat-index.war" />
1742
	</target>
1743
1744 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 -->
1745 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">
1746
		  <property name="war-name" value="identity" />
1747 8342 tao
		  <mkdir dir="${dist.dir}" />
1748
		     <war destfile="${dist.dir}/${war-name}.war"
1749 8375 tao
		            webxml="lib/account-web-info/web.xml">
1750 8342 tao
		      <webinf dir="${war.webinf}">
1751
		        <include name="metacat.properties"/>
1752 8406 tao
		        <include name="gd_intermediate_bundle_nceas_ldap.crt"/>
1753 8342 tao
		      </webinf>
1754
		      <fileset dir="${war.context}">
1755
		        <include name="cgi-bin/**"/>
1756
		      	<include name="style/**"/>
1757
		      </fileset>
1758
1759
		   </war>
1760
	</target>
1761
1762 113 jones
</project>