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: tao $'
10
  *    '$Date: 2007-10-23 16:18:16 -0700 (Tue, 23 Oct 2007) $'
11
  *    '$Revision: 3524 $'
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}/common/lib/servlet.jar">
38
    <equals arg1="${tomcatversion}" arg2="tomcat4" />
39
  </condition>
40
  <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
41
    <equals arg1="${tomcatversion}" arg2="tomcat5" />
42
  </condition>
43
	
44
  <!-- Determine if installed ecogrid -->
45
  <condition property="enable.ecogrid">
46
    <equals arg1="${install.ecogrid}" arg2="true" />
47
  </condition>
48

    
49
  <target name="check-db">
50
    <condition property="use-oracle">
51
      <equals arg1="${database}" arg2="oracle" />
52
    </condition>
53
    <condition property="use-postgresql">
54
      <equals arg1="${database}" arg2="postgresql" />
55
    </condition>
56
    <condition property="use-sqlserver">
57
      <equals arg1="${database}" arg2="sqlserver" />
58
    </condition>
59
  </target>
60

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

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

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

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

    
138
      <property name="debug" value="on" />
139
      <property name="debuglevel" value="55" />
140

    
141
      <property name="morphosourcedir" value="../morpho" />
142
      <property name="defaultcontenttype" value="application/octet-stream" />
143
      <property name="utilitiesdir" value="../utilities" />
144

    
145
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
146
      <echo>*********** set jsdk to ${jsdk}</echo>
147
  </target>
148

    
149
   <target name="init" depends="config">
150
      <path id="compile.classpath">
151
        <pathelement location="${jsdk}"/>
152
        <pathelement location="lib" />
153
        <fileset dir="lib">
154
          <include name="*.jar"/>
155
        </fileset>
156
	<fileset dir="lib">
157
           <include name="xalan.jar"/>
158
         </fileset>
159
       <fileset dir="lib/lsid_lib">
160
         <include name="*.jar"/>
161
       </fileset>
162
       <fileset dir="${jdbc_base}">
163
         <include name="${jdbc-jar-name}"/>
164
          <include name="msbase.jar"/>
165
          <include name="msutil.jar"/>
166
          <include name="mssqlserver.jar"/>
167
       </fileset>
168

    
169
        <!-- Include geoserver, geotools, et. al. -->
170
        <fileset dir="lib/spatial/geoserver/WEB-INF/lib">
171
          <include name="*.jar"/>
172
        </fileset>
173
        <pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
174

    
175
       </path>
176
      
177
      <!-- It is less likely you'll need to make any changes from here down,
178
           but customization is possible -->
179
      <property name="installdir"          value="${deploy.dir}/${metacat.context}" />
180
      <property name="temp-dir"            value="/tmp/${metacat.context}" />
181
      <property name="name"                value="metacat"/>
182
      <property name="Name"                value="MetaCat"/>
183
      <property name="debugprefix"         value="${Name}:"/>
184
      <property name="release"             value="1.7.1"/>
185
      <property name="replication-path"    value="/${metacat.context}/servlet/replication"/>
186
      <property name="harvester-registration-login-path" value="/${metacat.context}/harvesterRegistrationLogin"/>
187
      <property name="harvester-registration-path"       value="/${metacat.context}/harvesterRegistration"/>
188
      <property name="servlet-path"        value="/${metacat.context}/metacat"/>
189
      <property name="html-path"           value="/${metacat.context}"/>
190
      <property name="systemidserver"      value="${http.protocol}://${httpserver}"/>
191
      <property name="style-common-relpath" value="/style/common"/>
192
      <property name="style-shared-relpath" value="/style/shared"/>
193
      <property name="style-common-cvsrelpath" value="lib${style-common-relpath}"/>
194
      <property name="style-common-fullpath" value="/${installdir}${style-common-relpath}"/>
195
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
196
      <property name="style-common-path"   value="/${metacat.context}${style-common-relpath}"/>
197
      <property name="style-shared-path"   value="/${metacat.context}${style-shared-relpath}"/>
198
      <property name="style-skins-relpath" value="/style/skins"/>
199
      <property name="style-skins-path"    value="/${metacat.context}${style-skins-relpath}"/>
200
      <property name="replication-log"     value="${log.dir}/metacatreplication.log"/>
201
      <property name="replicationerrorlog" value="${log.dir}/metacatreplication.err"/>
202
      <property name="config-dir"          value="${deploy.dir}/${style-skins-path}" />
203
      <property name="util-module"         value="utilities" />
204
      <property name="eml-module"          value="eml" />
205
      <property name="eml-version"         value="2.0.0beta6" />
206
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
207
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
208
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1_UPDATE_4" />
209
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
210
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
211
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
212
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
213
      <property name="eml-css"             value="eml_xsl.css"/>
214
      <property name="eml-module.default.css"
215
                                           value="default.css"/>
216
   	  
217
      <!-- Config for registry variables -->
218
      <property name="scope"               value="obfs"/>
219
      <property name="responseForm"        value="genericResponse.tmpl"/>
220
      <property name="entryForm"           value="entryForm.tmpl"/>
221
      <property name="guide"               value="genericGuide.tmpl"/>
222
      <property name="loginForm"           value="loginForm.tmpl"/>
223
      <property name="confirmData"         value="confirmData.tmpl"/>
224
      <property name="deleteData"          value="deleteData.tmpl"/>
225
      <property name="genericHeader"       value="genericHeader.tmpl"/>
226
      <property name="genericFooter"       value="genericFooter.tmpl"/>
227
      <property name="adminname"           value="KNB Support"/>
228
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
229

    
230
      <property name="defaultStage"        value="initregister"/>
231
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
232
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
233
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
234
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
235
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
236
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
237
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
238
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
239
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
240
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
241
      <property name="register"            value="ldapRegister.tmpl"/>
242
      <property name="searchResults"       value="searchResults.tmpl"/>
243
   	  <property name="ldapMainServerFailure" value="ldapMainServerFailure.tmpl"/>
244

    
245
      <filter token="scope"                value="${scope}"/>
