Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2 1311 berkley
<!--
3 670 jones
  *   '$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 113 jones
  *
9 670 jones
  *    '$Author$'
10 1292 tao
  *    '$Date$'
11
  *    '$Revision$'
12 666 jones
  *
13 670 jones
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15 113 jones
  *
16 303 jones
  * usage: ant [compile|jar|install|jdoc]
17 666 jones
  *
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 329 jones
<project name="metacat" default="jar" basedir=".">
33 2277 jones
  <property environment="env"/>
34 1929 brooke
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35 2957 tao
36 4962 leinfelder
37 4098 daigle
38
39 4813 daigle
  <!-- Determine if ecogrid should be installed-->
40 2957 tao
  <condition property="enable.ecogrid">
41
    <equals arg1="${install.ecogrid}" arg2="true" />
42
  </condition>
43 4813 daigle
44
  <!-- Determine if perl should be built-->
45
  <condition property="build.perl">
46
    <equals arg1="${make.perl.code}" arg2="true" />
47
  </condition>
48 3034 perry
49 4098 daigle
   <target name="config">
50
   	  <property name="jsdk" value="${build.tomcat.dir}/common/lib/servlet-api.jar"/>
51 1814 tao
      <!-- usr for client testing, generally you don't need change-->
52 4098 daigle
      <property name="mcuser"              value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
53
      <property name="mcpassword"          value="kepler"/>
54
      <property name="mcanotheruser"       value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
55
      <property name="mcanotherpassword"   value="yourpass"/>
56
   	  <property name="piscouser"           value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org"/>
57
   	  <property name="piscopassword"       value="yourpass"/>
58
   	  <property name="lteruser"            value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
59
   	  <property name="lterpassword"        value="yourpass"/>
60 1801 tao
61 4098 daigle
      <property name="debug"               value="on" />
62
      <property name="morphosourcedir"     value="../morpho" />
63
      <property name="utilitiesdir"        value="../utilities" />
64 4720 daigle
      <property name="installdir"        value="${app.deploy.dir}/${metacat.context}" />
65 2175 tao
66 1941 brooke
      <echo>*********** set jsdk to ${jsdk}</echo>
67 1103 tao
  </target>
68
69 931 jones
   <target name="init" depends="config">
70 2631 tao
      <path id="compile.classpath">
71
        <pathelement location="${jsdk}"/>
72 4080 daigle
        <pathelement location="lib"/>
73 2631 tao
        <fileset dir="lib">
74
          <include name="*.jar"/>
75
        </fileset>
76 4121 daigle
	    <fileset dir="lib">
77 3059 berkley
           <include name="xalan.jar"/>
78 3030 sgarg
         </fileset>
79 2631 tao
       <fileset dir="lib/lsid_lib">
80
         <include name="*.jar"/>
81 4098 daigle
       </fileset>
82 3034 perry
83
        <!-- Include geoserver, geotools, et. al. -->
84
        <fileset dir="lib/spatial/geoserver/WEB-INF/lib">
85
          <include name="*.jar"/>
86 2631 tao
        </fileset>
87 3034 perry
        <pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
88
89 4943 costa
        <!-- Include OAI-PMH -->
90
        <fileset dir="lib/oaipmh">
91
          <include name="*.jar"/>
92
        </fileset>
93
94 4121 daigle
      </path>
95 2631 tao
96 931 jones
      <!-- It is less likely you'll need to make any changes from here down,
97
           but customization is possible -->
98 1929 brooke
      <property name="name"                value="metacat"/>
99
      <property name="Name"                value="MetaCat"/>
100
      <property name="debugprefix"         value="${Name}:"/>
101 4080 daigle
      <property name="release"             value="${metacat.version}"/>
102 3095 cjones
      <property name="style-common-relpath" value="/style/common"/>
103
      <property name="style-shared-relpath" value="/style/shared"/>
104 4098 daigle
      <property name="schema-relpath"      value="/schema"/>
105 3095 cjones
      <property name="style-common-cvsrelpath" value="lib${style-common-relpath}"/>
106 4098 daigle
   	  <property name="schema-cvsrelpath"   value="lib${schema-relpath}"/>
107 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
108 2461 sgarg
      <property name="util-module"         value="utilities" />
109 4959 daigle
   	  <property name="utilities-tag"       value="UTILITIES_1_0_1" />
110 1929 brooke
      <property name="eml-module"          value="eml" />
111
      <property name="eml-version"         value="2.0.0beta6" />
112 4841 daigle
      <property name="eml-beta-tag"        value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT" />
113
      <property name="eml2_0_0-schema-tag" value="RELEASE_EML_2_0_0_UPDATE_1" />
114 3994 berkley
      <property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
115 4821 daigle
   	  <property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0" />
116 4841 daigle
      <property name="eml2-style-tag"      value="RELEASE_EML_UTILS_0_9_0" />
117 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
118
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
119
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
120 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
121 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
122
      <property name="eml-module.default.css"
123
                                           value="default.css"/>
124 4435 daigle
   	<property name="systemidserver"             value=""/>
125
   	<property name="html-path"             value=""/>
126
127 2965 tao
128 1929 brooke
      <!-- Config for registry variables -->
129 4080 daigle
      <!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
130 1933 brooke
      <property name="scope"               value="obfs"/>
131
      <property name="responseForm"        value="genericResponse.tmpl"/>
132
      <property name="entryForm"           value="entryForm.tmpl"/>
133
      <property name="guide"               value="genericGuide.tmpl"/>
134 2781 sgarg
      <property name="loginForm"           value="loginForm.tmpl"/>
135 2343 sgarg
      <property name="confirmData"         value="confirmData.tmpl"/>
136
      <property name="deleteData"          value="deleteData.tmpl"/>
137
      <property name="genericHeader"       value="genericHeader.tmpl"/>
138
      <property name="genericFooter"       value="genericFooter.tmpl"/>
139 1929 brooke
140 2343 sgarg
      <filter token="scope"                value="${scope}"/>
141
      <filter token="responseForm"         value="${responseForm}"/>
142
      <filter token="entryForm"            value="${entryForm}"/>
143
      <filter token="guide"                value="${guide}"/>
144 2781 sgarg
      <filter token="loginForm"            value="${loginForm}"/>
145 2343 sgarg
      <filter token="confirmData"          value="${confirmData}"/>
146
      <filter token="deleteData"           value="${deleteData}"/>
147
      <filter token="genericHeader"        value="${genericHeader}"/>
148
      <filter token="genericFooter"        value="${genericFooter}"/>
149
      <filter token="adminname"            value="${adminname}"/>
150
      <filter token="recipient"            value="${recipient}"/>
151 4080 daigle
   	  <filter token="metacatVersion"       value="${metacat.version}"/>
152 4797 daigle
 	  <filter token="metacatRC"            value="${metacat.releaseCandidate}"/>
153
 	  <filter token="build.context"        value="${metacat.context}"/>
154 2343 sgarg
155 4098 daigle
      <filter token="docrooturl"           value="./" />
156
      <filter token="mcuser"               value="${mcuser}"/>
157
      <filter token="mcpassword"           value="${mcpassword}"/>
158
      <filter token="mcanotheruser"        value="${mcanotheruser}"/>
159
      <filter token="mcanotherpassword"    value="${mcanotherpassword}"/>
160
      <filter token="eml-css"              value="${eml-css}"/>
161
      <filter token="style-skins-relpath"  value="${style-skins-relpath}"/>
162 1929 brooke
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
163 2343 sgarg
164 4098 daigle
      <filter token="eml-version"          value="${eml-version}"/>
165
      <filter token="eml2_0_0namespace"    value="${eml2_0_0namespace}"/>
166
      <filter token="eml2_0_1namespace"    value="${eml2_0_1namespace}"/>
167
      <filter token="eml2_1_0namespace"    value="${eml2_1_0namespace}"/>
168
      <filter token="stmmlnamespace"       value="${stmmlnamespace}"/>
169
      <filter token="debugprefix"          value="${debugprefix}"/>
170 1487 tao
171 4098 daigle
      <filter token="defaultStage"         value="${defaultStage}"/>
172
      <filter token="defaultHeader"        value="${defaultHeader}"/>
173
      <filter token="defaultFooter"        value="${defaultFooter}"/>
174
      <filter token="defaultChangePass"    value="${defaultChangePass}"/>
175
      <filter token="defaultResetPass"     value="${defaultResetPass}"/>
176
      <filter token="changePassSuccess"    value="${changePassSuccess}"/>
