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-07-31 16:06:16 -0700 (Tue, 31 Jul 2007) $'
11
  *    '$Revision: 3335 $'
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
   </target>
85

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

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

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

    
136
      <property name="debug" value="on" />
137
      <property name="debuglevel" value="55" />
138

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

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

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

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

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

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

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

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

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

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

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

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

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

    
395
   </target>
396

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
601

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

    
607
   </target>
608

    
609

    
610

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

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

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

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

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

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

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

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

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

    
728
   </target>
729

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

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

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

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

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

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

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

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

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

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

    
856
    </target>
857

    
858

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

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

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

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

    
933
      <echo message="Install Registry completed." />
934
   </target>
935

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

    
965

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

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

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

    
1014
      <echo message="Install Skin completed." />
1015
   </target>
1016

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

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

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

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

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

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

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

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

    
1142
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1143
        basedir="${build.tests}"
1144
                includes="**/*.class" />
1145
   </target>
1146

    
1147
   <target name="test" depends="testprep"
1148
            description="Uses the ant junit task to run all JUnit tests">
1149

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

    
1164
        <formatter type="plain" />
1165

    
1166
        <batchtest fork="yes" todir="${build.dir}">
1167
          <fileset dir="${build.tests}">
1168
            <include name="**/*.class" />
1169
          </fileset>
1170
        </batchtest>
1171
     </junit>
1172
   </target>
1173

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

    
1177
              <echo>testtorun: ${testtorun}</echo>
1178

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

    
1193
        <formatter type="plain" />
1194

    
1195
        <batchtest fork="yes" todir="${build.dir}">
1196
          <fileset dir="${build.tests}">
1197
            <include name="**/${testtorun}.class" />
1198
          </fileset>
1199
        </batchtest>
1200
     </junit>
1201
   </target>
1202

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

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

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

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

    
1258
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1259
                    basedir="${build.metacatnettest}"
1260
                    includes="**/*.class" />
1261

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

    
1274
        <formatter type="plain" />
1275

    
1276
        <batchtest fork="yes" todir="${build.dir}">
1277
          <fileset dir="${build.metacatnettest}">
1278
            <include name="**/*.class" />
1279
          </fileset>
1280
        </batchtest>
1281
     </junit>
1282
   </target>
1283

    
1284
   <target name="cleanweb" depends="clean"
1285
            description="deletes tomcat web context dir and all its contents">
1286
     <delete dir="${installdir}" />
1287
   </target>
1288

    
1289

    
1290
   <target name="clean" depends="init"
1291
            description="deletes build dir and files that can be regenerated form the release">
1292
       <delete dir="${build.dir}" />
1293
       <delete dir="${dist.dir}" />
1294
   </target>
1295

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

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

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

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

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

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

    
1385
      <delete file="./${name}-src-${release}.zip"/>
1386
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1387
      <delete file="./${name}-src-${release}.tar.gz" />
1388
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1389
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1390
                src="./${name}-src-${release}.tar"/>
1391
      <delete file="./${name}-src-${release}.tar" />
1392
      <delete dir="${dist.dir}"/> 
1393
  </target>
1394

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

    
1408
 
1409
  <target name="compilewebclient" depends="prepare">
1410
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1411
  </target>
1412

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

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

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

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

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