246
      <filter token="responseForm"         value="${responseForm}"/>
247
      <filter token="entryForm"            value="${entryForm}"/>
248
      <filter token="guide"                value="${guide}"/>
249
      <filter token="loginForm"            value="${loginForm}"/>
250
      <filter token="confirmData"          value="${confirmData}"/>
251
      <filter token="deleteData"           value="${deleteData}"/>
252
      <filter token="genericHeader"        value="${genericHeader}"/>
253
      <filter token="genericFooter"        value="${genericFooter}"/>
254
      <filter token="adminname"            value="${adminname}"/>
255
      <filter token="recipient"            value="${recipient}"/>
256

    
257
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
258
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
259
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
260
      <filter token="ldap_password"        value="ldap_password"/>
261
      <filter token="mailhost"             value="localhost"/>
262
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
263
      <filter token="cgiurl"               value="${cgi-prefix}/ldapweb.cgi"/>
264

    
265
      <filter token="docrooturl" value="./" />
266
      <filter token="database" value="${database}" />
267
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
268
      <filter token="dbDriver" value="${dbDriver}"/>
269
      <filter token="dbAdapter" value="${dbAdapter}"/>
270
      <filter token="install-dir" value="${installdir}"/>
271
      <filter token="temp-dir" value="${temp-dir}"/>
272
      <filter token="server" value="${server}"/>
273
      <filter token="systemidserver" value="${systemidserver}"/>
274
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
275
      <filter token="ldapUrl" value="${ldapUrl}"/>
276
      <filter token="replication-log" value="${replication-log}"/>
277
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
278
      <filter token="servlet-path" value="${servlet-path}"/>
279
      <filter token="html-path" value="${html-path}"/>
280
      <filter token="user" value="${user}"/>
281
      <filter token="password" value="${password}"/>
282
      <filter token="mcuser" value="${mcuser}"/>
283
      <filter token="mcpassword" value="${mcpassword}"/>
284
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
285
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
286
      <filter token="knb-site-url" value="${knb-site-url}"/>
287
      <filter token="eml-css" value="${eml-css}"/>
288
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
289
      <filter token="style-skins-path" value="${style-skins-path}"/>
290
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
291
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
292
      <filter token="style-common-path" value="${style-common-path}"/>
293
      <filter token="style-shared-path" value="${style-shared-path}"/>
294
      <filter token="templates.dir" value="${templates.dir}"/>
295

    
296
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
297
      <filter token="style-path" value="${style-skins-path}"/>
298
      <filter token="replication-path" value="${replication-path}"/>
299
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
300
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
301
      <filter token="config-dir" value="${config-dir}"/>
302
      <filter token="default-style" value="${default-style}"/>
303
      <filter token="eml-version" value="${eml-version}"/>
304
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
305
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
306
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
307
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
308
      <filter token="context" value="${metacat.context}"/>
309
   	  <filter token="httpserver" value="${httpserver}"/>
310
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
311
      <filter token="debuglevel" value="${debuglevel}" />
312
      <filter token="datafilepath" value="${datafilepath}" />
313
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
314
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
315
      <filter token="debugprefix" value="${debugprefix}"/>
316
      <filter token="administrators" value="${administrators}"/>
317
      <filter token="moderators" value="${moderators}"/>
318
      <filter token="allowedSubmitters" value="${allowedSubmitters}"/>
319
      <filter token="deniedSubmitters" value="${deniedSubmitters}"/>
320
      <filter token="indexPaths" value="${indexPaths}"/>
321

    
322
      <filter token="defaultStage" value="${defaultStage}"/>
323
      <filter token="defaultHeader" value="${defaultHeader}"/>
324
      <filter token="defaultFooter" value="${defaultFooter}"/>
325
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
326
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
327
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
328
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
329
      <filter token="registerFailed" value="${registerFailed}"/>
330
      <filter token="registerLter" value="${registerLter}"/>
331
      <filter token="registerMatch" value="${registerMatch}"/>
332
      <filter token="registerSuccess" value="${registerSuccess}"/>
333
      <filter token="register" value="${register}"/>
334
      <filter token="searchResults" value="${searchResults}"/>
335
   	  <filter token="ldapMainServerFailure" value="${ldapMainServerFailure}"/>
336
       
337
   	  <filter token="timedreplication" value="${timedreplication}" />
338
   	  <filter token="firsttimedreplication" value="${firsttimedreplication}" />
339
   	  <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
340
      
341
   	  <property name="srcdir" value="./src" />
342
   	  <property name="lib.dir" value="./lib" />
343
      <property name="testdir" value="./test" />
344
      <property name="testtorun" value="BuildIndexTest" />
345
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
346
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
347
      <property name="build.dir" value="./build"/>
348
      <property name="build.src" value="${build.dir}/src"/>
349
      <property name="build.dest" value="${build.dir}/classes"/>
350
      <property name="build.docs" value="${build.dir}/docs"/>
351
      <property name="build.samples" value="${build.dir}/samples"/>
352
      <property name="build.tests" value="${build.dir}/tests"/>
353
      <property name="build.tmp" value="${build.dir}/tmp"/>
354
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
355
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
356
      <property name="build.data" value="${build.dir}/data"/>
357
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
358
      <property name="build.war" value="${build.dir}/war"/>
359

    
360
      <property name="dist.dir" value="dist"/>
361
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
362
      <property name="ver.src" value="${ver.dir}/src"/>
363
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
364
	  <!-- directories for creating a Harvest List Editor distribution -->
365
      <property name="dist.dir.hle" value="disthle"/>
366
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
367
   	  
368
   	  
369
   	  <property name="ecogrid-target-name" value="metacatImpl"/>
370
   	  <property name="ecogrid-module-dest-dir" value =".."/>
371
   	  <property name="ecogrid-module" value="seek/projects/ecogrid"/>
372
   	  <property name="ecogrid-dist-dir" value="${dist.dir}/${ecogrid-module}"/>
373
   	  <property name="ecogrid-dir" value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
374

    
375
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
376
      <condition property="utilities.required">
377
        <or>