177
      <filter token="resetPassSuccess"     value="${resetPassSuccess}"/>
178
      <filter token="registerFailed"       value="${registerFailed}"/>
179
      <filter token="registerLter"         value="${registerLter}"/>
180
      <filter token="registerMatch"        value="${registerMatch}"/>
181
      <filter token="registerSuccess"      value="${registerSuccess}"/>
182
      <filter token="register"             value="${register}"/>
183
      <filter token="searchResults"        value="${searchResults}"/>
184 3174 tao
   	  <filter token="ldapMainServerFailure" value="${ldapMainServerFailure}"/>
185 4098 daigle
   	  <filter token="lter-user"            value="${lteruser}"/>
186
   	  <filter token="lter-pass"            value="${lterpassword}"/>
187
      <filter token="pisco-user"           value="${piscouser}"/>
188
      <filter token="pisco-pass"           value="${piscopassword}"/>
189 3575 tao
190 2549 tao
191 4179 daigle
   	  <!-- MCD BYE filter token="timedreplication"     value="${timedreplication}" / -->
192
   	  <!-- MCD BYE filter token="firsttimedreplication" value="${firsttimedreplication}" / -->
193
   	  <!-- MCD BYE filter token="timedreplicationinterval" value="${timedreplicationinterval}" / -->
194 2549 tao
195 4098 daigle
   	  <property name="srcdir"              value="./src" />
196
   	  <property name="lib.dir"             value="./lib" />
197
   	  <property name="docdir"              value="./docs" />
198 4240 daigle
 	  <property name="cgidir"              value="./cgi-bin" />
199 4098 daigle
      <property name="testdir"             value="./test" />
200
      <property name="testtorun"           value="BuildIndexTest" />
201
      <property name="junittestsdir"       value="./test/edu/ucsb/nceas/metacattest" />
202
      <property name="junitnettestsdir"    value="./test/edu/ucsb/nceas/metacatnettest" />
203
      <property name="build.dir"           value="./build"/>
204
      <property name="build.src"           value="${build.dir}/src"/>
205
      <property name="build.dest"          value="${build.dir}/classes"/>
206
      <property name="build.samples"       value="${build.dir}/samples"/>
207
      <property name="build.tests"         value="${build.dir}/tests"/>
208
      <property name="build.tmp"           value="${build.dir}/tmp"/>
209
      <property name="build.metacattest"   value="${build.tests}/metacattest"/>
210 1116 tao
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
211 4098 daigle
      <property name="build.data"          value="${build.dir}/data"/>
212
      <property name="build.javadocs"      value="${build.dir}/docs/api"/>
213
      <property name="build.war"           value="${build.dir}/war"/>
214
      <property name="dist.dir"            value="dist"/>
215
      <property name="ver.dir"             value="${dist.dir}/${name}-${release}"/>
216
      <property name="ver.src"             value="${ver.dir}/src"/>
217
      <property name="util.dir"            value="${dist.dir}/${util-module}"/>
218 4648 daigle
      <property name="test.dir"            value="${dist.dir}/test"/>
219 2401 costa
	  <!-- directories for creating a Harvest List Editor distribution -->
220 4098 daigle
      <property name="dist.dir.hle"        value="disthle"/>
221
      <property name="ver.dir.hle"         value="${dist.dir.hle}/harvest-list-editor-${release}"/>
222 4658 daigle
   	  <property name="pkg.dir"             value="./package" />
223
   	  <property name="deb.pkg.dir"         value="${pkg.dir}/debian" />
224 4098 daigle
225 2965 tao
   	  <property name="ecogrid-target-name" value="metacatImpl"/>
226
   	  <property name="ecogrid-module-dest-dir" value =".."/>
227 4098 daigle
   	  <property name="ecogrid-module"      value="seek/projects/ecogrid"/>
228
   	  <property name="ecogrid-dist-dir"    value="${dist.dir}/${ecogrid-module}"/>
229
   	  <property name="ecogrid-dir"         value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
230 806 jones
231 4098 daigle
      <property name="package.home"        value="edu/ucsb/nceas/metacat" />
232 4959 daigle
233
      <!-- set up svn -->
234
   	  <property name="svnant.lib" value="lib" />
235
      <property name="svnant.jar" value="${svnant.lib}/svnant.jar" />
236
      <property name="svnClientAdapter.jar" value="${svnant.lib}/svnClientAdapter.jar" />
237
      <property name="svnjavahl.jar" value="${svnant.lib}/svnjavahl.jar" />
238
   	  <property name="svn.utilitiesUrl" value="https://code.ecoinformatics.org/code/utilities/tags/${utilities-tag}" />
239 4960 walbridge
      <property name="svn.ecogridUrl" value="https://code.ecoinformatics.org/code/seek/trunk/projects/ecogrid/" />
240 4959 daigle
      <!--  property name="svn.utilitiesExportPath" value="${knbdir}" / -->
241
242
      <!-- load the svn task -->
243
      <path id="svn.classpath">
244
        <pathelement location="${svnjavahl.jar}" />
245
        <pathelement location="${svnant.jar}" />
246
        <pathelement location="${svnClientAdapter.jar}" />
247
      </path>
248
      <taskdef resource="svntask.properties" classpathref="svn.classpath"/>
249
250 2317 jones
      <condition property="utilities.required">
251
        <or>
252
          <not><available file="lib/httpclient.jar"/></not>
253
          <not><available file="lib/utilities.jar"/></not>
254 4513 daigle
          <not><available file="${utilitiesdir}" type="dir"/></not>
255 2317 jones
        </or>
256
      </condition>
257 4513 daigle
   	  <!-- peer.utilities.required is used when there is no utilities
258
   	       directory at ${utilitiesdir} -->
259 4515 daigle
      <condition property="peer.utilities.required">
260 4513 daigle
        <or>
261
          <not><available file="${utilitiesdir}" type="dir"/></not>
262
        </or>
263
      </condition>
264 2318 jones
      <condition property="eml.required">
265
        <or>
266
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
267
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
268 4328 daigle
          <not><available file="lib/schema/eml-2.1.0/eml.xsd"/></not>
269 2318 jones
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
270
        </or>
271
      </condition>
272 2965 tao
273
      <condition property="ecogrid.required">
274
      	   <or>
275
             <not><available file="${ecogrid-dir}/build.properties"/></not>
276
             <not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
277
           </or>
278
      </condition>
279 2599 jones
280 113 jones
   </target>
281 1311 berkley
282 348 jones
   <target name="prepare" depends="init">
283
      <mkdir dir="${build.dir}"/>
284
      <mkdir dir="${build.src}"/>
285
      <mkdir dir="${build.dest}"/>
286 516 jones
      <mkdir dir="${build.javadocs}"/>
287 1778 tao
      <mkdir dir="${build.tmp}"/>
288 348 jones
289 822 jones
      <copy todir="${build.src}" filtering="yes">
290
        <fileset dir="${srcdir}">
291
          <include name="edu/**"/>
292
          <include name="com/**"/>
293 3194 berkley
          <include name="org/**"/>
294 877 jones
          <include name="**/*.sql"/>
295 822 jones
          <exclude name="**/CVS*"/>
296
          <exclude name="**/.#*"/>
297
        </fileset>
298
      </copy>
299 2344 sgarg
      <available file="lib/style/common/emlb6toeml2" type="dir"
300 1954 jones
                 property="styles.not.needed"/>
301 348 jones
   </target>
302
303 4962 leinfelder
	<taskdef resource="axis-tasks.properties" classpathref="compile.classpath"/>
304
305
	<target name="generateStubs" depends="prepare">
306
		<echo message=" Generating stubs for execution service from ${wsdl.url.kepler}" />
307
		<axis-wsdl2java verbose="true" output="${srcdir}"
308
			url="${wsdl.url.kepler}"  />
309
	</target>
310
311 1939 brooke
   <target name="compile" depends="prepare,utilities"
312 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
313 1939 brooke
314 1311 berkley
       <javac srcdir="${build.src}"
315
              destdir="${build.dest}"
316 1827 jones
              debug="${debug}"
317 3994 berkley
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
318 2599 jones
        <classpath>
319
          <path refid="compile.classpath"/>
320
        </classpath>
321
      </javac>
322 1311 berkley
   </target>
323 113 jones
324 2322 jones
   <target name="jar" depends="compile,geteml"
325 4513 daigle
    description="Compiles and jars metacat java code to metacat.jar in build dir ">
