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

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

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

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

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

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

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

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

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

    
385
   </target>
386

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

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

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

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

    
420
   <target name="jar" depends="compile,geteml"
421
    description="Compiles and jars metacat java code to metacat.jar in build dir">
422

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

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

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

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

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

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

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

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

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

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

    
512
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
513
            description="Calls getemlpre2 and geteml2+ targets" />
514

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

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

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

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

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

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

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

    
579
   <target  name="copyxsl"
580
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
581

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

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

    
590

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

    
596
   </target>
597

    
598

    
599

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

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

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

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

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

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

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

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

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

    
717
   </target>
718

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

    
734

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

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

    
832
   <target name="install-registry" depends="init,getConversionXSL"
833
            description="Install Registry">
834

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

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

    
847
      <echo message="Install Registry completed." />
848
   </target>
849

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

    
878

    
879
   <target name="install-skin" depends="init"
880
            description="Install a Skin">
881

    
882
      <input message="Please enter name of the skin"
883
             addproperty="skin-name"/>
884

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

    
927
      <echo message="Install Skin completed." />
928
   </target>
929

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

    
943
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
944
            description="Prepare files for creating a web archive (WAR)">
945

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

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

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

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

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

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

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

    
1054
   <target name="test" depends="testprep"
1055
            description="Uses the ant junit task to run all JUnit tests">
1056

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

    
1071
        <formatter type="plain" />
1072

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

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

    
1084
              <echo>testtorun: ${testtorun}</echo>
1085

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

    
1100
        <formatter type="plain" />
1101

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

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

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

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

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

    
1165
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1166
                    basedir="${build.metacatnettest}"
1167
                    includes="**/*.class" />
1168

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

    
1181
        <formatter type="plain" />
1182

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

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

    
1196

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

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

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

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

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

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

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

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

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

    
1329
 <target name="gridprepare" depends="gridinit, prepare">
1330
 </target>
1331

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

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

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

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

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

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

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

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

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

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

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

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

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