378
          <not><available file="lib/httpclient.jar"/></not>
379
          <not><available file="lib/utilities.jar"/></not>
380
        </or>
381
      </condition>
382
      <condition property="eml.required">
383
        <or>
384
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
385
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
386
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
387
        </or>
388
      </condition>
389
   	  
390
      <condition property="ecogrid.required">
391
      	   <or>
392
             <not><available file="${ecogrid-dir}/build.properties"/></not>
393
             <not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
394
           </or>
395
      </condition>
396

    
397
   </target>
398

    
399
   <target name="prepare" depends="init">
400
      <mkdir dir="${build.dir}"/>
401
      <mkdir dir="${build.src}"/>
402
      <mkdir dir="${build.dest}"/>
403
      <mkdir dir="${build.javadocs}"/>
404
      <mkdir dir="${build.tmp}"/>
405

    
406
      <copy todir="${build.src}" filtering="yes">
407
        <fileset dir="${srcdir}">
408
          <include name="edu/**"/>
409
          <include name="com/**"/>
410
          <include name="org/**"/>
411
          <include name="**/*.sql"/>
412
          <exclude name="**/CVS*"/>
413
          <exclude name="**/.#*"/>
414
        </fileset>
415
      </copy>
416
      <available file="lib/style/common/emlb6toeml2" type="dir"
417
                 property="styles.not.needed"/>
418
   </target>
419

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

    
423
       <javac srcdir="${build.src}"
424
              destdir="${build.dest}"
425
              debug="${debug}"
426
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
427
        <classpath>
428
          <path refid="compile.classpath"/>
429
        </classpath>
430
      </javac>
431
   </target>
432

    
433
   <target name="jar" depends="compile,geteml"
434
    description="Compiles and jars metacat java code to metacat.jar in build dir">
435

    
436
       <delete file="${build.dir}/${name}.jar" />
437
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
438
            excludes="**/protocols/ **/harvesterClient/" />
439
   </target>
440

    
441
   <target name="protocol" depends="compile"
442
    description="Compiles and jars protocol java code to protocol.jar in build dir">
443
       <delete file="${build.dir}/protocol.jar" />
444
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
445
            includes="**/protocols/" />
446
   </target>
447

    
448
   <target name="utilities" depends="config" if="utilities.required">
449
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
450
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
451
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
452
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
453
   </target>
454

    
455
   <target name="getutilities" depends="prepare"
456
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
457
     <echo>Enter CVS password: </echo>
458
     <cvs cvsRoot="${cvsroot}"
459
          package="${util-module}"
460
          dest="${build.tmp}" />
461
   </target>
462

    
463
   <target name="client" depends="utilities, prepare"
464
    description="Compiles metacat-client java code to build dir">
465
       <javac srcdir="${build.src}"
466
              destdir="${build.dest}"
467
              includes="edu/ucsb/nceas/metacat/client/*">
468
          <classpath>
469
            <path refid="compile.classpath"/>
470
          </classpath>
471
        </javac>
472
   </target>
473

    
474
   <target name="clientjar" depends="client"
475
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
476
       <delete file="${build.dir}/${name}-client.jar" />
477
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
478
            includes="**/metacat/client/" />
479
   </target>
480

    
481
    <target name="advancedsearchjar" depends="compile"
482
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
483
        <delete file="${build.dir}/advancedsearch.jar" />
484
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
485
             includes="**/metacat/advancedsearch/" />
486
    </target>
487

    
488
   <target name="harvester" depends="client"
489
           description="Compiles harvester java code to build dir">
490
       <javac srcdir="${build.src}"
491
              destdir="${build.dest}"
492
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
493
          <classpath>
494
            <path refid="compile.classpath"/>
495
          </classpath>
496
        </javac>
497
   </target>
498

    
499
   <target name="harvesterjar" depends="harvester"
500
           description="Compiles and jars harvester java code to harvester.jar in build dir">
501
       <delete file="${build.dir}/harvester.jar" />
502
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
503
            includes="**/metacat/harvesterClient/" />
504
   </target>
505

    
506
   <target name="harvestListEditorDist" depends="harvesterjar"
507
           description="Prepares a distribution of the Harvest List Editor tool">
508
       <mkdir dir="${dist.dir.hle}"/>
509
       <delete dir="${ver.dir.hle}" />
510
       <mkdir dir="${ver.dir.hle}"/>
511
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
512
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
513
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
514
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
515
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
516
       <delete file="./harvest-list-editor-${release}.zip"/>
517
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
518
       <delete file="./harvest-list-editor-${release}.tar.gz" />
519
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
520
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
521
             src="./harvest-list-editor-${release}.tar"/>
522
       <delete file="./harvest-list-editor-${release}.tar" />
523
   </target>
524

    
525
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
526
            description="Calls getemlpre2 and geteml2+ targets" />
527

    
528
   <target name="getemlpre2" depends="prepare" if="eml.required"
529
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
530
     <echo>Enter CVS password: </echo>
531
     <cvs cvsRoot="${cvsroot}"
532
          package="${eml-module}"
533
          tag="${eml-tag}"
534
          dest="${build.tmp}/eml_${eml-tag}" />
535
     <mkdir dir="lib/dtd" />
536
     <copy todir="lib/dtd" filtering="yes">
537
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
538
         <include name="*.dtd"/>
539
       </fileset>
540
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
541
     </copy>
542

    
543
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
544
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
545
       <include name="**/*.xsl"/>
546
     </fileset>
547
     </copy>
548
   </target>
549

    
550
   <target name="geteml2+" depends="prepare" if="eml.required"
551
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
552
     <echo>Enter CVS password: </echo>
553
     <cvs cvsRoot="${cvsroot}"
554
          package="${eml-module}"
555
          tag="${eml2_0_0-tag}"
556
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
557
     <mkdir dir="lib/schema/eml-2.0.0" />
558
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
559
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
560
         <include name="*.xsd"/>
561
       </fileset>
562

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

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

    
569
     </copy>
570
     <!-- <antcall target="copyxsl">
571
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
572
        <param name="dirname" value="eml-2.0.0" />