326 1939 brooke
327 353 jones
       <delete file="${build.dir}/${name}.jar" />
328 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
329 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
330 1311 berkley
   </target>
331
332 1939 brooke
   <target name="protocol" depends="compile"
333
    description="Compiles and jars protocol java code to protocol.jar in build dir">
334 635 jones
       <delete file="${build.dir}/protocol.jar" />
335
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
336
            includes="**/protocols/" />
337 1311 berkley
   </target>
338 113 jones
339 4514 daigle
   <target name="utilities" depends="config,getpeerutilities" if="utilities.required">
340 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
341
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
342 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
343
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
344
   </target>
345 4513 daigle
346
   <target name="getpeerutilities" depends="prepare" if="peer.utilities.required"
347 4959 daigle
	description="Checks utilities out of svn and copies it to your utilitiesdir if it does not already exist">
348
   	 <echo message="Exporting utiities files from svn repository:" />
349
   	 <!-- input message="Please enter svn repo username:" addproperty="svn.username" / -->
350
   	 <!-- input message="Please enter svn repo password:" addproperty="svn.password" / -->
351
   	 <!--  svn username="${svn.username}" password="${svn.password}" -->
352
   	 <svn>
353
   	   <export srcUrl="${svn.utilitiesUrl}" destPath="${utilitiesdir}" />
354
   	 </svn>
355
356
     <!--  ant dir="${utilitiesdir}" inheritAll="false"  target="dist" / -->
357 4513 daigle
   </target>
358 1780 jones
359 2461 sgarg
   <target name="getutilities" depends="prepare"
360 4959 daigle
   description="Checks utility out of svn and copies it to your metacat cvs sandbox">
361 2461 sgarg
     <echo>Enter CVS password: </echo>
362
     <cvs cvsRoot="${cvsroot}"
363 2468 sgarg
          package="${util-module}"
364 4611 daigle
     	  tag="${utilities-tag}"
365 2461 sgarg
          dest="${build.tmp}" />
366
   </target>
367
368 1939 brooke
   <target name="client" depends="utilities, prepare"
369
    description="Compiles metacat-client java code to build dir">
370 1780 jones
       <javac srcdir="${build.src}"
371
              destdir="${build.dest}"
372 2599 jones
              includes="edu/ucsb/nceas/metacat/client/*">
373
          <classpath>
374
            <path refid="compile.classpath"/>
375
          </classpath>
376
        </javac>
377 1780 jones
   </target>
378
379 1939 brooke
   <target name="clientjar" depends="client"
380
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
381 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
382
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
383
            includes="**/metacat/client/" />
384
   </target>
385
386 2748 costa
    <target name="advancedsearchjar" depends="compile"
387
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
388
        <delete file="${build.dir}/advancedsearch.jar" />
389
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
390
             includes="**/metacat/advancedsearch/" />
391
    </target>
392
393 2059 costa
   <target name="harvester" depends="client"
394 1950 costa
           description="Compiles harvester java code to build dir">
395
       <javac srcdir="${build.src}"
396
              destdir="${build.dest}"
397 2599 jones
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
398
          <classpath>
399
            <path refid="compile.classpath"/>
400
          </classpath>
401
        </javac>
402 1950 costa
   </target>
403
404
   <target name="harvesterjar" depends="harvester"
405 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
406
       <delete file="${build.dir}/harvester.jar" />
407
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
408 1950 costa
            includes="**/metacat/harvesterClient/" />
409
   </target>
410
411 2369 costa
   <target name="harvestListEditorDist" depends="harvesterjar"
412
           description="Prepares a distribution of the Harvest List Editor tool">
413 2401 costa
       <mkdir dir="${dist.dir.hle}"/>
414
       <delete dir="${ver.dir.hle}" />
415
       <mkdir dir="${ver.dir.hle}"/>
416
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
417
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
418
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
419
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
420
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
421
       <delete file="./harvest-list-editor-${release}.zip"/>
422
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
423
       <delete file="./harvest-list-editor-${release}.tar.gz" />
424
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
425
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
426
             src="./harvest-list-editor-${release}.tar"/>
427
       <delete file="./harvest-list-editor-${release}.tar" />
428 2369 costa
   </target>
429 4513 daigle
430 4240 daigle
   <target  name="geteml" depends="getemlpre2,geteml2+,getConversionXSL" if="eml.required"
431 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
432
433 2318 jones
   <target name="getemlpre2" depends="prepare" if="eml.required"
434 1939 brooke
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
435 1612 tao
     <echo>Enter CVS password: </echo>
436
     <cvs cvsRoot="${cvsroot}"
437
          package="${eml-module}"
438 4841 daigle
          tag="${eml-beta-tag}"
439
          dest="${build.tmp}/eml_${eml-beta-tag}" />
440 1612 tao
     <mkdir dir="lib/dtd" />
441
     <copy todir="lib/dtd" filtering="yes">
442 4841 daigle
       <fileset dir="${build.tmp}/eml_${eml-beta-tag}/${eml-module}">
443 1612 tao
         <include name="*.dtd"/>
444
       </fileset>
445
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
446
     </copy>
447 2228 sgarg
448
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
449 4841 daigle
       <fileset dir="${build.tmp}/eml_${eml-beta-tag}/${eml-module}/style">
450 2228 sgarg
       <include name="**/*.xsl"/>
451
     </fileset>
452
     </copy>
453 1939 brooke
   </target>
454
455 2318 jones
   <target name="geteml2+" depends="prepare" if="eml.required"
456 1939 brooke
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
457
     <echo>Enter CVS password: </echo>
458 1612 tao
     <cvs cvsRoot="${cvsroot}"
459
          package="${eml-module}"
460 4841 daigle
          tag="${eml2_0_0-schema-tag}"
461
          dest="${build.tmp}/eml_${eml2_0_0-schema-tag}" />
462 2228 sgarg
     <mkdir dir="lib/schema/eml-2.0.0" />
463
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
464 4841 daigle
       <fileset dir="${build.tmp}/eml_${eml2_0_0-schema-tag}/${eml-module}">
465 1612 tao
         <include name="*.xsd"/>
466
       </fileset>
467 2175 tao
468 1939 brooke
       <!-- shouldn't we have a mapper here like this??
469
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
470 2175 tao
471
       Jing's code didn't nave one - does it need to be added?
472 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
473 2175 tao
474 1612 tao
     </copy>
475 3018 sgarg
     <!-- <antcall target="copyxsl">
476 4841 daigle
        <param name="cvs.tagname" value="${eml2_0_0-schema-tag}" />
477 2228 sgarg
        <param name="dirname" value="eml-2.0.0" />
478 3018 sgarg
     </antcall> -->
479 3807 tao
480
   	<!-- Checkout eml201 for given schema tag-->
481 2228 sgarg
     <echo>Enter CVS password: </echo>
482
     <cvs cvsRoot="${cvsroot}"
483
          package="${eml-module}"
484 3807 tao
          tag="${eml2_0_1-schema-tag}"
485
          dest="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
486 2228 sgarg
     <mkdir dir="lib/schema/eml-2.0.1" />
487
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
488 3807 tao
       <fileset dir="${build.tmp}/eml_${eml2_0_1-schema-tag}/${eml-module}">
489 2228 sgarg
         <include name="*.xsd"/>
490
       </fileset>
491
     </copy>
492 3807 tao
493
   	<!-- Checkout eml201 again for given style sheet tag-->
494 4841 daigle
   	<!-- echo>Enter CVS password: </echo>
495 3807 tao
   	     <cvs cvsRoot="${cvsroot}"
496
   	          package="${eml-module}"
497
   	          tag="${eml2_0_1-style-tag}"
498
   	          dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
499 2228 sgarg
     <antcall target="copyxsl">
500 3807 tao
        <param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
501 2228 sgarg
        <param name="dirname" value="eml-2.0.1" />
502 4841 daigle
     </antcall -->
503 4328 daigle
504
   	<!-- Checkout eml210 for given schema tag-->
505
     <echo>Enter CVS password: </echo>
506
     <cvs cvsRoot="${cvsroot}"
507
          package="${eml-module}"
508
          tag="${eml2_1_0-schema-tag}"
509
          dest="${build.tmp}/eml_${eml2_1_0-schema-tag}" />
510
     <mkdir dir="lib/schema/eml-2.1.0" />
511
     <copy todir="lib/schema/eml-2.1.0" filtering="yes">
