Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *   '$RCSfile$'
4
  *     Authors: Matt Jones, Chad Berkley, Jivka Bojilova
5
  *   Copyright: 2000 Regents of the University of California and the
6
  *              National Center for Ecological Analysis and Synthesis
7
  * For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *    '$Author: sgarg $'
10
  *    '$Date: 2006-06-30 15:41:58 -0700 (Fri, 30 Jun 2006) $'
11
  *    '$Revision: 3018 $'
12
  *
13
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15
  *
16
  * usage: ant [compile|jar|install|jdoc]
17
  *
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
-->
32
<project name="metacat" default="jar" basedir=".">
33
  <property environment="env"/>
34
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35

    
36
  <!-- Determine which tomcat we are using and tomcat-specific settings -->
37
  <condition property="jsdk" value="${tomcat}/lib/common/servlet.jar">
38
    <equals arg1="${tomcatversion}" arg2="tomcat3" />
39
  </condition>
40
  <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
41
    <equals arg1="${tomcatversion}" arg2="tomcat4" />
42
  </condition>
43
  <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
44
    <equals arg1="${tomcatversion}" arg2="tomcat5" />
45
  </condition>
46
	
47
  <!-- Determine if installed ecogrid -->
48
  <condition property="enable.ecogrid">
49
    <equals arg1="${install.ecogrid}" arg2="true" />
50
  </condition>
51
	
52
  <target name="check-db">
53
    <condition property="use-oracle">
54
      <equals arg1="${database}" arg2="oracle" />
55
    </condition>
56
    <condition property="use-postgresql">
57
      <equals arg1="${database}" arg2="postgresql" />
58
    </condition>
59
    <condition property="use-sqlserver">
60
      <equals arg1="${database}" arg2="sqlserver" />
61
    </condition>
62
  </target>
63

    
64
  <target name="oracle" if="use-oracle">
65
     <!-- Customize these properties if you are using oracle -->
66
     <echo message="Using oracle..."/>
67
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
68
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
69
     <property name="jdbc-jar-name" value="classes111.zip" />
70
     <property name="jdbc" value="${jdbc_base}/${jdbc-jar-name}" />
71
     <!-- Property to indicate is not MSSQL installation-->
72
     <property name="other" value="yes"/>
73
     <property name="install-sql"
74
               value="xmltables.sql" />
75
     <property name="upgrade-1.2-sql"
76
               value="upgrade-db-to-1.2.sql" />
77
     <property name="upgrade-1.3-sql"
78
               value="upgrade-db-to-1.3.sql" />
79
     <property name="upgrade-1.4-sql"
80
               value="upgrade-db-to-1.4.sql" />
81
     <property name="upgrade-1.5-sql"
82
               value="upgrade-db-to-1.5.sql" />
83
     <property name="upgrade-1.6-sql"
84
               value="upgrade-db-to-1.6.sql" />
85
   </target>
86

    
87
   <target name="postgresql" if="use-postgresql">
88
     <!-- Customize these properties if you are using postgres -->
89
     <echo message="Using PostgreSQL..."/>
90
     <property name="dbDriver" value="org.postgresql.Driver"/>
91
     <property name="dbAdapter"
92
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
93
     <property name="jdbc-jar-name" value="postgresql-8.0-312.jdbc3.jar" />
94
     <property name="jdbc" value="lib/${jdbc-jar-name}" />
95
     <!-- Property to indicate is not MSSQL installation-->
96
     <property name="other" value="yes"/>
97
     <property name="install-sql"
98
               value="xmltables-postgres.sql" />
99
     <property name="upgrade-1.2-sql"
100
               value="upgrade-db-to-1.2-postgres.sql" />
101
     <property name="upgrade-1.3-sql"
102
               value="upgrade-db-to-1.3-postgres.sql" />
103
     <property name="upgrade-1.4-sql"
104
               value="upgrade-db-to-1.4-postgres.sql" />
105
     <property name="upgrade-1.5-sql"
106
               value="upgrade-db-to-1.5-postgres.sql" />
107
     <property name="upgrade-1.6-sql"
108
               value="upgrade-db-to-1.6-postgres.sql" />
109
    </target>
110

    
111
   <target name="sqlserver" if="use-sqlserver">
112
     <!-- Customize these properties if you are using SQL server -->
113
     <echo message="Using SQL Server..."/>
114
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
115
     <property name="dbAdapter"
116
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
117
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
118
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
119
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
120
     <!-- Property to indicate is a MSSQL installation-->
121
     <property name="MSSQL" value="yes"/>
122
     <property name="install-sql"
123
               value="xmltables-sqlserver.sql" />
124
   </target>
125

    
126
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
127
      <!-- usr for client testing, generally you don't need change-->
128
      <property name="mcuser" value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
129
      <property name="mcpassword" value="kepler"/>
130
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
131
      <property name="mcanotherpassword" value=""/>
132

    
133
      <property name="debug" value="on" />
134
      <property name="debuglevel" value="55" />
135

    
136
      <property name="morphosourcedir" value="../morpho" />
137
      <property name="defaultcontenttype" value="application/octet-stream" />
138
      <property name="utilitiesdir" value="../utilities" />
139

    
140
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
141
      <echo>*********** set jsdk to ${jsdk}</echo>
142
  </target>
143

    
144
   <target name="init" depends="config">
145
      <path id="compile.classpath">
146
        <pathelement location="${jsdk}"/>
147
        <pathelement location="lib" />
148
        <fileset dir="lib">
149
          <include name="*.jar"/>
150
        </fileset>
151
       <fileset dir="lib/lsid_lib">
152
         <include name="*.jar"/>
153
       </fileset>
154
       <fileset dir="${jdbc_base}">
155
         <include name="${jdbc-jar-name}"/>
156
          <include name="msbase.jar"/>
157
          <include name="msutil.jar"/>
158
          <include name="mssqlserver.jar"/>
159
        </fileset>
160
       </path>
161
      
162
      <!-- It is less likely you'll need to make any changes from here down,
163
           but customization is possible -->
164
      <property name="installdir"          value="${deploy.dir}/${metacat.context}" />
165
      <property name="temp-dir"            value="/tmp/${metacat.context}" />
166
      <property name="name"                value="metacat"/>
167
      <property name="Name"                value="MetaCat"/>
168
      <property name="debugprefix"         value="${Name}:"/>
169
      <property name="release"             value="1.6.0"/>
170
      <property name="replication-path"    value="/${metacat.context}/servlet/replication"/>
171
      <property name="harvester-registration-login-path" value="/${metacat.context}/harvesterRegistrationLogin"/>
172
      <property name="harvester-registration-path"       value="/${metacat.context}/harvesterRegistration"/>
173
      <property name="servlet-path"        value="/${metacat.context}/metacat"/>
174
      <property name="html-path"           value="/${metacat.context}"/>
175
      <property name="systemidserver"      value="${http.protocol}://${httpserver}"/>
176
      <property name="style-common-relpath"
177
                                           value="/style/common"/>
178
      <property name="style-common-cvsrelpath"
179
                                           value="lib${style-common-relpath}"/>
180
      <property name="style-common-fullpath"
181
                                           value="/${installdir}${style-common-relpath}"/>