573
     </antcall> -->
574

    
575
     <echo>Enter CVS password: </echo>
576
     <cvs cvsRoot="${cvsroot}"
577
          package="${eml-module}"
578
          tag="${eml2_0_1-tag}"
579
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
580
     <mkdir dir="lib/schema/eml-2.0.1" />
581
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
582
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
583
         <include name="*.xsd"/>
584
       </fileset>
585
     </copy>
586
     <antcall target="copyxsl">
587
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
588
        <param name="dirname" value="eml-2.0.1" />
589
     </antcall>
590
   </target>
591

    
592
   <target  name="copyxsl"
593
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
594

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

    
597
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
598
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
599
       <include name="**/*.xsl"/>
600
     </fileset>
601
     </copy>
602

    
603

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

    
609
   </target>
610

    
611

    
612

    
613
   <target name="register-schemas" depends="prepare"
614
   description="Registers the Schemas with a new Metacat instance">
615
     <echo/>
616
     <echo>Registering the Schemas with the new Metacat instance...</echo>
617
     <sql driver="${dbDriver}"
618
          url="${jdbc-connect}"
619
          userid="${user}"
620
          password="${password}"
621
          src="${build.src}/loaddtdschema.sql">
622
       <classpath>
623
         <path refid="compile.classpath"/>
624
       </classpath>
625
     </sql>
626
   </target>
627

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

    
645
   <target name="dropdb" depends="prepare"
646
            description="WARNING: Drops the database tables">
647
     <echo/>
648
     <echo>Dropping the database tables...</echo>
649
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
650
     <echo/>
651
     <sql driver="${dbDriver}"
652
          url="${jdbc-connect}"
653
          userid="${user}"
654
          password="${password}"
655
          src="${build.src}/drop-postgres.sql">
656
       <classpath>
657
         <path refid="compile.classpath"/>
658
       </classpath>
659
     </sql>
660
   </target>
661

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

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

    
692
   <target name="upgrade14" depends="prepare"
693
            description="Updates the database tables to upgrade to version 1.4">
694
     <echo/>
695
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
696
     <sql driver="${dbDriver}"
697
          url="${jdbc-connect}"
698
          userid="${user}"
699
          password="${password}"
700
          src="${build.src}/${upgrade-1.4-sql}">
701
       <classpath>
702
         <path refid="compile.classpath"/>
703
       </classpath>
704
     </sql>
705
   </target>
706

    
707
   <target name="upgrade15" depends="sqlupgrade15"
708
           description="Updates the database tables to upgrade to version 1.5">
709
     <echo/>
710
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
711
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
712
           todir="${build.tmp}" filtering="yes"/>
713

    
714
     <javac srcdir="${build.tmp}"
715
            destdir="${build.tmp}"
716
            debug="${debug}"
717
            includes="upgrade_db_to_1_5.java">
718
       <classpath>
719
         <path refid="compile.classpath"/>
720
       </classpath>
721
     </javac>
722

    
723
     <java classname="upgrade_db_to_1_5">
724
       <classpath>
725
         <path refid="compile.classpath"/>
726
         <fileset dir="${build.tmp}"/>
727
       </classpath>
728
     </java>
729

    
730
   </target>
731

    
732
   <target name="upgrade16" depends="prepare"
733
            description="Updates the database tables from version 1.5 to version 1.6">
734
     <echo/>
735
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
736
     <sql driver="${dbDriver}"
737
          url="${jdbc-connect}"
738
          userid="${user}"
739
          password="${password}"
740
          src="${build.src}/${upgrade-1.6-sql}">
741
       <classpath>
742
         <path refid="compile.classpath"/>
743
       </classpath>
744
     </sql>
745
   </target>
746

    
747
   <target name="upgrade17" depends="prepare"
748
            description="Updates the database tables from version 1.6 to version 1.7">
749
     <echo/>
750
     <echo>Updating the database tables to upgrade to version 1.7...</echo>
751
     <sql driver="${dbDriver}"
752
          url="${jdbc-connect}"
753
          userid="${user}"
754
          password="${password}"
755
          src="${build.src}/${upgrade-1.7-sql}">
756
       <classpath>
757
         <path refid="compile.classpath"/>
758
       </classpath>
759
     </sql>
760
   </target>
761
	
762
   <target name="upgrade171" depends="prepare"
763
	            description="Updates the database tables from version 1.7 to version 1.7.1">
764
	     <echo/>
765
	     <echo>Updating the database tables to upgrade to version 1.7.1...</echo>
766
	     <sql driver="${dbDriver}"
767
	          url="${jdbc-connect}"
768
	          userid="${user}"
769
	          password="${password}"
770
	          src="${build.src}/${upgrade-1.7.1-sql}">
771
	       <classpath>
772
	         <path refid="compile.classpath"/>
773
	       </classpath>
774
	     </sql>
775
   </target>
776

    
777
   <target name="sqlupgrade15" depends="prepare">
778
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
779
      <sql driver="${dbDriver}"
780
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
781
          url="${jdbc-connect}"
782
          userid="${user}"
783
          password="${password}"
784
          src="${build.src}/${upgrade-1.5-sql}" />
785
      <sql driver="${dbDriver}"
786
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
787
          url="${jdbc-connect}"
788
          userid="${user}"
789
          password="${password}"
790
          rdbms="oracle"
791
          delimiter="/">
792
        <transaction>
793
           CREATE TRIGGER xml_returnfield_before_insert
794
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
795
           BEGIN
796
              SELECT xml_returnfield_id_seq.nextval
797
                 INTO :new.returnfield_id
798
                 FROM dual;
799
           END;
800
           /
801
        </transaction>
802
        <transaction>
803
           CREATE TRIGGER xml_queryresult_before_insert
804
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
805
           BEGIN
806
              SELECT xml_queryresult_id_seq.nextval
807
              INTO :new.queryresult_id
808
              FROM dual;
809
           END;
810
           /
811
        </transaction>
812
      </sql>
813
   </target>
814

    
815
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
816
           description="Installs spatial option for metacat">