512
       <fileset dir="${build.tmp}/eml_${eml2_1_0-schema-tag}/${eml-module}">
513
         <include name="*.xsd"/>
514
       </fileset>
515
     </copy>
516
517
   	<!-- Checkout eml210 for given style sheet tag-->
518
   	<echo>Enter CVS password: </echo>
519
   	     <cvs cvsRoot="${cvsroot}"
520
   	          package="${eml-module}"
521 4841 daigle
   	          tag="${eml2-style-tag}"
522
   	          dest="${build.tmp}/eml_${eml2-style-tag}" />
523 4328 daigle
     <antcall target="copyxsl">
524 4841 daigle
        <param name="cvs.tagname" value="${eml2-style-tag}" />
525
        <!-- param name="dirname" value="eml-2.1.0" / -->
526
        <param name="dirname" value="eml-2" />
527 4328 daigle
     </antcall>
528 1939 brooke
   </target>
529
530 2175 tao
   <target  name="copyxsl"
531 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
532 4080 daigle
533 1939 brooke
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
534 2175 tao
535 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
536
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
537 1929 brooke
       <include name="**/*.xsl"/>
538 1612 tao
     </fileset>
539
     </copy>
540 1939 brooke
541 2175 tao
542
     <!-- now copy default css from eml module and put it in style-common-path
543 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
544 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
545 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
546 1612 tao
547 1463 tao
   </target>
548 3335 tao
549 3817 tao
   <target name="correctEML201Docs" depends="jar"
550
		            description="Uses the ant  task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
551
	   	<copy todir="${build.dir}" file="lib/metacat.properties" filtering="yes"/>
552
	   	 <java classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector" >
553
		         <classpath>
554
		          <path refid="compile.classpath"/>
555
		          <fileset dir="${build.dir}">
556
		            <include name="${name}.jar"/>
557
		          </fileset>
558
		        </classpath>
559
		      </java>
560
   </target>
561 2353 sgarg
562 3072 perry
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
563 3034 perry
           description="Installs spatial option for metacat">
564
565
      <property name="spatial.dir" value="./lib/spatial"/>
566
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
567
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
568
569
      <!-- Copy geoserver libs into ${war.lib} -->
570
      <copy todir="${war.lib}" filtering="no">
571
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
572
          <include name="**"/>
573
        </fileset>
574
      </copy>
575
576
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
577
      <copy todir="${war.webinf}" filtering="no">
578
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
579
          <exclude name="lib/**"/>
580
          <exclude name="web.xml"/>
581
        </fileset>
582
      </copy>
583
584
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
585
      <copy todir="${war.context}" filtering="no">
586
        <fileset dir="${spatial.geoserver.dir}">
587
          <exclude name="WEB-INF/**"/>
588
          <exclude name="index.jsp"/>
589
        </fileset>
590
      </copy>
591
592
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
593
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
594
          tofile="${war.context}/geoserver.jsp"
595
          overwrite="true"
596
          filtering="no"/>
597
598
      <!-- Copy the rest of the modified geoserver web-inf files
599
      <copy todir="${war.webinf}" filtering="no">
600
        <fileset dir="${spatial.webinf-mods}">
601
          <exclude name="web.xml.combined"/>
602
        </fileset>
603
      </copy> -->
604
605
    </target>
606
607 4873 daigle
   <target name="install" depends="build-metacat" description="* Full Install For Development *">
608 4720 daigle
     <copy file="${dist.dir}/${metacat.context}.war" todir="${app.deploy.dir}"/>
609
   	 <delete dir="${app.deploy.dir}/${metacat.context}" />
610 4080 daigle
   	   <tstamp>
611
   	   	 <format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa"/>
612
   	   </tstamp>
613
   	 <echo>Dev install completed at ${NOW}</echo>
614
   </target>
615 3034 perry
616 4638 daigle
   <target name="build-metacat" depends="install-ecogrid"
617
   	            description="Build Metacat">
618
   </target>
619 2957 tao
620 4797 daigle
   <target name="install-ecogrid" depends="warPrepare, get-ecogrid" if="enable.ecogrid"
621 2957 tao
			    description="Install Ecogrid Compentent">
622 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
623 2977 tao
   	         <property name="context" value="${metacat.context}"/>
624
   	   	     <property name="target" value="${ecogrid-target-name}"/>
625 4405 daigle
   	   	     <!-- property name="metacat.dir" value="."/ -->
626 2977 tao
   	  </ant>
627 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
628 2957 tao
   	     <property name="context" value="${metacat.context}"/>
629
   	     <property name="target" value="${ecogrid-target-name}"/>
630 4405 daigle
   	     <!-- property name="metacat.dir" value="."/ -->
631 2957 tao
   	  </ant>
632 4797 daigle
   	  <!-- war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
633 2978 tao
  	      <webinf dir="${ecogrid-dir}/lib">
634
   	        <include name="server-config.wsdd"/>
635
   	      </webinf>
636 4797 daigle
   	  </war -->
637 2965 tao
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
638 2978 tao
639
640 2957 tao
   </target>
641 2965 tao
642 4960 walbridge
   <target name="get-ecogrid" depends="init" description="Check out ecogrid module" if="ecogrid.required">
643
	     <svn>
644
   	    <export srcUrl="${svn.ecogridUrl}" destPath="${ecogrid-dir}" />
645
			 </svn>
646 4098 daigle
   </target>
647 2965 tao
648 4841 daigle
   <!-- target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
649 2991 berkley
   	 <ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
650 2957 tao
   	   	 <property name="context" value="${metacat.context}"/>
651
   	   	 <property name="target" value="${ecogrid-target-name}"/>
652 4405 daigle
   	     <property name="metacat.dir" value="."/>
653 4794 daigle
   	     <property name="hostname" value="${ecogrid.hostname}"/>
654 2977 tao
   	     <property name="port" value="${config.port}"/>
655 2957 tao
   	 </ant>
656 4841 daigle
   </target -->
657 2978 tao
658
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
659 4720 daigle
      <delete file="${app.deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
660 2978 tao
   </target>
661 1952 jones
662 4240 daigle
   <!-- target name="install-registry" depends="init,getConversionXSL"
663 1952 jones
            description="Install Registry">
664 2175 tao
665 4080 daigle
      <mkdir dir="${inst.cgi.dir}" />
666 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
667 4080 daigle
            todir="${inst.cgi.dir}"/>
668 1952 jones
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
669 2175 tao
670 4240 daigle
      <! - - TODO SCW: set the permissions on this folder to be writable by the apache user - - >
671 1952 jones
      <mkdir dir="${temp-dir}" />
672 4240 daigle
      <! - - TODO SCW: use relative paths to grab these instead of copying to tmp,
673
                     used in readDocumentFromMetacat - - >
674 2343 sgarg
      <copy todir="${temp-dir}" filtering="yes">
675
       <fileset dir="lib/style/common/emlb6toeml2">
676 1952 jones
         <include name="*.xsl"/>
677
         <include name="*.xml"/>
678
       </fileset>
679 2343 sgarg
      </copy>
680 1952 jones
681
      <echo message="Install Registry completed." />
682 4240 daigle
   </target -->
683 1952 jones
684 4240 daigle
   <!-- target name="install-ldap" depends="init"
685 4080 daigle
            description="Install Metacat LDAP Access">
686
687
      <mkdir dir="${inst.cgi.dir}" />
688 2343 sgarg
      <copy file="${srcdir}/perl/ldapweb.cgi"
689 4080 daigle
            todir="${inst.cgi.dir}" />
690 2343 sgarg
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
691
      <mkdir dir="${templates.dir}" />
692 4080 daigle
      <copy todir="${templates.dir}">
693 2343 sgarg
        <fileset dir="lib/style/common/templates">
694 4240 daigle
			< ! - - SCW: Copy all files - - >
695 2343 sgarg
        </fileset>
696
      </copy>
697
      <echo message="ldapweb install complete." />
698 4240 daigle
   </target -->
699 2343 sgarg
700
701 2175 tao
   <target name="install-skin" depends="init"
702 2052 sgarg
            description="Install a Skin">
703
704 3994 berkley
      <input message="Please enter name of the skin"
705
             addproperty="skin-name"/>
706 2052 sgarg
707
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
708
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
709
       <fileset dir="lib/style/skins/${skin-name}">
710 3014 costa
           <exclude name="**/*.png"/>
711
           <exclude name="**/*.gif"/>
712
           <exclude name="**/*.jpg"/>
