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