817

    
818
      <property name="spatial.dir" value="./lib/spatial"/>
819
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
820
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
821

    
822
      <!-- Copy geoserver libs into ${war.lib} -->
823
      <copy todir="${war.lib}" filtering="no">
824
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
825
          <include name="**"/>
826
        </fileset>
827
      </copy>
828

    
829
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
830
      <copy todir="${war.webinf}" filtering="no">
831
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
832
          <exclude name="lib/**"/>
833
          <exclude name="web.xml"/>
834
        </fileset>
835
      </copy>
836

    
837
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
838
      <copy todir="${war.context}" filtering="no">
839
        <fileset dir="${spatial.geoserver.dir}">
840
          <exclude name="WEB-INF/**"/>
841
          <exclude name="index.jsp"/>
842
        </fileset>
843
      </copy>
844

    
845
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
846
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
847
          tofile="${war.context}/geoserver.jsp"
848
          overwrite="true"
849
          filtering="no"/>
850

    
851
      <!-- Copy the rest of the modified geoserver web-inf files
852
      <copy todir="${war.webinf}" filtering="no">
853
        <fileset dir="${spatial.webinf-mods}">
854
          <exclude name="web.xml.combined"/>
855
        </fileset>
856
      </copy> -->
857

    
858
    </target>
859

    
860

    
861
   <target name="install" depends="install-ecogrid" description="* Full Install *">
862
       <mkdir dir="${datafilepath}" />
863
       <mkdir dir="${inlinedatafilepath}" />
864
       <chmod dir="${datafilepath}" perm="ug+w" />
865
       <mkdir dir="${temp-dir}"/>
866
       <chmod dir="${temp-dir}" perm="ug+w" />
867
       <copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
868
   	   <echo>If you enable ecogrid installation, please run "ant deploy-ecogrid" when installation or upgrade is done</echo> 
869
   </target>
870
	
871
   <target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
872
			    description="Install Ecogrid Compentent">
873
   	  <copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
874
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
875
   	         <property name="context" value="${metacat.context}"/>
876
   	   	     <property name="target" value="${ecogrid-target-name}"/>
877
   	   	     <property name="metacat.dir" value="${metacat.dir}"/>
878
   	  </ant>
879
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
880
   	     <property name="context" value="${metacat.context}"/>
881
   	     <property name="target" value="${ecogrid-target-name}"/>
882
   	     <property name="metacat.dir" value="${metacat.dir}"/>
883
   	  </ant>
884
   	  <war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
885
  	      <webinf dir="${ecogrid-dir}/lib">
886
   	        <include name="server-config.wsdd"/>
887
   	      </webinf>
888
   	  </war>
889
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
890
   	  
891
   
892
   </target>
893
   
894
   <target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
895
	<echo>Enter CVS password: </echo>
896
	     <cvs cvsRoot="${cvsroot}"
897
	          package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
898
   </target>
899
	
900
   	
901
   <target name="upgrade" depends="install"
902
          description="* Upgrade an existing metacat installation with a new version *">
903
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
904
   </target>
905
	
906
   <target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
907
   	 <ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
908
   	   	 <property name="context" value="${metacat.context}"/>
909
   	   	 <property name="target" value="${ecogrid-target-name}"/>
910
   	     <property name="metacat.dir" value="${metacat.dir}"/>
911
   	     <property name="hostname" value="localhost"/>
912
   	     <property name="port" value="${config.port}"/>
913
   	 </ant>
914
   </target>
915
	
916
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
917
      <delete file="${deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
918
   </target>
919

    
920
   <target name="install-registry" depends="init,getConversionXSL"
921
            description="Install Registry">
922

    
923
      <copy file="${srcdir}/perl/register-dataset.cgi"
924
            todir="${inst.cgi.dir}" filtering="yes"/>
925
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
926

    
927
      <mkdir dir="${temp-dir}" />
928
      <copy todir="${temp-dir}" filtering="yes">
929
       <fileset dir="lib/style/common/emlb6toeml2">
930
         <include name="*.xsl"/>
931
         <include name="*.xml"/>
932
       </fileset>
933
      </copy>
934

    
935
      <echo message="Install Registry completed." />
936
   </target>
937

    
938
   <target name="install-ldap" depends="init">
939
      <copy file="${srcdir}/perl/ldapweb.cgi"
940
            todir="${inst.cgi.dir}" filtering="yes"/>
941
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
942
      <copy file="lib/ldapweb.cfg"
943
            todir="${inst.cgi.dir}" filtering="yes"/>
944
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
945
      <mkdir dir="${templates.dir}" />
946
      <copy todir="${templates.dir}" filtering="yes">
947
        <fileset dir="lib/style/common/templates">
948
            <include name="${defaultChangePass}"/>
949
            <include name="${defaultResetPass}"/>
950
            <include name="${changePassSuccess}"/>
951
            <include name="${resetPassSuccess}"/>
952
            <include name="${registerFailed}"/>
953
            <include name="${registerLter}"/>
954
            <include name="${registerMatch}"/>
955
            <include name="${registerSuccess}"/>
956
            <include name="${register}"/>
957
            <include name="${searchResults}"/>
958
            <include name="${defaultHeader}"/>
959
            <include name="${defaultFooter}"/>
960
            <include name="${responseForm}"/>
961
        	<include name="${ldapMainServerFailure}"/>       	
962
        </fileset>
963
      </copy>
964
      <echo message="ldapweb install complete." />
965
   </target>
966

    
967

    
968
   <target name="install-skin" depends="init"
969
            description="Install a Skin">
970

    
971
      <input message="Please enter name of the skin"
972
             addproperty="skin-name"/>
973

    
974
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
975
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
976
       <fileset dir="lib/style/skins/${skin-name}">
977
           <exclude name="**/*.png"/>
978
           <exclude name="**/*.gif"/>
979
           <exclude name="**/*.jpg"/>
980
           <exclude name="**/CVS*"/>
981
           <exclude name="**/.#*"/>
982
       </fileset>
983
      </copy>
984
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
985
       <fileset dir="lib/style/skins/${skin-name}">