713 2277 jones
           <exclude name="**/CVS*"/>
714
           <exclude name="**/.#*"/>
715 2052 sgarg
       </fileset>
716
      </copy>
717 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
718
       <fileset dir="lib/style/skins/${skin-name}">
719 3014 costa
           <include name="**/*.png"/>
720 3994 berkley
           <include name="**/*.gif"/>
721 3014 costa
           <include name="**/*.jpg"/>
722 2277 jones
           <exclude name="**/CVS*"/>
723
           <exclude name="**/.#*"/>
724 2054 sgarg
       </fileset>
725
      </copy>
726 2974 jones
      <copy todir="${installdir}/style/common" filtering="yes">
727
       <fileset dir="lib/style/common">
728
           <include name="*.js"/>
729
           <include name="*.jsp"/>
730
           <include name="*.css"/>
731
           <exclude name="*.png"/>
732
           <exclude name="*.gif"/>
733
           <exclude name="*.jpg"/>
734
           <exclude name="**/CVS*"/>
735
           <exclude name="**/.#*"/>
736
       </fileset>
737
      </copy>
738 2277 jones
      <!--
739 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
740
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
741
       <fileset dir="lib/style/skins/${skin-name}/images">
742
           <include name="*.png"/>
743
           <include name="*.gif"/>
744
           <include name="*.jpg"/>
745
       </fileset>
746
      </copy>
747 2277 jones
      -->
748 2052 sgarg
749
      <echo message="Install Skin completed." />
750
   </target>
751
752 4098 daigle
   <target name="war" depends="warPrepare,install-spatial"
753 1952 jones
            description="Create a web archive (WAR) for servlet deployment">
754 2737 jones
       <mkdir dir="${dist.dir}" />
755
       <war destfile="${dist.dir}/${metacat.context}.war"
756 1952 jones
            webxml="${build.war}/web.xml">
757
         <fileset dir="${war.context}"/>
758
         <lib dir="${war.lib}"/>
759
         <webinf dir="${war.webinf}"/>
760
       </war>
761
   </target>
762 2957 tao
763 4435 daigle
   <target name="warPrepare" depends="cgiPrepare,jar,clientjar,harvesterjar,testPrepare"
764 1952 jones
            description="Prepare files for creating a web archive (WAR)">
765
766
       <property name="war.lib" value="${build.war}/lib" />
767
       <property name="war.webinf" value="${build.war}/WEB-INF" />
768 2737 jones
       <property name="war.context" value="${build.war}/${metacat.context}" />
769 4098 daigle
   	   <property name="war.webinf.sql" value="${war.webinf}/sql" />
770 4819 daigle
   	   <property name="war.webinf.scripts" value="${war.webinf}/scripts" />
771 4369 daigle
	   <property name="war.context.cgi" value="${war.context}/cgi-bin" />
772 4080 daigle
   	   <property name="war.context.docs" value="${war.context}/docs" />
773 4240 daigle
   	   <property name="war.context.temp" value="${war.context}/temp" />
774
   	   <property name="war.context.templates" value="${war.context}${style-common-relpath}/templates" />
775 1952 jones
       <mkdir dir="${war.lib}" />
776
       <mkdir dir="${war.webinf}" />
777
       <mkdir dir="${war.context}" />
778 4098 daigle
   	   <mkdir dir="${war.webinf.sql}" />
779 4369 daigle
	   <mkdir dir="${war.context.cgi}" />
780 4080 daigle
   	   <mkdir dir="${war.context.docs}" />
781 4240 daigle
   	   <mkdir dir="${war.context.temp}" />
782
       <mkdir dir="${war.context.templates}" />
783 2610 tao
784 4098 daigle
	   <!--copy file="${lib.dir}/${jdbc.lib.postgres}" todir="${war.lib}" / -->
785
       <!--copy file="${lib.dir}/${jdbc.lib.sqlserver1}" todir="${war.lib}" / -->
786
       <!--copy file="${lib.dir}/${jdbc.lib.sqlserver2}" todir="${war.lib}" / -->
787
       <!--copy file="${lib.dir}/${jdbc.lib.sqlserver3}" todir="${war.lib}" / -->
788 1952 jones
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
789
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
790 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
791 1952 jones
       <copy todir="${war.lib}" filtering="no">
792 1823 jones
         <fileset dir="lib">
793 4098 daigle
<!--
794
         	<not>
795 2610 tao
               <filename name="${jdbc-jar-name}"/>
796
            </not>
797 4098 daigle
-->
798 2610 tao
            <include name="*.jar"/>
799 1823 jones
         </fileset>
800 3059 berkley
         <fileset dir="lib">
801
           <include name="xalan.jar"/>
802 3194 berkley
           <include name="gwt*.jar"/>
803 1823 jones
         </fileset>
804 4943 costa
         <fileset dir="lib/oaipmh">
805
           <include name="oaicat.jar"/>
806
         </fileset>
807 1823 jones
       </copy>
808 4080 daigle
       <!-- MCD copy file="lib/web.xml.${tomcatversion}"
809
             tofile="${build.war}/web.xml" / -->
810
       <!-- MCD added next - Remove the tomcat5 reference-->
811
   	   <copy file="lib/web.xml.tomcat5"
812
   	             tofile="${build.war}/web.xml"/>
813 1952 jones
       <copy file="lib/metacat.properties" todir="${war.webinf}"
814 1951 jones
             filtering="yes" />
815 4080 daigle
   	   <copy file="lib/metacat.properties.metadata.xml" todir="${war.webinf}"
816 3099 jones
   	             filtering="no" />
817 4080 daigle
	   <copy file="lib/org.properties.metadata.xml" todir="${war.webinf}"
818
	             filtering="no" />
819 4593 daigle
	   <copy file="lib/auth.properties.metadata.xml" todir="${war.webinf}"
820 4162 daigle
	             filtering="no" />
821 2900 sgarg
       <copy todir="${war.webinf}" filtering="yes">
822
	   	  <fileset dir="lib">
823
           <include name="skin.configs/**"/>
824
		  </fileset>
825
	   </copy>
826 2583 sgarg
       <copy file="lib/log4j.properties" todir="${war.webinf}"
827
             filtering="yes" />
828 1952 jones
       <copy todir="${war.context}" filtering="no">
829 822 jones
         <fileset dir="lib">
830
           <include name="**/*.jpg"/>
831
           <include name="**/*.png"/>
832
           <include name="**/*.gif"/>
833 2844 costa
           <include name="LiveMap_30/**"/>
834 4943 costa
           <include name="oaipmh/**"/>
835 822 jones
         </fileset>
836
       </copy>
837 1952 jones
       <copy todir="${war.context}" filtering="yes">
838 822 jones
         <fileset dir="lib">
839
           <exclude name="*.jar"/>
840
           <exclude name="*.properties"/>
841 4080 daigle
         	<exclude name="*.metadata.xml"/>
842 822 jones
           <exclude name="web.xml"/>
843 1437 berkley
           <exclude name="**/*.jpg"/>
844
           <exclude name="**/*.png"/>
845
           <exclude name="**/*.gif"/>
846 2778 jones
           <exclude name="lsid_lib/**"/>
847
           <exclude name="lsid_conf/**"/>
848 2844 costa
           <exclude name="LiveMap_30/**"/>
849 4943 costa
           <exclude name="oaipmh/**"/>
850 2900 sgarg
           <exclude name="skin.configs/**"/>
851 3034 perry
           <exclude name="spatial/geoserver/**"/>
852
           <exclude name="spatial/WEB-INF/**"/>
853 822 jones
         </fileset>
854
       </copy>
855 4193 daigle
       <copy todir="${war.context.docs}" filtering="yes">
856
          <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
857
       </copy>
858
       <copy todir="${war.context.docs}" filtering="no">
859
          <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
860
       </copy>
861 4098 daigle
	   <copy todir="${war.webinf.sql}" filtering="yes">
862 4080 daigle
	         <fileset dir="src">
863
	           <include name="**/*.sql"/>
864
	         </fileset>
865
	   </copy>
866 4819 daigle
	   <copy todir="${war.webinf.scripts}" filtering="yes">
867
	         <fileset dir="src/scripts"/>
868
	   </copy>
869
       <copy todir="${war.webinf.scripts}"
870
             file="src/perl/Metacat/blib/lib/auto/Metacat/autosplit.ix"
871
             failonerror="false"/>
872 4369 daigle
873
   	   <copy file="src/perl/register-dataset.cgi" todir="${war.context.cgi}"/>