182
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
183
      <property name="style-common-path"
184
                                           value="/${metacat.context}${style-common-relpath}"/>
185
      <property name="style-skins-relpath" value="/style/skins"/>
186
      <property name="style-skins-path"    value="/${metacat.context}${style-skins-relpath}"/>
187
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
188
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
189
      <property name="config-dir"          value="${deploy.dir}/${style-skins-path}" />
190
      <property name="util-module"         value="utilities" />
191
      <property name="eml-module"          value="eml" />
192
      <property name="eml-version"         value="2.0.0beta6" />
193
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
194
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
195
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1_UPDATE_3" />
196
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
197
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
198
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
199
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
200
      <property name="eml-css"             value="eml_xsl.css"/>
201
      <property name="eml-module.default.css"
202
                                           value="default.css"/>
203
   	  
204
      <!-- Config for registry variables -->
205
      <property name="scope"               value="obfs"/>
206
      <property name="responseForm"        value="genericResponse.tmpl"/>
207
      <property name="entryForm"           value="entryForm.tmpl"/>
208
      <property name="guide"               value="genericGuide.tmpl"/>
209
      <property name="loginForm"           value="loginForm.tmpl"/>
210
      <property name="confirmData"         value="confirmData.tmpl"/>
211
      <property name="deleteData"          value="deleteData.tmpl"/>
212
      <property name="genericHeader"       value="genericHeader.tmpl"/>
213
      <property name="genericFooter"       value="genericFooter.tmpl"/>
214
      <property name="adminname"           value="KNB Support"/>
215
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
216

    
217
      <property name="defaultStage"        value="initregister"/>
218
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
219
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
220
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
221
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
222
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
223
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
224
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
225
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
226
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
227
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
228
      <property name="register"            value="ldapRegister.tmpl"/>
229
      <property name="searchResults"       value="searchResults.tmpl"/>
230

    
231
      <filter token="scope"                value="${scope}"/>
232
      <filter token="responseForm"         value="${responseForm}"/>
233
      <filter token="entryForm"            value="${entryForm}"/>
234
      <filter token="guide"                value="${guide}"/>
235
      <filter token="loginForm"            value="${loginForm}"/>
236
      <filter token="confirmData"          value="${confirmData}"/>
237
      <filter token="deleteData"           value="${deleteData}"/>
238
      <filter token="genericHeader"        value="${genericHeader}"/>
239
      <filter token="genericFooter"        value="${genericFooter}"/>
240
      <filter token="adminname"            value="${adminname}"/>
241
      <filter token="recipient"            value="${recipient}"/>
242

    
243
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
244
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
245
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
246
      <filter token="ldap_password"        value="ldap_password"/>
247
      <filter token="mailhost"             value="localhost"/>
248
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
249
      <filter token="cgiurl"               value="${cgi-prefix}/ldapweb.cgi"/>
250

    
251
      <filter token="docrooturl" value="./" />
252
      <filter token="database" value="${database}" />
253
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
254
      <filter token="dbDriver" value="${dbDriver}"/>
255
      <filter token="dbAdapter" value="${dbAdapter}"/>
256
      <filter token="install-dir" value="${installdir}"/>
257
      <filter token="temp-dir" value="${temp-dir}"/>
258
      <filter token="server" value="${server}"/>
259
      <filter token="systemidserver" value="${systemidserver}"/>
260
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
261
      <filter token="ldapUrl" value="${ldapUrl}"/>
262
      <filter token="replication-log" value="${replication-log}"/>
263
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
264
      <filter token="release" value="${release}"/>
265
      <filter token="servlet-path" value="${servlet-path}"/>
266
      <filter token="html-path" value="${html-path}"/>
267
      <filter token="user" value="${user}"/>
268
      <filter token="password" value="${password}"/>
269
      <filter token="mcuser" value="${mcuser}"/>
270
      <filter token="mcpassword" value="${mcpassword}"/>
271
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
272
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
273
      <filter token="knb-site-url" value="${knb-site-url}"/>
274
      <filter token="eml-css" value="${eml-css}"/>
275
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
276
      <filter token="style-skins-path" value="${style-skins-path}"/>
277
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
278
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
279
      <filter token="style-common-path" value="${style-common-path}"/>
280
      <filter token="templates.dir" value="${templates.dir}"/>
281

    
282
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
283
      <filter token="style-path" value="${style-skins-path}"/>
284
      <filter token="replication-path" value="${replication-path}"/>
285
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
286
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
287
      <filter token="config-dir" value="${config-dir}"/>
288
      <filter token="default-style" value="${default-style}"/>
289
      <filter token="eml-version" value="${eml-version}"/>
290
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
291
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
292
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
293
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
294
      <filter token="context" value="${metacat.context}"/>
295
   	  <filter token="httpserver" value="${httpserver}"/>
296
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
297
      <filter token="debuglevel" value="${debuglevel}" />
298
      <filter token="datafilepath" value="${datafilepath}" />
299
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
300
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
301
      <filter token="debugprefix" value="${debugprefix}"/>
302
      <filter token="administrators" value="${administrators}"/>
303
      <filter token="moderators" value="${moderators}"/>
304
      <filter token="allowedSubmitters" value="${allowedSubmitters}"/>
305
      <filter token="deniedSubmitters" value="${deniedSubmitters}"/>
306
      <filter token="indexPaths" value="${indexPaths}"/>
307

    
308
      <filter token="defaultStage" value="${defaultStage}"/>
309
      <filter token="defaultHeader" value="${defaultHeader}"/>
310
      <filter token="defaultFooter" value="${defaultFooter}"/>
311
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
312
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
313
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
314
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
315
      <filter token="registerFailed" value="${registerFailed}"/>
316
      <filter token="registerLter" value="${registerLter}"/>
317
      <filter token="registerMatch" value="${registerMatch}"/>
318
      <filter token="registerSuccess" value="${registerSuccess}"/>
319
      <filter token="register" value="${register}"/>
320
      <filter token="searchResults" value="${searchResults}"/>
321
       
322
   	  <filter token="timedreplication" value="${timedreplication}" />
323
   	  <filter token="firsttimedreplication" value="${firsttimedreplication}" />
324
   	  <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
325
      
326
   	  <property name="srcdir" value="./src" />
327
   	  <property name="lib.dir" value="./lib" />
328
      <property name="testdir" value="./test" />
329
      <property name="testtorun" value="BuildIndexTest" />
330
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
331
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
332
      <property name="build.dir" value="./build"/>
333
      <property name="build.src" value="${build.dir}/src"/>
334
      <property name="build.dest" value="${build.dir}/classes"/>
335
      <property name="build.docs" value="${build.dir}/docs"/>
336
      <property name="build.samples" value="${build.dir}/samples"/>
337
      <property name="build.tests" value="${build.dir}/tests"/>
338
      <property name="build.tmp" value="${build.dir}/tmp"/>
339
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
340
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
341
      <property name="build.data" value="${build.dir}/data"/>
342
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
343
      <property name="build.war" value="${build.dir}/war"/>
344

    
345
      <property name="dist.dir" value="dist"/>
346
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
347
      <property name="ver.src" value="${ver.dir}/src"/>