986
           <include name="**/*.png"/>
987
           <include name="**/*.gif"/>
988
           <include name="**/*.jpg"/>
989
           <exclude name="**/CVS*"/>
990
           <exclude name="**/.#*"/>
991
       </fileset>
992
      </copy>
993
      <copy todir="${installdir}/style/common" filtering="yes">
994
       <fileset dir="lib/style/common">
995
           <include name="*.js"/>
996
           <include name="*.jsp"/>
997
           <include name="*.css"/>
998
           <exclude name="*.png"/>
999
           <exclude name="*.gif"/>
1000
           <exclude name="*.jpg"/>
1001
           <exclude name="**/CVS*"/>
1002
           <exclude name="**/.#*"/>
1003
       </fileset>
1004
      </copy>
1005
      <!--
1006
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
1007
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
1008
       <fileset dir="lib/style/skins/${skin-name}/images">
1009
           <include name="*.png"/>
1010
           <include name="*.gif"/>
1011
           <include name="*.jpg"/>
1012
       </fileset>
1013
      </copy>
1014
      -->
1015

    
1016
      <echo message="Install Skin completed." />
1017
   </target>
1018

    
1019
   <target name="war" depends="warPrepare,warMSSQL,install-spatial"
1020
            description="Create a web archive (WAR) for servlet deployment">
1021
       <mkdir dir="${dist.dir}" />
1022
       <war destfile="${dist.dir}/${metacat.context}.war"
1023
            webxml="${build.war}/web.xml">
1024
         <fileset dir="${war.context}"/>
1025
         <lib dir="${war.lib}"/>
1026
         <webinf dir="${war.webinf}"/>
1027
       </war>
1028
   </target>
1029
	
1030
	
1031

    
1032
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
1033
            description="Prepare files for creating a web archive (WAR)">
1034

    
1035
       <property name="war.lib" value="${build.war}/lib" />
1036
       <property name="war.webinf" value="${build.war}/WEB-INF" />
1037
       <property name="war.context" value="${build.war}/${metacat.context}" />
1038
       <mkdir dir="${war.lib}" />
1039
       <mkdir dir="${war.webinf}" />
1040
       <mkdir dir="${war.context}" />
1041
       
1042
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
1043
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
1044
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
1045
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
1046
       <copy todir="${war.lib}" filtering="no">
1047
         <fileset dir="lib">
1048
            <not>
1049
               <filename name="${jdbc-jar-name}"/>
1050
            </not>
1051
            <include name="*.jar"/>
1052
         </fileset>
1053
         <fileset dir="lib">
1054
           <include name="xalan.jar"/>
1055
           <include name="gwt*.jar"/>
1056
         </fileset>
1057
       </copy>
1058
       <copy file="lib/web.xml.${tomcatversion}"
1059
             tofile="${build.war}/web.xml" />
1060
       <copy file="lib/metacat.properties" todir="${war.webinf}"
1061
             filtering="yes" />
1062
   	   <copy file="lib/metacat.properties.metadata" todir="${war.webinf}"
1063
   	             filtering="no" />
1064
       <copy todir="${war.webinf}" filtering="yes">
1065
	   	  <fileset dir="lib">
1066
           <include name="skin.configs/**"/>
1067
		  </fileset>
1068
	   </copy>
1069
       <copy file="lib/log4j.properties" todir="${war.webinf}"
1070
             filtering="yes" />
1071
       <copy todir="${war.context}" filtering="no">
1072
         <fileset dir="lib">
1073
           <include name="**/*.jpg"/>
1074
           <include name="**/*.png"/>
1075
           <include name="**/*.gif"/>
1076
           <include name="LiveMap_30/**"/>
1077
         </fileset>
1078
       </copy>
1079
       <copy todir="${war.context}" filtering="yes">
1080
         <fileset dir="lib">
1081
           <exclude name="*.jar"/>
1082
           <exclude name="*.properties"/>
1083
         	<exclude name="*.metadata"/>
1084
           <exclude name="web.xml"/>
1085
           <exclude name="**/*.jpg"/>
1086
           <exclude name="**/*.png"/>
1087
           <exclude name="**/*.gif"/>
1088
           <exclude name="lsid_lib/**"/>
1089
           <exclude name="lsid_conf/**"/>
1090
           <exclude name="LiveMap_30/**"/>
1091
           <exclude name="skin.configs/**"/>
1092
           <exclude name="spatial/geoserver/**"/>
1093
           <exclude name="spatial/WEB-INF/**"/>
1094
         </fileset>
1095
       </copy>
1096
   </target>
1097

    
1098
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1099
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1100
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1101
   </target>
1102

    
1103
   <target name="getConversionXSL" depends="prepare"
1104
            unless="styles.not.needed"
1105
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1106

    
1107
     <echo>Enter CVS password: </echo>
1108
     <cvs cvsRoot="${cvsroot}"
1109
          package="${eml-module}"
1110
          tag="${eml2_0_1-tag}"
1111
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
1112

    
1113
     <mkdir dir="lib/style/common/emlb6toeml2" />
1114
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1115
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
1116
         <include name="*.xsl"/>
1117
         <include name="*.xml"/>
1118
       </fileset>
1119
      </copy>
1120
   </target>
1121

    
1122
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1123
      <mkdir dir="${build.tests}"/>
1124
      <copy todir="${build.tests}" filtering="yes">
1125
        <fileset dir="${testdir}">
1126
          <include name="edu/**"/>
1127
        </fileset>
1128
      </copy>
1129
   	<copy todir="${build.tests}" file="lib/metacat.properties" filtering="yes">
1130
   	        
1131
   	 </copy>
1132
      <!-- copy and compile the tests into a jar file -->
1133
      <javac srcdir="${build.tests}"
1134
             destdir="${build.tests}"
1135
             debug="on"
1136
             includes="**/*.java">
1137
        <classpath>
1138
          <path refid="compile.classpath"/>
1139
          <fileset dir="${build.dir}">
1140
            <include name="${name}.jar"/>
1141
            <include name="${name}-client.jar"/>
