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