348
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
349
	  <!-- directories for creating a Harvest List Editor distribution -->
350
      <property name="dist.dir.hle" value="disthle"/>
351
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
352
   	  
353
   	  
354
   	  <property name="ecogrid-target-name" value="metacatImpl"/>
355
   	  <property name="ecogrid-module-dest-dir" value =".."/>
356
   	  <property name="ecogrid-module" value="seek/projects/ecogrid"/>
357
   	  <property name="ecogrid-dist-dir" value="${dist.dir}/${ecogrid-module}"/>
358
   	  <property name="ecogrid-dir" value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
359

    
360
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
361
      <condition property="utilities.required">
362
        <or>
363
          <not><available file="lib/httpclient.jar"/></not>
364
          <not><available file="lib/utilities.jar"/></not>
365
        </or>
366
      </condition>
367
      <condition property="eml.required">
368
        <or>
369
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
370
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
371
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
372
        </or>
373
      </condition>
374
   	  
375
      <condition property="ecogrid.required">
376
      	   <or>
377
             <not><available file="${ecogrid-dir}/build.properties"/></not>
378
             <not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
379
           </or>
380
      </condition>
381

    
382
   </target>
383

    
384
   <target name="prepare" depends="init">
385
      <mkdir dir="${build.dir}"/>
386
      <mkdir dir="${build.src}"/>
387
      <mkdir dir="${build.dest}"/>
388
      <mkdir dir="${build.javadocs}"/>
389
      <mkdir dir="${build.tmp}"/>
390

    
391
      <copy todir="${build.src}" filtering="yes">
392
        <fileset dir="${srcdir}">
393
          <include name="edu/**"/>
394
          <include name="com/**"/>
395
          <include name="**/*.sql"/>
396
          <exclude name="**/CVS*"/>
397
          <exclude name="**/.#*"/>
398
        </fileset>
399
      </copy>
400
      <available file="lib/style/common/emlb6toeml2" type="dir"
401
                 property="styles.not.needed"/>
402
   </target>
403

    
404
   <target name="compile" depends="prepare,utilities"
405
    description="Compiles java code to build dir, and copies metacat props files there">
406

    
407
       <javac srcdir="${build.src}"
408
              destdir="${build.dest}"
409
              debug="${debug}"
410
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
411
        <classpath>
412
          <path refid="compile.classpath"/>
413
        </classpath>
414
      </javac>
415
   </target>
416

    
417
   <target name="jar" depends="compile,geteml"
418
    description="Compiles and jars metacat java code to metacat.jar in build dir">
419

    
420
       <delete file="${build.dir}/${name}.jar" />
421
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
422
            excludes="**/protocols/ **/harvesterClient/" />
423
   </target>
424

    
425
   <target name="protocol" depends="compile"
426
    description="Compiles and jars protocol java code to protocol.jar in build dir">
427
       <delete file="${build.dir}/protocol.jar" />
428
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
429
            includes="**/protocols/" />
430
   </target>
431

    
432
   <target name="utilities" depends="config" if="utilities.required">
433
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
434
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
435
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
436
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
437
   </target>
438

    
439
   <target name="getutilities" depends="prepare"
440
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
441
     <echo>Enter CVS password: </echo>
442
     <cvs cvsRoot="${cvsroot}"
443
          package="${util-module}"
444
          dest="${build.tmp}" />
445
   </target>
446

    
447
   <target name="client" depends="utilities, prepare"
448
    description="Compiles metacat-client java code to build dir">
449
       <javac srcdir="${build.src}"
450
              destdir="${build.dest}"
451
              includes="edu/ucsb/nceas/metacat/client/*">
452
          <classpath>
453
            <path refid="compile.classpath"/>
454
          </classpath>
455
        </javac>
456
   </target>
457

    
458
   <target name="clientjar" depends="client"
459
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
460
       <delete file="${build.dir}/${name}-client.jar" />
461
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
462
            includes="**/metacat/client/" />
463
   </target>
464

    
465
    <target name="advancedsearchjar" depends="compile"
466
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
467
        <delete file="${build.dir}/advancedsearch.jar" />
468
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
469
             includes="**/metacat/advancedsearch/" />
470
    </target>
471

    
472
   <target name="harvester" depends="client"
473
           description="Compiles harvester java code to build dir">
474
       <javac srcdir="${build.src}"
475
              destdir="${build.dest}"
476
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
477
          <classpath>
478
            <path refid="compile.classpath"/>
479
          </classpath>
480
        </javac>
481
   </target>
482

    
483
   <target name="harvesterjar" depends="harvester"
484
           description="Compiles and jars harvester java code to harvester.jar in build dir">
485
       <delete file="${build.dir}/harvester.jar" />
486
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
487
            includes="**/metacat/harvesterClient/" />
488
   </target>
489

    
490
   <target name="harvestListEditorDist" depends="harvesterjar"
491
           description="Prepares a distribution of the Harvest List Editor tool">
492
       <mkdir dir="${dist.dir.hle}"/>
493
       <delete dir="${ver.dir.hle}" />
494
       <mkdir dir="${ver.dir.hle}"/>
495
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
496
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
497
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
498
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
499
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
500
       <delete file="./harvest-list-editor-${release}.zip"/>
501
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
502
       <delete file="./harvest-list-editor-${release}.tar.gz" />
503
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
504
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
505
             src="./harvest-list-editor-${release}.tar"/>
506
       <delete file="./harvest-list-editor-${release}.tar" />
507
   </target>
508

    
509
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
510
            description="Calls getemlpre2 and geteml2+ targets" />
511

    
512
   <target name="getemlpre2" depends="prepare" if="eml.required"
513
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
514
     <echo>Enter CVS password: </echo>
515
     <cvs cvsRoot="${cvsroot}"
516
          package="${eml-module}"
517
          tag="${eml-tag}"
518
          dest="${build.tmp}/eml_${eml-tag}" />
519
     <mkdir dir="lib/dtd" />
520
     <copy todir="lib/dtd" filtering="yes">
521
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
522
         <include name="*.dtd"/>
523
       </fileset>
524
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
525
     </copy>
526

    
527
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
528
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
529
       <include name="**/*.xsl"/>
530
     </fileset>
531
     </copy>
532
   </target>
533

    
534
   <target name="geteml2+" depends="prepare" if="eml.required"
535
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
536
     <echo>Enter CVS password: </echo>
537
     <cvs cvsRoot="${cvsroot}"
538
          package="${eml-module}"
539
          tag="${eml2_0_0-tag}"
540
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
541
     <mkdir dir="lib/schema/eml-2.0.0" />
542
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
543
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
544
         <include name="*.xsd"/>
545
       </fileset>
546

    
547
       <!-- shouldn't we have a mapper here like this??
548
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
549

    
550
       Jing's code didn't nave one - does it need to be added?
551
       NOTE that eml-version is set to beta 6, so this would need changing -->
552

    
553
     </copy>
554
     <!-- <antcall target="copyxsl">
555
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
556
        <param name="dirname" value="eml-2.0.0" />
557
     </antcall> -->
558

    
559
     <echo>Enter CVS password: </echo>
560
     <cvs cvsRoot="${cvsroot}"