1142
            <include name="harvester.jar"/>
1143
          </fileset>
1144
        </classpath>
1145
      </javac>
1146

    
1147
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1148
        basedir="${build.tests}"
1149
                includes="**/*.class" />
1150
   </target>
1151

    
1152
   <target name="test" depends="testprep"
1153
            description="Uses the ant junit task to run all JUnit tests">
1154

    
1155
      <!-- use the ant "junit" task to run JUnit tests. -->
1156
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1157
             haltonerror="no">
1158
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
1159
        <classpath>
1160
          <path refid="compile.classpath"/>
1161
          <fileset dir="${build.dir}">
1162
            <include name="${name}.jar"/>
1163
            <include name="${name}-client.jar"/>
1164
            <include name="harvester.jar"/>
1165
            <include name="${name}-junittests.jar"/>
1166
          </fileset>
1167
        </classpath>
1168

    
1169
        <formatter type="plain" />
1170

    
1171
        <batchtest fork="yes" todir="${build.dir}">
1172
          <fileset dir="${build.tests}">
1173
            <include name="**/*.class" />
1174
          </fileset>
1175
        </batchtest>
1176
     </junit>
1177
   </target>
1178

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

    
1182
              <echo>testtorun: ${testtorun}</echo>
1183

    
1184
      <!-- use the ant "junit" task to run JUnit tests. -->
1185
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1186
             haltonerror="no">
1187
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1188
        <classpath>
1189
          <path refid="compile.classpath"/>
1190
          <fileset dir="${build.dir}">
1191
            <include name="${name}.jar"/>
1192
            <include name="${name}-client.jar"/>
1193
            <include name="harvester.jar"/>
1194
            <include name="${name}-junittests.jar"/>
1195
          </fileset>
1196
        </classpath>
1197

    
1198
        <formatter type="plain" />
1199

    
1200
        <batchtest fork="yes" todir="${build.dir}">
1201
          <fileset dir="${build.tests}">
1202
            <include name="**/${testtorun}.class" />
1203
          </fileset>
1204
        </batchtest>
1205
     </junit>
1206
   </target>
1207

    
1208
   <target name="testharvester"
1209
           depends="testprep"
1210
           description="Uses the ant junit task to test only the Harvester code">
1211
     <junit printsummary="yes"
1212
            haltonfailure="off"
1213
            fork="yes"
1214
            haltonerror="off">
1215
        <classpath>
1216
          <path refid="compile.classpath"/>
1217
          <fileset dir="${build.dir}">
1218
            <include name="${name}.jar"/>
1219
            <include name="${name}-client.jar"/>
1220
            <include name="harvester.jar"/>
1221
            <include name="${name}-junittests.jar"/>
1222
          </fileset>
1223
        </classpath>
1224
       <formatter type="plain" />
1225
       <batchtest fork="yes" todir="${build.dir}">
1226
         <fileset dir="${build.tests}">
1227
           <include name="**/harvesterClient/*.class" />
1228
         </fileset>
1229
       </batchtest>
1230
     </junit>
1231
   </target>
1232

    
1233
  <target name="gethttpclient" depends="prepare"
1234
            description="checks out and compiles morpho httpclient code">
1235
  <!--mkdir dir="${morphosourcedir}" -->
1236
        <cvs cvsRoot="${cvsroot}"
1237
             package="morpho"
1238
             dest="." />
1239
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1240
   </target>
1241

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

    
1246
      <echo>***********************************
1247
      Please run ant gethttpclient first!
1248
      ***********************************
1249
      </echo>
1250
      <!-- copy and compile the tests into a jar file -->
1251
      <mkdir dir="${build.metacatnettest}"/>
1252
      <javac srcdir="${junitnettestsdir}"
1253
             destdir="${build.metacatnettest}"
1254
             includes="**/*.java">
1255
        <classpath>
1256
          <path refid="compile.classpath"/>
1257
          <fileset dir="${build.dir}">
1258
            <include name="${name}.jar"/>
1259
          </fileset>
1260
        </classpath>
1261
      </javac>
1262

    
1263
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1264
                    basedir="${build.metacatnettest}"
1265
                    includes="**/*.class" />
1266

    
1267
      <!-- use the ant "junit" task to run JUnit tests. -->
1268
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1269
             haltonerror="no">
1270
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1271
        <classpath>
1272
          <path refid="compile.classpath"/>
1273
          <fileset dir="${build.dir}">
1274
            <include name="${name}.jar"/>
1275
            <include name="${name}-junitnettests.jar"/>
1276
          </fileset>
1277
        </classpath>
1278

    
1279
        <formatter type="plain" />
1280

    
1281
        <batchtest fork="yes" todir="${build.dir}">
1282
          <fileset dir="${build.metacatnettest}">
1283
            <include name="**/*.class" />
1284
          </fileset>
1285
        </batchtest>
1286
     </junit>
1287
   </target>
1288

    
1289
   <target name="cleanweb" depends="clean"
1290
            description="deletes tomcat web context dir and all its contents">
1291
     <delete dir="${installdir}" />
1292
   </target>
1293

    
1294

    
1295
   <target name="clean" depends="init"
1296
            description="deletes build dir and files that can be regenerated form the release">
1297
       <delete dir="${build.dir}" />
1298
       <delete dir="${dist.dir}" />
1299
   </target>
1300

    
1301
   <target name="fullclean" depends="clean"
1302
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1303
       <delete file="lib/httpclient.jar" />
1304
       <delete file="lib/utilities.jar" />
1305
       <delete includeEmptyDirs="true" failonerror="false">
1306
         <fileset dir="${style-common-cvsrelpath}">
1307
           <include name="${eml-css}" />
1308
           <include name="eml-*/*.xsl" />
1309
           <include name="eml-*" />
1310
         </fileset>
1311
       </delete>
1312
   </target>
1313

    
1314
   <target name="jdoc" depends="prepare"
1315
            description="generates javadoc documentation">
1316
       <javadoc packagenames="edu.ucsb.nceas.*"
1317
           sourcepath="${build.src}"
