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