561
          package="${eml-module}"
562
          tag="${eml2_0_1-tag}"
563
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
564
     <mkdir dir="lib/schema/eml-2.0.1" />
565
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
566
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
567
         <include name="*.xsd"/>
568
       </fileset>
569
     </copy>
570
     <antcall target="copyxsl">
571
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
572
        <param name="dirname" value="eml-2.0.1" />
573
     </antcall>
574
   </target>
575

    
576
   <target  name="copyxsl"
577
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
578

    
579
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
580

    
581
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
582
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
583
       <include name="**/*.xsl"/>
584
     </fileset>
585
     </copy>
586

    
587

    
588
     <!-- now copy default css from eml module and put it in style-common-path
589
          dir with a new name, so other skin-specific css can import it if reqd -->
590
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
591
           tofile="${style-common-cvsrelpath}/${eml-css}" />
592

    
593
   </target>
594

    
595

    
596

    
597
   <target name="register-schemas" depends="prepare"
598
   description="Registers the Schemas with a new Metacat instance">
599
     <echo/>
600
     <echo>Registering the Schemas with the new Metacat instance...</echo>
601
     <sql driver="${dbDriver}"
602
          url="${jdbc-connect}"
603
          userid="${user}"
604
          password="${password}"
605
          src="${build.src}/loaddtdschema.sql">
606
       <classpath>
607
         <path refid="compile.classpath"/>
608
       </classpath>
609
     </sql>
610
   </target>
611

    
612
   <target name="installdb" depends="prepare"
613
            description="Installs the database tables">
614
     <echo/>
615
     <echo>Installing the database tables...</echo>
616
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
617
     <echo/>
618
     <sql driver="${dbDriver}"
619
          url="${jdbc-connect}"
620
          userid="${user}"
621
          password="${password}"
622
          src="${build.src}/${install-sql}">
623
       <classpath>
624
         <path refid="compile.classpath"/>
625
       </classpath>
626
     </sql>
627
   </target>
628

    
629
   <target name="dropdb" depends="prepare"
630
            description="WARNING: Drops the database tables">
631
     <echo/>
632
     <echo>Dropping the database tables...</echo>
633
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
634
     <echo/>
635
     <sql driver="${dbDriver}"
636
          url="${jdbc-connect}"
637
          userid="${user}"
638
          password="${password}"
639
          src="${build.src}/drop-postgres.sql">
640
       <classpath>
641
         <path refid="compile.classpath"/>
642
       </classpath>
643
     </sql>
644
   </target>
645

    
646
   <target name="upgrade12" depends="prepare"
647
            description="Updates the database tables to upgrade to version 1.2">
648
     <echo/>
649
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
650
     <sql driver="${dbDriver}"
651
          url="${jdbc-connect}"
652
          userid="${user}"
653
          password="${password}"
654
          src="${build.src}/${upgrade-1.2-sql}">
655
       <classpath>
656
         <path refid="compile.classpath"/>
657
       </classpath>
658
     </sql>
659
   </target>
660

    
661
   <target name="upgrade13" depends="prepare"
662
            description="Updates the database tables to upgrade to version 1.3">
663
     <echo/>
664
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
665
     <sql driver="${dbDriver}"
666
          url="${jdbc-connect}"
667
          userid="${user}"
668
          password="${password}"
669
          src="${build.src}/${upgrade-1.3-sql}">
670
       <classpath>
671
         <path refid="compile.classpath"/>
672
       </classpath>
673
     </sql>
674
   </target>
675

    
676
   <target name="upgrade14" depends="prepare"
677
            description="Updates the database tables to upgrade to version 1.4">
678
     <echo/>
679
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
680
     <sql driver="${dbDriver}"
681
          url="${jdbc-connect}"
682
          userid="${user}"
683
          password="${password}"
684
          src="${build.src}/${upgrade-1.4-sql}">
685
       <classpath>
686
         <path refid="compile.classpath"/>
687
       </classpath>
688
     </sql>
689
   </target>
690

    
691
   <target name="upgrade15" depends="sqlupgrade15"
692
           description="Updates the database tables to upgrade to version 1.5">
693
     <echo/>
694
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
695
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
696
           todir="${build.tmp}" filtering="yes"/>
697

    
698
     <javac srcdir="${build.tmp}"
699
            destdir="${build.tmp}"
700
            debug="${debug}"
701
            includes="upgrade_db_to_1_5.java">
702
       <classpath>
703
         <path refid="compile.classpath"/>
704
       </classpath>
705
     </javac>
706

    
707
     <java classname="upgrade_db_to_1_5">
708
       <classpath>
709
         <path refid="compile.classpath"/>
710
         <fileset dir="${build.tmp}"/>
711
       </classpath>
712
     </java>
713

    
714
   </target>
715

    
716
   <target name="upgrade16" depends="prepare"
717
            description="Updates the database tables from version 1.5 to version 1.6">
718
     <echo/>
719
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
720
     <sql driver="${dbDriver}"
721
          url="${jdbc-connect}"
722
          userid="${user}"
723
          password="${password}"
724
          src="${build.src}/${upgrade-1.6-sql}">
725
       <classpath>
726
         <path refid="compile.classpath"/>
727
       </classpath>
728
     </sql>
729
   </target>
730

    
731

    
732
   <target name="sqlupgrade15" depends="prepare">
733
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
734
      <sql driver="${dbDriver}"
735
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
736
          url="${jdbc-connect}"
737
          userid="${user}"
738
          password="${password}"
739
          src="${build.src}/${upgrade-1.5-sql}" />
740
      <sql driver="${dbDriver}"
741
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
742
          url="${jdbc-connect}"
743
          userid="${user}"
744
          password="${password}"
745
          rdbms="oracle"
746
          delimiter="/">
747
        <transaction>
748
           CREATE TRIGGER xml_returnfield_before_insert
749
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
750
           BEGIN
751
              SELECT xml_returnfield_id_seq.nextval
752
                 INTO :new.returnfield_id
753
                 FROM dual;
754
           END;
755
           /
756
        </transaction>
757
        <transaction>
758
           CREATE TRIGGER xml_queryresult_before_insert
759
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
760
           BEGIN
761
              SELECT xml_queryresult_id_seq.nextval
762
              INTO :new.queryresult_id
763
              FROM dual;
764
           END;
765
           /
766
        </transaction>
767
      </sql>
768
   </target>
769

    
770
   <target name="install" depends="install-ecogrid" description="* Full Install *">
771
       <mkdir dir="${datafilepath}" />
772
       <mkdir dir="${inlinedatafilepath}" />
773
       <chmod dir="${datafilepath}" perm="ug+w" />
774
       <mkdir dir="${temp-dir}"/>
775
       <chmod dir="${temp-dir}" perm="ug+w" />
776
       <copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
777
   	   <echo>If you enable ecogrid installation, please run "ant deploy-ecogrid" when installation or upgrade is done</echo> 
778
   </target>
779
	
780
   <target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
781
			    description="Install Ecogrid Compentent">
782
   	  <copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
783
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
784
   	         <property name="context" value="${metacat.context}"/>
785
   	   	     <property name="target" value="${ecogrid-target-name}"/>