1318
           destdir="${build.javadocs}"
1319
           author="true"
1320
           version="true"
1321
           use="true"
1322
           windowtitle="${Name} API"
1323
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1324
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1325
         <classpath>
1326
           <path refid="compile.classpath"/>
1327
         </classpath>
1328
       </javadoc>
1329
   </target>
1330

    
1331
   <target name="dist"
1332
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1333
            description="prepares a full release distribution">
1334
      <mkdir dir="${dist.dir}"/>
1335
      <delete dir="${ver.dir}" />
1336
      <mkdir dir="${ver.dir}"/>
1337
      <copy todir="${ver.dir}">
1338
        <fileset dir="."
1339
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1340
      </copy>
1341
      <copy todir="${ver.dir}" file="build.xml"/>
1342
      <copy todir="${ver.dir}" file="build.properties"/>
1343

    
1344
      <copy todir="${ver.dir}/docs" filtering="yes">
1345
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1346
      </copy>
1347
      <copy todir="${ver.dir}/docs" filtering="no">
1348
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1349
      </copy>
1350
      <copy todir="${ver.dir}/docs/dev">
1351
        <fileset dir="${build.dir}/docs"/>
1352
      </copy>
1353
      <copy todir="${ver.dir}/src">
1354
        <fileset dir="${build.dir}/src"/>
1355
      </copy>
1356
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1357
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1358
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1359
      <!--
1360
      <delete dir="./${ver.dir}/${build.dir}"/>
1361
      <delete dir="./${ver.dir}/dist"/>
1362
      -->
1363
      <delete file="./${name}-${release}.zip"/>
1364
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1365
      <delete file="./${name}-${release}.tar.gz" />
1366
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1367
      <gzip zipfile="./${name}-${release}.tar.gz"
1368
                src="./${name}-${release}.tar"/>
1369
      <delete file="./${name}-${release}.tar" />
1370
  </target>
1371

    
1372
  <target name="distsrc" depends="dist"
1373
            description="prepares a source distribution">
1374
      <mkdir dir="${ver.src}"/>
1375
      <copy todir="${ver.src}">
1376
        <fileset dir="./src"/>
1377
      </copy>
1378
      <mkdir dir="${util.dir}"/>
1379
      <copy todir="${util.dir}">
1380
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1381
      </copy>
1382
  	  
1383
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1384
  	  <copy todir="${ecogrid-dist-dir}">
1385
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1386
  	  </copy>
1387

    
1388
      <delete file="${ver.dir}/lib/utilities.jar"/>
1389

    
1390
      <delete file="./${name}-src-${release}.zip"/>
1391
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1392
      <delete file="./${name}-src-${release}.tar.gz" />
1393
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1394
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1395
                src="./${name}-src-${release}.tar"/>
1396
      <delete file="./${name}-src-${release}.tar" />
1397
      <delete dir="${dist.dir}"/> 
1398
  </target>
1399

    
1400
   <target name="stylesheettest">
1401
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1402
      <param name="displaymodule" expression="${displaymodule}"/>
1403
      <param name="docid" expression="${input}"/>
1404
      <param name="entitytype" expression="${entitytype}"/>
1405
      <param name="entityindex" expression="${entityindex}"/>
1406
      <outputproperty name="method" value="html"/>
1407
      <outputproperty name="standalone" value="yes"/>
1408
      <outputproperty name="encoding" value="iso8859_1"/>
1409
      <outputproperty name="indent" value="yes"/>
1410
    </xslt>
1411
  </target>
1412

    
1413
 
1414
  <target name="compilewebclient" depends="prepare">
1415
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1416
  </target>
1417

    
1418
  <target name="runwebclient" depends="compilewebclient">
1419
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1420
           dir="${build.dest}" fork="yes"
1421
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1422
         <arg value="${serviceUrl}"/>
1423
         <arg value="${docid}"/>
1424
     </java>
1425
  </target>
1426
  
1427
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1428

    
1429
    <echo message="Compiling the metatcat shapefile creator"/>
1430
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1431
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1432
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1433
    </exec>
1434
  
1435
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1436
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1437
    </exec>
1438
  </target>
1439

    
1440
    <!-- LSID Authority support -->
1441
    <patternset id="lsid.jars">
1442
        <include name="axis.jar" />
1443
        <include name="commons-discovery-0.2.jar" />
1444
        <include name="jaxrpc.jar" />
1445
        <include name="lsid-client-1.1.1.jar" />
1446
        <include name="lsid-server-1.1.1.jar" />
1447
        <include name="saaj.jar" />
1448
        <include name="wsdl4j-1.5.1.jar" />
1449
        <include name="activation.jar" />
1450
        <include name="castor-0.9.5.jar" />
1451
        <include name="dnsjava-1.3.2.jar" />
1452
        <include name="mail.jar" />
1453
        <include name="commons-logging-1.0.4.jar" />
1454
        <!-- These jars may be needed but seem to not actually be,
1455
             so leaving them out for now
1456
        <include name="axis-ant.jar" />
1457
        -->
1458
        <!--<include name="GenCastor.class" />-->
1459
    </patternset>
1460
    <patternset id="lib.jars">
1461
        <include name="httpclient.jar" />
1462
        <include name="log4j-1.2.12.jar" />
1463
        <include name="utilities.jar" />
1464
        <include name="xercesImpl.jar" />
1465
        <include name="xalan.jar" />
1466
        <include name="xml-apis.jar" />
1467
    </patternset>
1468

    
1469
    <path id="lsid.classpath">
1470
        <fileset dir="${lsid.lib.dir}">
1471
            <patternset refid="lsid.jars"/>
1472
        </fileset>
1473
        <fileset dir="${lib.dir}">
1474
            <patternset refid="lsid.jars"/>
1475
        </fileset>
1476
        <fileset dir="${lib.dir}">
1477
            <include name="xalan.jar" />
1478
            <include name="xml-apis.jar" />
1479
        </fileset>
1480
        <fileset dir="${build.dir}">
1481
            <include name="metacat-client.jar" />
1482
        </fileset>
1483
    </path>
1484

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