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