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