874
	   <copy file="src/perl/ldapweb.cgi" todir="${war.context.cgi}" />
875 4515 daigle
	   <copy file="src/perl/Metacat/Metacat.pm" todir="${war.lib}" />
876 4369 daigle
877
	   <!-- registry cgi section -->
878
	   <!-- TODO SCW: use relative paths to grab these instead of copying to tmp,
879 4240 daigle
                   used in readDocumentFromMetacat -->
880 4369 daigle
	   <!-- TODO MCD copy temp files to actual location using config util?? -->
881
	   <copy todir="${war.context.temp}" filtering="yes">
882
		  <fileset dir="lib/style/common/emlb6toeml2">
883
 		    <include name="*.xsl"/>
884
			<include name="*.xml"/>
885
		  </fileset>
886
	    </copy>
887
	    <available file="lib/style/common/emlb6toeml2" type="dir"
888
                 property="styles.not.needed"/>
889
890
	    <!-- ldap cgi section -->
891
	    <copy todir="${war.context.templates}">
892
		    <fileset dir="lib/style/common/templates">
893
			    <!-- SCW: Copy all files -->
894
		    </fileset>
895
	    </copy>
896
    </target>
897
898 4820 daigle
	<target name="cgiPrepare" if="build.perl">
899
		<exec dir="src/perl/Metacat/" executable="make" >
900
			<arg value="clean" />
901
		</exec>
902
		<exec dir="src/perl/Metacat/" executable="perl" >
903 4369 daigle
			<arg value="Makefile.PL" />
904
		</exec>
905 4820 daigle
		<exec dir="src/perl/Metacat/" executable="make" />
906 4369 daigle
	</target>
907 4435 daigle
908 4550 daigle
	<target name="testPrepare"
909 4435 daigle
		description="Copies test files into the war directories">
910
		<echo>in testPrepare</echo>
911
		<property name="war.context.test" value="${build.war}/${metacat.context}/test" />
912
		<mkdir dir="${war.context.test}" />
913
	    <copy todir="${war.context.test}" filtering="yes">
914
		   <fileset dir="test/servertestfiles">
915
	          <include name="*/**"/>
916
		   </fileset>
917
		</copy>
918
	</target>
919 1929 brooke
920 2175 tao
   <target name="getConversionXSL" depends="prepare"
921 1954 jones
            unless="styles.not.needed"
922 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
923 2497 sgarg
924 1929 brooke
     <echo>Enter CVS password: </echo>
925 2497 sgarg
     <cvs cvsRoot="${cvsroot}"
926
          package="${eml-module}"
927 4843 daigle
          tag="${eml2-style-tag}"
928
          dest="${build.tmp}/eml_${eml2-style-tag}" />
929 2343 sgarg
930
     <mkdir dir="lib/style/common/emlb6toeml2" />
931
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
932 4843 daigle
       <fileset dir="${build.tmp}/eml_${eml2-style-tag}/${eml-module}/lib/beta6toeml2/xsl">
933 2343 sgarg
         <include name="*.xsl"/>
934
         <include name="*.xml"/>
935
       </fileset>
936
      </copy>
937 1929 brooke
   </target>
938
939 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
940 1783 jones
      <mkdir dir="${build.tests}"/>
941
      <copy todir="${build.tests}" filtering="yes">
942
        <fileset dir="${testdir}">
943
          <include name="edu/**"/>
944
        </fileset>
945
      </copy>
946 4382 daigle
   	  <copy todir="${build.tests}" file="${testdir}/test.properties" filtering="yes"/>
947 4121 daigle
948 971 tao
      <!-- copy and compile the tests into a jar file -->
949 1783 jones
      <javac srcdir="${build.tests}"
950
             destdir="${build.tests}"
951 1612 tao
             debug="on"
952 2982 jones
             includes="**/*.java">
953 2599 jones
        <classpath>
954
          <path refid="compile.classpath"/>
955
          <fileset dir="${build.dir}">
956 2982 jones
            <include name="${name}.jar"/>
957
            <include name="${name}-client.jar"/>
958
            <include name="harvester.jar"/>
959 2599 jones
          </fileset>
960
        </classpath>
961
      </javac>
962 204 jones
963 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
964 1783 jones
        basedir="${build.tests}"
965 1311 berkley
                includes="**/*.class" />
966 1822 jones
   </target>
967 971 tao
968 1939 brooke
   <target name="test" depends="testprep"
969
            description="Uses the ant junit task to run all JUnit tests">
970 1822 jones
971 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
972 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
973 971 tao
             haltonerror="no">
974 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
975 971 tao
        <classpath>
976 2599 jones
          <path refid="compile.classpath"/>
977
          <fileset dir="${build.dir}">
978 2982 jones
            <include name="${name}.jar"/>
979
            <include name="${name}-client.jar"/>
980
            <include name="harvester.jar"/>
981
            <include name="${name}-junittests.jar"/>
982 2599 jones
          </fileset>
983 971 tao
        </classpath>
984
985
        <formatter type="plain" />
986
987
        <batchtest fork="yes" todir="${build.dir}">
988 1783 jones
          <fileset dir="${build.tests}">
989 4304 daigle
            <include name="**/*.class"/>
990 4147 daigle
          	<exclude name="**/MCTestCase.class" />
991 4304 daigle
          	<exclude name="**/ClientViewHelperTest.class" />
992 971 tao
          </fileset>
993
        </batchtest>
994
     </junit>
995
   </target>
996 1103 tao
997 1939 brooke
    <target name="runonetest" depends="testprep"
998
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
999 1500 tao
1000 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
1001
1002 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1003 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1004 3747 tao
             haltonerror="no" showoutput="yes">
1005 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1006 1500 tao
        <classpath>
1007 2599 jones
          <path refid="compile.classpath"/>
1008
          <fileset dir="${build.dir}">
1009 2982 jones
            <include name="${name}.jar"/>
1010
            <include name="${name}-client.jar"/>
1011
            <include name="harvester.jar"/>
1012
            <include name="${name}-junittests.jar"/>
1013 2599 jones
          </fileset>
1014 1500 tao
        </classpath>
1015
1016
        <formatter type="plain" />
1017
1018
        <batchtest fork="yes" todir="${build.dir}">
1019 1783 jones
          <fileset dir="${build.tests}">
1020 1500 tao
            <include name="**/${testtorun}.class" />
1021
          </fileset>
1022
        </batchtest>
1023
     </junit>
1024
   </target>
1025
1026 2175 tao
   <target name="testharvester"
1027 2135 costa
           depends="testprep"
1028
           description="Uses the ant junit task to test only the Harvester code">
1029 2175 tao
     <junit printsummary="yes"
1030
            haltonfailure="off"
1031 2135 costa
            fork="yes"
1032
            haltonerror="off">
1033 2599 jones
        <classpath>
1034
          <path refid="compile.classpath"/>
1035
          <fileset dir="${build.dir}">
1036 2982 jones
            <include name="${name}.jar"/>
1037
            <include name="${name}-client.jar"/>
1038
            <include name="harvester.jar"/>
1039
            <include name="${name}-junittests.jar"/>
1040 2599 jones
          </fileset>
1041
        </classpath>
1042 2135 costa
       <formatter type="plain" />
1043
       <batchtest fork="yes" todir="${build.dir}">
1044
         <fileset dir="${build.tests}">
1045
           <include name="**/harvesterClient/*.class" />
1046
         </fileset>
1047
       </batchtest>
1048
     </junit>
1049
   </target>
1050
1051 1939 brooke
  <target name="gethttpclient" depends="prepare"
1052
            description="checks out and compiles morpho httpclient code">
1053 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
1054 1487 tao
        <cvs cvsRoot="${cvsroot}"
1055 1103 tao
             package="morpho"
1056
             dest="." />
1057 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1058 1103 tao
   </target>
1059
1060
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1061 4720 daigle
   <target name="nettest" depends="install"
1062 1939 brooke
            description="compiles and runs the metacatnettest code">
1063 2175 tao
1064 1103 tao
      <echo>***********************************
1065 1311 berkley
      Please run ant gethttpclient first!
1066
      ***********************************
1067 1103 tao
      </echo>
1068
      <!-- copy and compile the tests into a jar file -->
1069 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
1070 1103 tao
      <javac srcdir="${junitnettestsdir}"
1071 1116 tao
             destdir="${build.metacatnettest}"
1072 2599 jones
             includes="**/*.java">
