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: jones $'
10
  *    '$Date: 2006-04-14 14:28:46 -0700 (Fri, 14 Apr 2006) $'
11
  *    '$Revision: 2982 $'
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=jones,o=NCEAS,dc=ecoinformatics,dc=org"/>
129
      <property name="mcpassword" value=""/>
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_2" />
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
   </target>
778
	
779
   <target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
780
			    description="Install Ecogrid Compentent">
781
   	  <copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
782
   	  <ant antfile="build_new.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
783
   	         <property name="context" value="${metacat.context}"/>
784
   	   	     <property name="target" value="${ecogrid-target-name}"/>
785
   	   	     <property name="metacat.dir" value="${metacat.dir}"/>
786
   	  </ant>
787
   	  <ant antfile="build_new.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
788
   	     <property name="context" value="${metacat.context}"/>
789
   	     <property name="target" value="${ecogrid-target-name}"/>
790
   	     <property name="metacat.dir" value="${metacat.dir}"/>
791
   	  </ant>
792
   	  <war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
793
  	      <webinf dir="${ecogrid-dir}/lib">
794
   	        <include name="server-config.wsdd"/>
795
   	      </webinf>
796
   	  </war>
797
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
798
   	  
799
   
800
   </target>
801
   
802
   <target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
803
	<echo>Enter CVS password: </echo>
804
	     <cvs cvsRoot="${cvsroot}"
805
	          package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
806
   </target>
807
	
808
   	
809
   <target name="upgrade" depends="install"
810
          description="* Upgrade an existing metacat installation with a new version *">
811
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
812
   </target>
813
	
814
   <target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
815
   	 <ant antfile="build_new.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
816
   	   	 <property name="context" value="${metacat.context}"/>
817
   	   	 <property name="target" value="${ecogrid-target-name}"/>
818
   	     <property name="metacat.dir" value="${metacat.dir}"/>
819
   	     <property name="hostname" value="${config.hostname}"/>
820
   	     <property name="port" value="${config.port}"/>
821
   	 </ant>
822
   </target>
823
	
824
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
825
      <delete file="${deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
826
   </target>
827

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

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

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

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

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

    
874

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1067
        <formatter type="plain" />
1068

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

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

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

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

    
1096
        <formatter type="plain" />
1097

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

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

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

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

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

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

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

    
1177
        <formatter type="plain" />
1178

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

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

    
1192

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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