786
   	   	     <property name="metacat.dir" value="${metacat.dir}"/>
787
   	  </ant>
788
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
789
   	     <property name="context" value="${metacat.context}"/>
790
   	     <property name="target" value="${ecogrid-target-name}"/>
791
   	     <property name="metacat.dir" value="${metacat.dir}"/>
792
   	  </ant>
793
   	  <war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
794
  	      <webinf dir="${ecogrid-dir}/lib">
795
   	        <include name="server-config.wsdd"/>
796
   	      </webinf>
797
   	  </war>
798
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
799
   	  
800
   
801
   </target>
802
   
803
   <target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
804
	<echo>Enter CVS password: </echo>
805
	     <cvs cvsRoot="${cvsroot}"
806
	          package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
807
   </target>
808
	
809
   	
810
   <target name="upgrade" depends="install"
811
          description="* Upgrade an existing metacat installation with a new version *">
812
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
813
   </target>
814
	
815
   <target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
816
   	 <ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
817
   	   	 <property name="context" value="${metacat.context}"/>
818
   	   	 <property name="target" value="${ecogrid-target-name}"/>
819
   	     <property name="metacat.dir" value="${metacat.dir}"/>
820
   	     <property name="hostname" value="${config.hostname}"/>
821
   	     <property name="port" value="${config.port}"/>
822
   	 </ant>
823
   </target>
824
	
825
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
826
      <delete file="${deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
827
   </target>
828

    
829
   <target name="install-registry" depends="init,getConversionXSL"
830
            description="Install Registry">
831

    
832
      <copy file="${srcdir}/perl/register-dataset.cgi"
833
            todir="${inst.cgi.dir}" filtering="yes"/>
834
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
835

    
836
      <mkdir dir="${temp-dir}" />
837
      <copy todir="${temp-dir}" filtering="yes">
838
       <fileset dir="lib/style/common/emlb6toeml2">
839
         <include name="*.xsl"/>
840
         <include name="*.xml"/>
841
       </fileset>
842
      </copy>
843

    
844
      <echo message="Install Registry completed." />
845
   </target>
846

    
847
   <target name="install-ldap" depends="init">
848
      <copy file="${srcdir}/perl/ldapweb.cgi"
849
            todir="${inst.cgi.dir}" filtering="yes"/>
850
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
851
      <copy file="lib/ldapweb.cfg"
852
            todir="${inst.cgi.dir}" filtering="yes"/>
853
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
854
      <mkdir dir="${templates.dir}" />
855
      <copy todir="${templates.dir}" filtering="yes">
856
        <fileset dir="lib/style/common/templates">
857
            <include name="${defaultChangePass}"/>
858
            <include name="${defaultResetPass}"/>
859
            <include name="${changePassSuccess}"/>
860
            <include name="${resetPassSuccess}"/>
861
            <include name="${registerFailed}"/>
862
            <include name="${registerLter}"/>
863
            <include name="${registerMatch}"/>
864
            <include name="${registerSuccess}"/>
865
            <include name="${register}"/>
866
            <include name="${searchResults}"/>
867
            <include name="${defaultHeader}"/>
868
            <include name="${defaultFooter}"/>
869
            <include name="${responseForm}"/>
870
        </fileset>
871
      </copy>
872
      <echo message="ldapweb install complete." />
873
   </target>
874

    
875

    
876
   <target name="install-skin" depends="init"
877
            description="Install a Skin">
878

    
879
      <input message="Please enter name of the skin"
880
             addproperty="skin-name"/>
881

    
882
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
883
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
884
       <fileset dir="lib/style/skins/${skin-name}">
885
           <exclude name="**/*.png"/>
886
           <exclude name="**/*.gif"/>
887
           <exclude name="**/*.jpg"/>
888
           <exclude name="**/CVS*"/>
889
           <exclude name="**/.#*"/>
890
       </fileset>
891
      </copy>
892
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
893
       <fileset dir="lib/style/skins/${skin-name}">
894
           <include name="**/*.png"/>
895
           <include name="**/*.gif"/>
896
           <include name="**/*.jpg"/>
897
           <exclude name="**/CVS*"/>
898
           <exclude name="**/.#*"/>
899
       </fileset>
900
      </copy>
901
      <copy todir="${installdir}/style/common" filtering="yes">
902
       <fileset dir="lib/style/common">
903
           <include name="*.js"/>
904
           <include name="*.jsp"/>
905
           <include name="*.css"/>
906
           <exclude name="*.png"/>
907
           <exclude name="*.gif"/>
908
           <exclude name="*.jpg"/>
909
           <exclude name="**/CVS*"/>
910
           <exclude name="**/.#*"/>
911
       </fileset>
912
      </copy>
913
      <!--
914
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
915
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
916
       <fileset dir="lib/style/skins/${skin-name}/images">
917
           <include name="*.png"/>
918
           <include name="*.gif"/>
919
           <include name="*.jpg"/>
920
       </fileset>
921
      </copy>
922
      -->
923

    
924
      <echo message="Install Skin completed." />
925
   </target>
926

    
927
   <target name="war" depends="warPrepare,warMSSQL"
928
            description="Create a web archive (WAR) for servlet deployment">
929
       <mkdir dir="${dist.dir}" />
930
       <war destfile="${dist.dir}/${metacat.context}.war"
931
            webxml="${build.war}/web.xml">
932
         <fileset dir="${war.context}"/>
933
         <lib dir="${war.lib}"/>
934
         <webinf dir="${war.webinf}"/>
935
       </war>
936
   </target>
937
	
938
	
939

    
940
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
941
            description="Prepare files for creating a web archive (WAR)">
942

    
943
       <property name="war.lib" value="${build.war}/lib" />
944
       <property name="war.webinf" value="${build.war}/WEB-INF" />
945
       <property name="war.context" value="${build.war}/${metacat.context}" />
946
       <mkdir dir="${war.lib}" />
947
       <mkdir dir="${war.webinf}" />
948
       <mkdir dir="${war.context}" />
949
       
950
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
951
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
952
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
953
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
954
       <copy todir="${war.lib}" filtering="no">
955
         <fileset dir="lib">
956
            <not>
957
               <filename name="${jdbc-jar-name}"/>
958
            </not>
959
            <include name="*.jar"/>
960
         </fileset>
961
         <fileset dir="lib/xalan">
962
           <include name="*.jar"/>
963
         </fileset>
964
       </copy>
965
       <copy file="lib/web.xml.${tomcatversion}"
966
             tofile="${build.war}/web.xml" />
967
       <copy file="lib/metacat.properties" todir="${war.webinf}"
968
             filtering="yes" />
969
       <copy todir="${war.webinf}" filtering="yes">
970
	   	  <fileset dir="lib">
971
           <include name="skin.configs/**"/>
972
		  </fileset>
973
	   </copy>
974
       <copy file="lib/log4j.properties" todir="${war.webinf}"
975
             filtering="yes" />
976
       <copy todir="${war.context}" filtering="no">
977
         <fileset dir="lib">
978
           <include name="**/*.jpg"/>
979
           <include name="**/*.png"/>
980
           <include name="**/*.gif"/>
981
           <include name="LiveMap_30/**"/>