1073
        <classpath>
1074
          <path refid="compile.classpath"/>
1075
          <fileset dir="${build.dir}">
1076 2982 jones
            <include name="${name}.jar"/>
1077 2599 jones
          </fileset>
1078
        </classpath>
1079
      </javac>
1080 1103 tao
1081
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1082 1116 tao
                    basedir="${build.metacatnettest}"
1083 1103 tao
                    includes="**/*.class" />
1084
1085
      <!-- use the ant "junit" task to run JUnit tests. -->
1086 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1087 1103 tao
             haltonerror="no">
1088 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1089 1103 tao
        <classpath>
1090 2599 jones
          <path refid="compile.classpath"/>
1091
          <fileset dir="${build.dir}">
1092 2982 jones
            <include name="${name}.jar"/>
1093
            <include name="${name}-junitnettests.jar"/>
1094 2599 jones
          </fileset>
1095 1103 tao
        </classpath>
1096
1097
        <formatter type="plain" />
1098
1099
        <batchtest fork="yes" todir="${build.dir}">
1100 1116 tao
          <fileset dir="${build.metacatnettest}">
1101
            <include name="**/*.class" />
1102 1103 tao
          </fileset>
1103
        </batchtest>
1104
     </junit>
1105 1311 berkley
   </target>
1106 1103 tao
1107 1939 brooke
   <target name="cleanweb" depends="clean"
1108
            description="deletes tomcat web context dir and all its contents">
1109 1522 berkley
     <delete dir="${installdir}" />
1110
   </target>
1111
1112
1113 1939 brooke
   <target name="clean" depends="init"
1114 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1115 822 jones
       <delete dir="${build.dir}" />
1116 2737 jones
       <delete dir="${dist.dir}" />
1117 2320 jones
   </target>
1118
1119 4098 daigle
	<target name="localclean" depends="clean"
1120
	            description="deletes even jars that depend on external sources such as stylesheets and jars">
1121
	       <delete file="lib/httpclient.jar" />
1122
	       <delete file="lib/utilities.jar" />
1123
	</target>
1124
1125
   <target name="fullclean" depends="localclean"
1126
            description="deletes code and eml">
1127 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1128
         <fileset dir="${style-common-cvsrelpath}">
1129
           <include name="${eml-css}" />
1130
           <include name="eml-*/*.xsl" />
1131
           <include name="eml-*" />
1132
         </fileset>
1133 4080 daigle
       	 <fileset dir="${schema-cvsrelpath}">
1134
       	   <include name="eml-*/*.xsd" />
1135
       	 </fileset>
1136 4369 daigle
       	 <fileset dir="${ecogrid-dir}">
1137
       		<include name="build.properties" />
1138
       		<include name="buildfiles/metacatImpl.xml" />
1139
         </fileset>
1140 2320 jones
       </delete>
1141 113 jones
   </target>
1142
1143 1939 brooke
   <target name="jdoc" depends="prepare"
1144
            description="generates javadoc documentation">
1145 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1146 516 jones
           sourcepath="${build.src}"
1147
           destdir="${build.javadocs}"
1148 113 jones
           author="true"
1149
           version="true"
1150
           use="true"
1151 348 jones
           windowtitle="${Name} API"
1152
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1153 2599 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1154
         <classpath>
1155
           <path refid="compile.classpath"/>
1156
         </classpath>
1157
       </javadoc>
1158 113 jones
   </target>
1159
1160 2461 sgarg
   <target name="dist"
1161 2965 tao
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1162 1939 brooke
            description="prepares a full release distribution">
1163 806 jones
      <mkdir dir="${dist.dir}"/>
1164
      <delete dir="${ver.dir}" />
1165
      <mkdir dir="${ver.dir}"/>
1166
      <copy todir="${ver.dir}">
1167 1311 berkley
        <fileset dir="."
1168 4648 daigle
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/** metacat*.tar.gz metacat*.tar metacat*.zip"/>
1169 806 jones
      </copy>
1170
      <copy todir="${ver.dir}" file="build.xml"/>
1171 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1172 882 jones
1173
      <copy todir="${ver.dir}/docs" filtering="yes">
1174
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1175
      </copy>
1176
      <copy todir="${ver.dir}/docs" filtering="no">
1177
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1178
      </copy>
1179 806 jones
      <copy todir="${ver.dir}/docs/dev">
1180
        <fileset dir="${build.dir}/docs"/>
1181
      </copy>
1182 917 berkley
      <copy todir="${ver.dir}/src">
1183
        <fileset dir="${build.dir}/src"/>
1184
      </copy>
1185 4648 daigle
1186
   	  <mkdir dir="${ver.dir}/tests/servertestfiles"/>
1187
	  <copy todir="${ver.dir}/test/servertestfiles">
1188
	    <fileset dir="./test/servertestfiles"/>
1189
	  </copy>
1190 1311 berkley
  </target>
1191 806 jones
1192 4797 daigle
	<target name="distbin" depends="build-metacat,war-lsid" description="prepares a binary distribution">
1193 4372 daigle
		<copy todir="${dist.dir}">
1194 4641 daigle
			<fileset dir="./src/scripts"  />
1195 4372 daigle
		</copy>
1196
		<delete file="./${name}-bin-${release}.zip" />
1197
		<zip zipfile="./${name}-bin-${release}.zip"
1198
			basedir="${dist.dir}"
1199
			excludes="metacat-*/**"/>
1200
		<delete file="./${name}-bin-${release}.tar.gz" />
1201
		<tar tarfile="./${name}-bin-${release}.tar"
1202
			basedir="${dist.dir}"
1203
			excludes="metacat-*/**"/>
1204
		<gzip zipfile="./${name}-bin-${release}.tar.gz" src="./${name}-bin-${release}.tar" />
1205
		<delete file="./${name}-bin-${release}.tar" />
1206
	</target>
1207
1208 1939 brooke
  <target name="distsrc" depends="dist"
1209
            description="prepares a source distribution">
1210 806 jones
      <mkdir dir="${ver.src}"/>
1211
      <copy todir="${ver.src}">
1212
        <fileset dir="./src"/>
1213
      </copy>
1214 2461 sgarg
      <mkdir dir="${util.dir}"/>
1215
      <copy todir="${util.dir}">
1216
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1217
      </copy>
1218 2965 tao
1219
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1220
  	  <copy todir="${ecogrid-dist-dir}">
1221
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1222
  	  </copy>
1223 806 jones
1224 3131 perry
      <delete file="${ver.dir}/lib/utilities.jar"/>
1225
1226 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1227 4648 daigle
      <zip zipfile="./${name}-src-${release}.zip"
1228
      	   basedir="${dist.dir}"
1229
      	   excludes="metacat*.tar.gz,metacat*.zip"/>
1230 882 jones
      <delete file="./${name}-src-${release}.tar.gz" />
1231 4648 daigle
      <tar tarfile="./${name}-src-${release}.tar"
1232
      	   basedir="${dist.dir}"
1233
      	   excludes="metacat*.tar.gz,metacat*.zip"/>
1234 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1235 882 jones
                src="./${name}-src-${release}.tar"/>
1236 4669 daigle
      <delete file="./${name}-src-${release}.tar" />
1237
      <!--delete dir="${dist.dir}"/ -->
1238 1311 berkley
  </target>
1239 4658 daigle
1240
  <target name="deb-package" depends="distbin"
1241
  	  description="create a debian installation package">
1242
  	<delete dir="${deb.pkg.dir}"/>
1243
    <mkdir dir="${deb.pkg.dir}/DEBIAN"/>
1244
  	<copy todir="${deb.pkg.dir}/DEBIAN" filtering="yes">
1245
      <fileset dir="./src/scripts/debian"
1246
               includes="control postinst"/>
1247
    </copy>
1248
1249
    <mkdir dir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"/>
1250
  	<copy todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"
1251
  		  filtering="yes">
1252
      <fileset dir="./src/scripts/debian"
1253
               excludes="control postinst" />
1254
    </copy>
1255
  	<chmod file="${deb.pkg.dir}/DEBIAN/postinst"
1256
  	       perm="755"/>
1257
1258
  	<copy file="${dist.dir}/knb.war"
1259
  		  todir="${deb.pkg.dir}/usr/share/metacat-${metacat.version}"/>
1260
  	<copy file="./metacat-bin-${metacat.version}.tar.gz"
1261
  		  tofile="${deb.pkg.dir}/metacat_${metacat.version}.orig.tar.gz" />