982
         </fileset>
983
       </copy>
984
       <copy todir="${war.context}" filtering="yes">
985
         <fileset dir="lib">
986
           <exclude name="*.jar"/>
987
           <exclude name="*.properties"/>
988
           <exclude name="web.xml"/>
989
           <exclude name="**/*.jpg"/>
990
           <exclude name="**/*.png"/>
991
           <exclude name="**/*.gif"/>
992
           <exclude name="lsid_lib/**"/>
993
           <exclude name="lsid_conf/**"/>
994
           <exclude name="LiveMap_30/**"/>
995
           <exclude name="skin.configs/**"/>
996
         </fileset>
997
       </copy>
998
   </target>
999

    
1000
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1001
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1002
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1003
   </target>
1004

    
1005
   <target name="getConversionXSL" depends="prepare"
1006
            unless="styles.not.needed"
1007
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1008

    
1009
     <echo>Enter CVS password: </echo>
1010
     <cvs cvsRoot="${cvsroot}"
1011
          package="${eml-module}"
1012
          tag="${eml2_0_1-tag}"
1013
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
1014

    
1015
     <mkdir dir="lib/style/common/emlb6toeml2" />
1016
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1017
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
1018
         <include name="*.xsl"/>
1019
         <include name="*.xml"/>
1020
       </fileset>
1021
      </copy>
1022
   </target>
1023

    
1024
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1025
      <mkdir dir="${build.tests}"/>
1026
      <copy todir="${build.tests}" filtering="yes">
1027
        <fileset dir="${testdir}">
1028
          <include name="edu/**"/>
1029
        </fileset>
1030
      </copy>
1031
      <!-- copy and compile the tests into a jar file -->
1032
      <javac srcdir="${build.tests}"
1033
             destdir="${build.tests}"
1034
             debug="on"
1035
             includes="**/*.java">
1036
        <classpath>
1037
          <path refid="compile.classpath"/>
1038
          <fileset dir="${build.dir}">
1039
            <include name="${name}.jar"/>
1040
            <include name="${name}-client.jar"/>
1041
            <include name="harvester.jar"/>
1042
          </fileset>
1043
        </classpath>
1044
      </javac>
1045

    
1046
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1047
        basedir="${build.tests}"
1048
                includes="**/*.class" />
1049
   </target>
1050

    
1051
   <target name="test" depends="testprep"
1052
            description="Uses the ant junit task to run all JUnit tests">
1053

    
1054
      <!-- use the ant "junit" task to run JUnit tests. -->
1055
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1056
             haltonerror="no">
1057
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
1058
        <classpath>
1059
          <path refid="compile.classpath"/>
1060
          <fileset dir="${build.dir}">
1061
            <include name="${name}.jar"/>
1062
            <include name="${name}-client.jar"/>
1063
            <include name="harvester.jar"/>
1064
            <include name="${name}-junittests.jar"/>
1065
          </fileset>
1066
        </classpath>
1067

    
1068
        <formatter type="plain" />
1069

    
1070
        <batchtest fork="yes" todir="${build.dir}">
1071
          <fileset dir="${build.tests}">
1072
            <include name="**/*.class" />
1073
          </fileset>
1074
        </batchtest>
1075
     </junit>
1076
   </target>
1077

    
1078
    <target name="runonetest" depends="testprep"
1079
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1080

    
1081
              <echo>testtorun: ${testtorun}</echo>
1082

    
1083
      <!-- use the ant "junit" task to run JUnit tests. -->
1084
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1085
             haltonerror="no">
1086
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1087
        <classpath>
1088
          <path refid="compile.classpath"/>
1089
          <fileset dir="${build.dir}">
1090
            <include name="${name}.jar"/>
1091
            <include name="${name}-client.jar"/>
1092
            <include name="harvester.jar"/>
1093
            <include name="${name}-junittests.jar"/>
1094
          </fileset>
1095
        </classpath>
1096

    
1097
        <formatter type="plain" />
1098

    
1099
        <batchtest fork="yes" todir="${build.dir}">
1100
          <fileset dir="${build.tests}">
1101
            <include name="**/${testtorun}.class" />
1102
          </fileset>
1103
        </batchtest>
1104
     </junit>
1105
   </target>
1106

    
1107
   <target name="testharvester"
1108
           depends="testprep"
1109
           description="Uses the ant junit task to test only the Harvester code">
1110
     <junit printsummary="yes"
1111
            haltonfailure="off"
1112
            fork="yes"
1113
            haltonerror="off">
1114
        <classpath>
1115
          <path refid="compile.classpath"/>
1116
          <fileset dir="${build.dir}">
1117
            <include name="${name}.jar"/>
1118
            <include name="${name}-client.jar"/>
1119
            <include name="harvester.jar"/>
1120
            <include name="${name}-junittests.jar"/>
1121
          </fileset>
1122
        </classpath>
1123
       <formatter type="plain" />
1124
       <batchtest fork="yes" todir="${build.dir}">
1125
         <fileset dir="${build.tests}">
1126
           <include name="**/harvesterClient/*.class" />
1127
         </fileset>
1128
       </batchtest>
1129
     </junit>
1130
   </target>
1131

    
1132
  <target name="gethttpclient" depends="prepare"
1133
            description="checks out and compiles morpho httpclient code">
1134
  <!--mkdir dir="${morphosourcedir}" -->
1135
        <cvs cvsRoot="${cvsroot}"
1136
             package="morpho"
1137
             dest="." />
1138
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1139
   </target>
1140

    
1141
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1142
   <target name="nettest" depends="install"
1143
            description="compiles and runs the metacatnettest code">
1144

    
1145
      <echo>***********************************
1146
      Please run ant gethttpclient first!
1147
      ***********************************
1148
      </echo>
1149
      <!-- copy and compile the tests into a jar file -->
1150
      <mkdir dir="${build.metacatnettest}"/>
1151
      <javac srcdir="${junitnettestsdir}"
1152
             destdir="${build.metacatnettest}"
1153
             includes="**/*.java">
1154
        <classpath>
1155
          <path refid="compile.classpath"/>
1156
          <fileset dir="${build.dir}">
1157
            <include name="${name}.jar"/>
1158
          </fileset>
1159
        </classpath>
1160
      </javac>
1161

    
1162
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1163
                    basedir="${build.metacatnettest}"
1164
                    includes="**/*.class" />
1165

    
1166
      <!-- use the ant "junit" task to run JUnit tests. -->
1167
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1168
             haltonerror="no">
1169
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1170
        <classpath>
1171
          <path refid="compile.classpath"/>
1172
          <fileset dir="${build.dir}">
1173
            <include name="${name}.jar"/>
1174
            <include name="${name}-junitnettests.jar"/>
1175
          </fileset>
1176
        </classpath>
1177

    
1178
        <formatter type="plain" />
1179

    
1180
        <batchtest fork="yes" todir="${build.dir}">
1181
          <fileset dir="${build.metacatnettest}">
1182
            <include name="**/*.class" />
1183
          </fileset>
1184
        </batchtest>
1185
     </junit>
1186
   </target>
1187

    
1188
   <target name="cleanweb" depends="clean"
1189
            description="deletes tomcat web context dir and all its contents">
1190
     <delete dir="${installdir}" />
1191
   </target>
1192

    
1193

    
1194
   <target name="clean" depends="init"
1195
            description="deletes build dir and files that can be regenerated form the release">
1196
       <delete dir="${build.dir}" />
1197
       <delete dir="${dist.dir}" />
1198
   </target>
1199

    
1200
   <target name="fullclean" depends="clean"
1201
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1202
       <delete file="lib/httpclient.jar" />
1203
       <delete file="lib/utilities.jar" />
1204
       <delete includeEmptyDirs="true" failonerror="false">
1205
         <fileset dir="${style-common-cvsrelpath}">
1206
           <include name="${eml-css}" />
1207
           <include name="eml-*/*.xsl" />
1208
           <include name="eml-*" />
1209
         </fileset>
1210
       </delete>
1211
   </target>
1212

    
1213
   <target name="jdoc" depends="prepare"
1214
            description="generates javadoc documentation">
1215
       <javadoc packagenames="edu.ucsb.nceas.*"
1216
           sourcepath="${build.src}"
1217
           destdir="${build.javadocs}"
1218
           author="true"
1219
           version="true"
1220
           use="true"
1221
           windowtitle="${Name} API"
1222
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1223
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1224
         <classpath>
1225
           <path refid="compile.classpath"/>
1226
         </classpath>
1227
       </javadoc>
1228
   </target>
1229

    
1230
   <target name="dist"
1231
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1232
            description="prepares a full release distribution">
1233
      <mkdir dir="${dist.dir}"/>
1234
      <delete dir="${ver.dir}" />
1235
      <mkdir dir="${ver.dir}"/>
1236
      <copy todir="${ver.dir}">
1237
        <fileset dir="."
1238
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1239
      </copy>
1240
      <copy todir="${ver.dir}" file="build.xml"/>
1241
      <copy todir="${ver.dir}" file="build.properties"/>
1242

    
1243
      <copy todir="${ver.dir}/docs" filtering="yes">
1244
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1245
      </copy>
1246
      <copy todir="${ver.dir}/docs" filtering="no">
1247
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1248
      </copy>
1249
      <copy todir="${ver.dir}/docs/dev">
1250
        <fileset dir="${build.dir}/docs"/>
1251
      </copy>
1252
      <copy todir="${ver.dir}/src">
1253
        <fileset dir="${build.dir}/src"/>
1254
      </copy>
1255
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1256
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1257
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1258
      <!--
1259
      <delete dir="./${ver.dir}/${build.dir}"/>
1260
      <delete dir="./${ver.dir}/dist"/>
1261
      -->
1262
      <delete file="./${name}-${release}.zip"/>
1263
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1264
      <delete file="./${name}-${release}.tar.gz" />
1265
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1266
      <gzip zipfile="./${name}-${release}.tar.gz"
1267
                src="./${name}-${release}.tar"/>
1268
      <delete file="./${name}-${release}.tar" />
1269
  </target>
1270

    
1271
  <target name="distsrc" depends="dist"
1272
            description="prepares a source distribution">
1273
      <mkdir dir="${ver.src}"/>
1274
      <copy todir="${ver.src}">
1275
        <fileset dir="./src"/>
1276
      </copy>
1277
      <mkdir dir="${util.dir}"/>
1278
      <copy todir="${util.dir}">
1279
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1280
      </copy>
1281
  	  
1282
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1283
  	  <copy todir="${ecogrid-dist-dir}">
1284
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1285
  	  </copy>
1286

    
1287
      <delete file="./${name}-src-${release}.zip"/>
1288
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1289
      <delete file="./${name}-src-${release}.tar.gz" />
1290
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1291
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1292
                src="./${name}-src-${release}.tar"/>
1293
      <delete file="./${name}-src-${release}.tar" />
1294
      <delete dir="${dist.dir}"/>
1295
  </target>
1296

    
1297
   <target name="stylesheettest">
1298
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1299
      <param name="displaymodule" expression="${displaymodule}"/>
1300
      <param name="docid" expression="${input}"/>
1301
      <param name="entitytype" expression="${entitytype}"/>
1302
      <param name="entityindex" expression="${entityindex}"/>
1303
      <outputproperty name="method" value="html"/>
1304
      <outputproperty name="standalone" value="yes"/>
1305
      <outputproperty name="encoding" value="iso8859_1"/>
1306
      <outputproperty name="indent" value="yes"/>
1307
    </xslt>
1308
  </target>
1309

    
1310
 <target name="gridinit" depends="init">
1311
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
1312
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
1313
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
1314
   <property environment="env"/>
1315
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1316
    <path id="webservicepath">
1317
        <pathelement location="."/>
1318
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1319
        <pathelement location="${build.dest}"/>
1320
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1321
           <include name="*.jar"/>
1322
        </fileset>
1323
      </path>
1324
</target>
1325

    
1326
 <target name="gridprepare" depends="gridinit, prepare">
1327
 </target>
1328

    
1329
  <target name="compileinterface" depends="clean, gridprepare">
1330
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1331
  </target>
1332

    
1333
  <target name="generateWSDL" depends="compileinterface">
1334
    <echo message="Generating wsdl from ${interface.name} interface"/>
1335
    <java classname="${java2wsdl.tool}"
1336
          dir="${build.src}" fork="yes"
1337
          classpathref="webservicepath"  failonerror="true" >
1338
      <arg value="-P"/>
1339
      <arg value="${interface.name}PortType"/>
1340
      <arg value="-S"/>
1341
      <arg value="${interface.name}Service"/>
1342
      <arg value="-y"/>
1343
      <arg value="WRAPPED"/>
1344
      <arg value="-u"/>
1345
      <arg value="LITERAL"/>
1346
      <arg value="-l"/>
1347
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1348
      <arg value="-n"/>
1349
      <arg value="http://${services.namespace}/${interface.name}"/>
1350
      <arg value="${interface.package}.${interface.name}"/>
1351
    </java>
1352
  </target>
1353

    
1354
   <target name="decorateWSDL" depends="generateWSDL">
1355
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1356
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1357
            fork="yes"
1358
            classpathref="webservicepath" failonerror="true" >
1359
        <arg value="${binding.file}"/>
1360
        <arg value="${wsdl.file}"/>
1361
      </java>
1362
   </target>
1363

    
1364
   <target name="generatestubs" depends="decorateWSDL">
1365
      <echo message=" Generating stubs " />
1366
      <echo message="wsdl file is ${wsdl.file}"/>
1367
      <echo message="build.src is ${build.src}"/>
1368
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1369
            classpathref="webservicepath" failonerror="true" >
1370
         <arg value="${wsdl.file}"/>
1371
    </java>
1372
  </target>
1373

    
1374
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1375
     <echo message=" Compiling stubs " />
1376
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1377
     <echo message=" Compiling impl " />
1378
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1379
  </target>
1380

    
1381
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1382
     <echo message=" jar stubs classes " />
1383
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1384
     <echo message=" jar impl classes " />
1385
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1386
  </target>
1387

    
1388
  <target name="gar" depends="jarStubsAndImpl">
1389
     <echo message=" jar the gar file"/>