1262
1263
    <exec dir="${pkg.dir}" executable="dpkg" os="Linux, Unix" failonerror="true">
1264
      <arg line="--build debian" />
1265
    </exec>
1266
1267
  	<move file="${pkg.dir}/debian.deb"
1268
  		  tofile="${pkg.dir}/metacat_${metacat.version}${metacat.releaseCandidate}_all.deb"/>
1269
  </target>
1270 806 jones
1271 1702 tao
   <target name="stylesheettest">
1272 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1273 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1274
      <param name="docid" expression="${input}"/>
1275
      <param name="entitytype" expression="${entitytype}"/>
1276
      <param name="entityindex" expression="${entityindex}"/>
1277
      <outputproperty name="method" value="html"/>
1278
      <outputproperty name="standalone" value="yes"/>
1279
      <outputproperty name="encoding" value="iso8859_1"/>
1280
      <outputproperty name="indent" value="yes"/>
1281
    </xslt>
1282
  </target>
1283 2175 tao
1284 3210 tao
1285 1814 tao
  <target name="compilewebclient" depends="prepare">
1286
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1287
  </target>
1288 2175 tao
1289 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1290 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1291 1814 tao
           dir="${build.dest}" fork="yes"
1292
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1293
         <arg value="${serviceUrl}"/>
1294
         <arg value="${docid}"/>
1295
     </java>
1296
  </target>
1297 2598 harris
1298 2639 harris
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1299 2598 harris
1300
    <echo message="Compiling the metatcat shapefile creator"/>
1301
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1302
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1303
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1304
    </exec>
1305
1306
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1307 2639 harris
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1308 2598 harris
    </exec>
1309
  </target>
1310
1311 2737 jones
    <!-- LSID Authority support -->
1312
    <patternset id="lsid.jars">
1313
        <include name="axis.jar" />
1314 2772 jones
        <include name="commons-discovery-0.2.jar" />
1315 2737 jones
        <include name="jaxrpc.jar" />
1316
        <include name="lsid-client-1.1.1.jar" />
1317
        <include name="lsid-server-1.1.1.jar" />
1318
        <include name="saaj.jar" />
1319 2772 jones
        <include name="wsdl4j-1.5.1.jar" />
1320 2737 jones
        <include name="activation.jar" />
1321
        <include name="castor-0.9.5.jar" />
1322
        <include name="dnsjava-1.3.2.jar" />
1323
        <include name="mail.jar" />
1324 2778 jones
        <include name="commons-logging-1.0.4.jar" />
1325
        <!-- These jars may be needed but seem to not actually be,
1326
             so leaving them out for now
1327
        <include name="axis-ant.jar" />
1328 2737 jones
        -->
1329
        <!--<include name="GenCastor.class" />-->
1330
    </patternset>
1331
    <patternset id="lib.jars">
1332
        <include name="httpclient.jar" />
1333
        <include name="log4j-1.2.12.jar" />
1334
        <include name="utilities.jar" />
1335
        <include name="xercesImpl.jar" />
1336
        <include name="xalan.jar" />
1337
        <include name="xml-apis.jar" />
1338
    </patternset>
1339
1340
    <path id="lsid.classpath">
1341
        <fileset dir="${lsid.lib.dir}">
1342
            <patternset refid="lsid.jars"/>
1343
        </fileset>
1344
        <fileset dir="${lib.dir}">
1345
            <patternset refid="lsid.jars"/>
1346
        </fileset>
1347 3059 berkley
        <fileset dir="${lib.dir}">
1348 2737 jones
            <include name="xalan.jar" />
1349
            <include name="xml-apis.jar" />
1350
        </fileset>
1351
        <fileset dir="${build.dir}">
1352
            <include name="metacat-client.jar" />
1353
        </fileset>
1354
    </path>
1355
1356
    <filterset id="configFilters">
1357 4080 daigle
        <!-- MCD BYE filter token="LSID_AUTHORITY_HOSTNAME"
1358
                value="${config.hostname}" / -->
1359
        <!-- MCD BYE filter token="LSID_AUTHORITY_PORT"
1360
                value="${config.port}" / -->
1361
        <!-- MCD BYE filter token="METADATA_LABELS"
1362
                value="${config.metadataLabelLsid}" / -->
1363
        <!-- MCD BYE filter token="METACAT_SERVER"
1364
                value="${config.metacatserver}" / -->
1365
        <!-- MCD BYE filter token="LSID_AUTHORITY_STRING"
1366
                value="${config.lsidauthority}" / -->
1367 2737 jones
    </filterset>
1368
1369
    <target name="prepare-lsid"
1370
            depends="prepare,utilities,clientjar"
1371
            description="Configure files prior to compilation">
1372
        <mkdir dir="${lsid.build.dir}" />
1373
        <!-- Copy the properties file into the build -->
1374
        <copy file="${conf.dir}/metacat-lsid.properties"
1375
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1376
              overwrite="true">
1377
            <filterset refid="configFilters" />
1378
        </copy>
1379 2817 jones
        <copy file="${conf.dir}/log4j.properties"
1380
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1381
              overwrite="true">
1382
            <filterset refid="configFilters" />
1383
        </copy>
1384 2737 jones
        <!-- Copy config files into the build -->
1385
        <copy todir="${lsid.build.dir}/WEB-INF">
1386
            <fileset dir="${webinf.dir}"
1387
                     includes="**/*.wsdd" />
1388
        </copy>
1389
        <!-- Copy the metadata configuration files into the build -->
1390
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1391
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1392
            <fileset dir="${conf.dir}"
1393
                     includes="**/*.xml" />
1394
            <fileset dir="${conf.dir}"
1395
                     includes="**/*.xslt" />
1396
            <filterset refid="configFilters" />
1397
        </copy>
1398
        <!-- Copy services files into the build -->
1399
        <mkdir dir="${lsid.build.dir}/services" />
1400
        <copy todir="${lsid.build.dir}/services">
1401
            <fileset dir="${services.dir}" />
1402
            <filterset refid="configFilters" />
1403
        </copy>
1404 2778 jones
        <!-- Copy axis files into the build -->
1405
        <mkdir dir="${lsid.build.dir}" />
1406
        <copy todir="${lsid.build.dir}">
1407
            <fileset dir="${conf.dir}/axis"
1408
                     excludes="*.properties"/>
1409
        </copy>
1410
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1411
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1412
            <fileset dir="${conf.dir}/axis"
1413
                     includes="*.properties"/>
1414
        </copy>
1415 2737 jones
    </target>
1416
1417
    <target name="compile-lsid"
1418
            depends="prepare-lsid"
1419
            description="Compile Java sources">
1420
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1421
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1422
               destdir="${lsid.build.dir}/WEB-INF/classes"
1423
               debug="${compile.debug}"
1424
               deprecation="${compile.deprecation}"
1425
               optimize="${compile.optimize}">
1426
            <classpath refid="lsid.classpath" />
1427
        </javac>
1428
    </target>
1429
1430
    <target name="war-lsid"
1431
            depends="compile-lsid"
1432
            description="Create a war file for the application">
1433
        <mkdir dir="${dist.dir}" />
1434
        <war destfile="${dist.dir}/${authority.context}.war"
1435
             webxml="${webinf.dir}/web.xml">
1436
            <fileset dir="${lsid.build.dir}" />
1437
            <lib dir="${lsid.lib.dir}">
1438
                <patternset refid="lsid.jars"/>
1439
            </lib>
1440
            <lib dir="${lib.dir}">
1441
                <patternset refid="lib.jars"/>
1442
            </lib>
1443 3059 berkley
            <lib dir="${lib.dir}">
1444 2737 jones
                <include name="xalan.jar" />
1445
                <include name="xml-apis.jar" />
1446
            </lib>
1447
            <lib dir="${build.dir}">
1448
                <include name="metacat-client.jar" />
1449
            </lib>
1450
        </war>
1451
    </target>
1452
1453
    <target name="deploy-lsid"
1454
            depends="war-lsid"
1455
            description="Deploy LSID war to servlet container">
1456 4720 daigle
        <delete dir="${app.deploy.dir}/${authority.context}" />
1457
        <delete file="${app.deploy.dir}/${authority.context}.war" />
1458
        <mkdir dir="${app.deploy.dir}" />
1459
        <copy todir="${app.deploy.dir}">
1460 2737 jones
            <fileset dir="${dist.dir}" />
1461
        </copy>
1462
    </target>
1463 113 jones
</project>