1390
     <mkdir dir="${build.dir}/gar"/>
1391
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1392
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1393
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1394
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1395
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1396
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1397
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1398
  </target>
1399

    
1400
  <target name="compilewebclient" depends="prepare">
1401
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1402
  </target>
1403

    
1404
  <target name="runwebclient" depends="compilewebclient">
1405
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1406
           dir="${build.dest}" fork="yes"
1407
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1408
         <arg value="${serviceUrl}"/>
1409
         <arg value="${docid}"/>
1410
     </java>
1411
  </target>
1412
  
1413
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1414

    
1415
    <echo message="Compiling the metatcat shapefile creator"/>
1416
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1417
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1418
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1419
    </exec>
1420
  
1421
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1422
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1423
    </exec>
1424
  </target>
1425

    
1426
    <!-- LSID Authority support -->
1427
    <patternset id="lsid.jars">
1428
        <include name="axis.jar" />
1429
        <include name="commons-discovery-0.2.jar" />
1430
        <include name="jaxrpc.jar" />
1431
        <include name="lsid-client-1.1.1.jar" />
1432
        <include name="lsid-server-1.1.1.jar" />
1433
        <include name="saaj.jar" />
1434
        <include name="wsdl4j-1.5.1.jar" />
1435
        <include name="activation.jar" />
1436
        <include name="castor-0.9.5.jar" />
1437
        <include name="dnsjava-1.3.2.jar" />
1438
        <include name="mail.jar" />
1439
        <include name="commons-logging-1.0.4.jar" />
1440
        <!-- These jars may be needed but seem to not actually be,
1441
             so leaving them out for now
1442
        <include name="axis-ant.jar" />
1443
        -->
1444
        <!--<include name="GenCastor.class" />-->
1445
    </patternset>
1446
    <patternset id="lib.jars">
1447
        <include name="httpclient.jar" />
1448
        <include name="log4j-1.2.12.jar" />
1449
        <include name="utilities.jar" />
1450
        <include name="xercesImpl.jar" />
1451
        <include name="xalan.jar" />
1452
        <include name="xml-apis.jar" />
1453
    </patternset>
1454

    
1455
    <path id="lsid.classpath">
1456
        <fileset dir="${lsid.lib.dir}">
1457
            <patternset refid="lsid.jars"/>
1458
        </fileset>
1459
        <fileset dir="${lib.dir}">
1460
            <patternset refid="lsid.jars"/>
1461
        </fileset>
1462
        <fileset dir="${lib.dir}/xalan">
1463
            <include name="xalan.jar" />
1464
            <include name="xml-apis.jar" />
1465
        </fileset>
1466
        <fileset dir="${build.dir}">
1467
            <include name="metacat-client.jar" />
1468
        </fileset>
1469
    </path>
1470

    
1471
    <filterset id="configFilters">
1472
        <filter token="LSID_AUTHORITY_HOSTNAME"
1473
                value="${config.hostname}" />
1474
        <filter token="LSID_AUTHORITY_PORT"
1475
                value="${config.port}" />
1476
        <filter token="METADATA_LABELS"
1477
                value="${config.metadataLabelLsid}" />
1478
        <filter token="METACAT_SERVER"
1479
                value="${config.metacatserver}" />
1480
        <filter token="LSID_AUTHORITY_STRING"
1481
                value="${config.lsidauthority}" />
1482
    </filterset>
1483
    
1484
    <target name="prepare-lsid"
1485
            depends="prepare,utilities,clientjar"
1486
            description="Configure files prior to compilation">
1487
        <mkdir dir="${lsid.build.dir}" />
1488
        <!-- Copy the properties file into the build -->
1489
        <copy file="${conf.dir}/metacat-lsid.properties"
1490
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1491
              overwrite="true">
1492
            <filterset refid="configFilters" />
1493
        </copy>
1494
        <copy file="${conf.dir}/log4j.properties"
1495
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1496
              overwrite="true">
1497
            <filterset refid="configFilters" />
1498
        </copy>
1499
        <!-- Copy config files into the build -->
1500
        <copy todir="${lsid.build.dir}/WEB-INF">
1501
            <fileset dir="${webinf.dir}"
1502
                     includes="**/*.wsdd" />
1503
        </copy>
1504
        <!-- Copy the metadata configuration files into the build -->
1505
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1506
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1507
            <fileset dir="${conf.dir}"
1508
                     includes="**/*.xml" />
1509
            <fileset dir="${conf.dir}"
1510
                     includes="**/*.xslt" />
1511
            <filterset refid="configFilters" />
1512
        </copy>
1513
        <!-- Copy services files into the build -->
1514
        <mkdir dir="${lsid.build.dir}/services" />
1515
        <copy todir="${lsid.build.dir}/services">
1516
            <fileset dir="${services.dir}" />
1517
            <filterset refid="configFilters" />
1518
        </copy>
1519
        <!-- Copy axis files into the build -->
1520
        <mkdir dir="${lsid.build.dir}" />
1521
        <copy todir="${lsid.build.dir}">
1522
            <fileset dir="${conf.dir}/axis"
1523
                     excludes="*.properties"/>
1524
        </copy>
1525
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1526
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1527
            <fileset dir="${conf.dir}/axis"
1528
                     includes="*.properties"/>
1529
        </copy>
1530
    </target>
1531
    
1532
    <target name="compile-lsid"
1533
            depends="prepare-lsid"
1534
            description="Compile Java sources">
1535
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1536
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1537
               destdir="${lsid.build.dir}/WEB-INF/classes"
1538
               debug="${compile.debug}"
1539
               deprecation="${compile.deprecation}"
1540
               optimize="${compile.optimize}">
1541
            <classpath refid="lsid.classpath" />
1542
        </javac>
1543
    </target>
1544
    
1545
    <target name="war-lsid"
1546
            depends="compile-lsid"
1547
            description="Create a war file for the application">
1548
        <mkdir dir="${dist.dir}" />
1549
        <war destfile="${dist.dir}/${authority.context}.war"
1550
             webxml="${webinf.dir}/web.xml">
1551
            <fileset dir="${lsid.build.dir}" />
1552
            <lib dir="${lsid.lib.dir}">
1553
                <patternset refid="lsid.jars"/>
1554
            </lib>
1555
            <lib dir="${lib.dir}">
1556
                <patternset refid="lib.jars"/>
1557
            </lib>
1558
            <lib dir="${lib.dir}/xalan">
1559
                <include name="xalan.jar" />
1560
                <include name="xml-apis.jar" />
1561
            </lib>
1562
            <lib dir="${build.dir}">
1563
                <include name="metacat-client.jar" />
1564
            </lib>
1565
        </war>
1566
    </target>
1567
    
1568
    <target name="deploy-lsid"
1569
            depends="war-lsid"
1570
            description="Deploy LSID war to servlet container">
1571
        <delete dir="${deploy.dir}/${authority.context}" />
1572
        <delete file="${deploy.dir}/${authority.context}.war" />
1573
        <mkdir dir="${deploy.dir}" />
1574
        <copy todir="${deploy.dir}">
1575
            <fileset dir="${dist.dir}" />
1576
        </copy>
1577
    </target>
1578
</project>
(5-5/5)