Project

General

Profile

metacat / build.xml @ 3807

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: 2008-04-25 16:07:49 -0700 (Fri, 25 Apr 2008) $'
11
  *    '$Revision: 3807 $'
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.8-sql"
85
                                    value="upgrade-db-to-1.8.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.8-sql"
113
                          value="upgrade-db-to-1.8-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=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
136
      <property name="mcanotherpassword" value="yourpass"/>
137
              <property name="piscouser" value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org"/>
138
              <property name="piscopassword" value="yourpass"/>
139
              <property name="lteruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
140
              <property name="lterpassword" value="yourpass"/>
141

    
142
      <property name="debug" value="on" />
143
      <property name="debuglevel" value="55" />
144

    
145
      <property name="morphosourcedir" value="../morpho" />
146
      <property name="defaultcontenttype" value="application/octet-stream" />
147
      <property name="utilitiesdir" value="../utilities" />
148

    
149
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
150
      <echo>*********** set jsdk to ${jsdk}</echo>
151
  </target>
152

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

    
173
        <!-- Include geoserver, geotools, et. al. -->
174
        <fileset dir="lib/spatial/geoserver/WEB-INF/lib">
175
          <include name="*.jar"/>
176
        </fileset>
177
        <pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
178

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

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

    
250
      <filter token="scope"                value="${scope}"/>
251
      <filter token="responseForm"         value="${responseForm}"/>
252
      <filter token="entryForm"            value="${entryForm}"/>
253
      <filter token="guide"                value="${guide}"/>
254
      <filter token="loginForm"            value="${loginForm}"/>
255
      <filter token="confirmData"          value="${confirmData}"/>
256
      <filter token="deleteData"           value="${deleteData}"/>
257
      <filter token="genericHeader"        value="${genericHeader}"/>
258
      <filter token="genericFooter"        value="${genericFooter}"/>
259
      <filter token="adminname"            value="${adminname}"/>
260
      <filter token="recipient"            value="${recipient}"/>
261

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

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

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

    
327
      <filter token="defaultStage" value="${defaultStage}"/>
328
      <filter token="defaultHeader" value="${defaultHeader}"/>
329
      <filter token="defaultFooter" value="${defaultFooter}"/>
330
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
331
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
332
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
333
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
334
      <filter token="registerFailed" value="${registerFailed}"/>
335
      <filter token="registerLter" value="${registerLter}"/>
336
      <filter token="registerMatch" value="${registerMatch}"/>
337
      <filter token="registerSuccess" value="${registerSuccess}"/>
338
      <filter token="register" value="${register}"/>
339
      <filter token="searchResults" value="${searchResults}"/>
340
             <filter token="ldapMainServerFailure" value="${ldapMainServerFailure}"/>
341
             <filter token="lter-user" value="${lteruser}"/>
342
             <filter token="lter-pass" value="${lterpassword}"/>
343
      <filter token="pisco-user" value="${piscouser}"/>
344
      <filter token="pisco-pass" value="${piscopassword}"/>
345
              
346
       
347
             <filter token="timedreplication" value="${timedreplication}" />
348
             <filter token="firsttimedreplication" value="${firsttimedreplication}" />
349
             <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
350
      
351
             <property name="srcdir" value="./src" />
352
             <property name="lib.dir" value="./lib" />
353
      <property name="testdir" value="./test" />
354
      <property name="testtorun" value="BuildIndexTest" />
355
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
356
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
357
      <property name="build.dir" value="./build"/>
358
      <property name="build.src" value="${build.dir}/src"/>
359
      <property name="build.dest" value="${build.dir}/classes"/>
360
      <property name="build.docs" value="${build.dir}/docs"/>
361
      <property name="build.samples" value="${build.dir}/samples"/>
362
      <property name="build.tests" value="${build.dir}/tests"/>
363
      <property name="build.tmp" value="${build.dir}/tmp"/>
364
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
365
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
366
      <property name="build.data" value="${build.dir}/data"/>
367
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
368
      <property name="build.war" value="${build.dir}/war"/>
369

    
370
      <property name="dist.dir" value="dist"/>
371
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
372
      <property name="ver.src" value="${ver.dir}/src"/>
373
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
374
          <!-- directories for creating a Harvest List Editor distribution -->
375
      <property name="dist.dir.hle" value="disthle"/>
376
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
377
             
378
             
379
             <property name="ecogrid-target-name" value="metacatImpl"/>
380
             <property name="ecogrid-module-dest-dir" value =".."/>
381
             <property name="ecogrid-module" value="seek/projects/ecogrid"/>
382
             <property name="ecogrid-dist-dir" value="${dist.dir}/${ecogrid-module}"/>
383
             <property name="ecogrid-dir" value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
384

    
385
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
386
      <condition property="utilities.required">
387
        <or>
388
          <not><available file="lib/httpclient.jar"/></not>
389
          <not><available file="lib/utilities.jar"/></not>
390
        </or>
391
      </condition>
392
      <condition property="eml.required">
393
        <or>
394
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
395
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
396
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
397
        </or>
398
      </condition>
399
             
400
      <condition property="ecogrid.required">
401
                 <or>
402
             <not><available file="${ecogrid-dir}/build.properties"/></not>
403
             <not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
404
           </or>
405
      </condition>
406

    
407
   </target>
408

    
409
   <target name="prepare" depends="init">
410
      <mkdir dir="${build.dir}"/>
411
      <mkdir dir="${build.src}"/>
412
      <mkdir dir="${build.dest}"/>
413
      <mkdir dir="${build.javadocs}"/>
414
      <mkdir dir="${build.tmp}"/>
415

    
416
      <copy todir="${build.src}" filtering="yes">
417
        <fileset dir="${srcdir}">
418
          <include name="edu/**"/>
419
          <include name="com/**"/>
420
          <include name="org/**"/>
421
          <include name="**/*.sql"/>
422
          <exclude name="**/CVS*"/>
423
          <exclude name="**/.#*"/>
424
        </fileset>
425
      </copy>
426
      <available file="lib/style/common/emlb6toeml2" type="dir"
427
                 property="styles.not.needed"/>
428
   </target>
429

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

    
433
       <javac srcdir="${build.src}"
434
              destdir="${build.dest}"
435
              debug="${debug}"
436
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
437
        <classpath>
438
          <path refid="compile.classpath"/>
439
        </classpath>
440
      </javac>
441
   </target>
442

    
443
   <target name="jar" depends="compile,geteml"
444
    description="Compiles and jars metacat java code to metacat.jar in build dir">
445

    
446
       <delete file="${build.dir}/${name}.jar" />
447
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
448
            excludes="**/protocols/ **/harvesterClient/" />
449
   </target>
450

    
451
   <target name="protocol" depends="compile"
452
    description="Compiles and jars protocol java code to protocol.jar in build dir">
453
       <delete file="${build.dir}/protocol.jar" />
454
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
455
            includes="**/protocols/" />
456
   </target>
457

    
458
   <target name="utilities" depends="config" if="utilities.required">
459
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
460
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
461
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
462
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
463
   </target>
464

    
465
   <target name="getutilities" depends="prepare"
466
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
467
     <echo>Enter CVS password: </echo>
468
     <cvs cvsRoot="${cvsroot}"
469
          package="${util-module}"
470
          dest="${build.tmp}" />
471
   </target>
472

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

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

    
491
    <target name="advancedsearchjar" depends="compile"
492
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
493
        <delete file="${build.dir}/advancedsearch.jar" />
494
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
495
             includes="**/metacat/advancedsearch/" />
496
    </target>
497

    
498
   <target name="harvester" depends="client"
499
           description="Compiles harvester java code to build dir">
500
       <javac srcdir="${build.src}"
501
              destdir="${build.dest}"
502
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
503
          <classpath>
504
            <path refid="compile.classpath"/>
505
          </classpath>
506
        </javac>
507
   </target>
508

    
509
   <target name="harvesterjar" depends="harvester"
510
           description="Compiles and jars harvester java code to harvester.jar in build dir">
511
       <delete file="${build.dir}/harvester.jar" />
512
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
513
            includes="**/metacat/harvesterClient/" />
514
   </target>
515

    
516
   <target name="harvestListEditorDist" depends="harvesterjar"
517
           description="Prepares a distribution of the Harvest List Editor tool">
518
       <mkdir dir="${dist.dir.hle}"/>
519
       <delete dir="${ver.dir.hle}" />
520
       <mkdir dir="${ver.dir.hle}"/>
521
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
522
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
523
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
524
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
525
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
526
       <delete file="./harvest-list-editor-${release}.zip"/>
527
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
528
       <delete file="./harvest-list-editor-${release}.tar.gz" />
529
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
530
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
531
             src="./harvest-list-editor-${release}.tar"/>
532
       <delete file="./harvest-list-editor-${release}.tar" />
533
   </target>
534

    
535
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
536
            description="Calls getemlpre2 and geteml2+ targets" />
537

    
538
   <target name="getemlpre2" depends="prepare" if="eml.required"
539
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
540
     <echo>Enter CVS password: </echo>
541
     <cvs cvsRoot="${cvsroot}"
542
          package="${eml-module}"
543
          tag="${eml-tag}"
544
          dest="${build.tmp}/eml_${eml-tag}" />
545
     <mkdir dir="lib/dtd" />
546
     <copy todir="lib/dtd" filtering="yes">
547
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
548
         <include name="*.dtd"/>
549
       </fileset>
550
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
551
     </copy>
552

    
553
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
554
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
555
       <include name="**/*.xsl"/>
556
     </fileset>
557
     </copy>
558
   </target>
559

    
560
   <target name="geteml2+" depends="prepare" if="eml.required"
561
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
562
     <echo>Enter CVS password: </echo>
563
     <cvs cvsRoot="${cvsroot}"
564
          package="${eml-module}"
565
          tag="${eml2_0_0-tag}"
566
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
567
     <mkdir dir="lib/schema/eml-2.0.0" />
568
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
569
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
570
         <include name="*.xsd"/>
571
       </fileset>
572

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

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

    
579
     </copy>
580
     <!-- <antcall target="copyxsl">
581
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
582
        <param name="dirname" value="eml-2.0.0" />
583
     </antcall> -->
584
           
585
           <!-- Checkout eml201 for given schema tag-->
586
     <echo>Enter CVS password: </echo>
587
     <cvs cvsRoot="${cvsroot}"
588
          package="${eml-module}"
589
          tag="${eml2_0_1-schema-tag}"
590
          dest="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
591
     <mkdir dir="lib/schema/eml-2.0.1" />
592
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
593
       <fileset dir="${build.tmp}/eml_${eml2_0_1-schema-tag}/${eml-module}">
594
         <include name="*.xsd"/>
595
       </fileset>
596
     </copy>
597
           
598
           <!-- Checkout eml201 again for given style sheet tag-->
599
           <echo>Enter CVS password: </echo>
600
                <cvs cvsRoot="${cvsroot}"
601
                     package="${eml-module}"
602
                     tag="${eml2_0_1-style-tag}"
603
                     dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
604
     <antcall target="copyxsl">
605
        <param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
606
        <param name="dirname" value="eml-2.0.1" />
607
     </antcall>
608
   </target>
609

    
610
   <target  name="copyxsl"
611
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
612
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
613

    
614
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
615
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
616
       <include name="**/*.xsl"/>
617
     </fileset>
618
     </copy>
619

    
620

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

    
626
   </target>
627

    
628

    
629

    
630
   <target name="register-schemas" depends="prepare"
631
   description="Registers the Schemas with a new Metacat instance">
632
     <echo/>
633
     <echo>Registering the Schemas with the new Metacat instance...</echo>
634
     <sql driver="${dbDriver}"
635
          url="${jdbc-connect}"
636
          userid="${user}"
637
          password="${password}"
638
          src="${build.src}/loaddtdschema.sql">
639
       <classpath>
640
         <path refid="compile.classpath"/>
641
       </classpath>
642
     </sql>
643
   </target>
644

    
645
   <target name="installdb" depends="prepare"
646
            description="Installs the database tables">
647
     <echo/>
648
     <echo>Installing 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}/${install-sql}">
656
       <classpath>
657
         <path refid="compile.classpath"/>
658
       </classpath>
659
     </sql>
660
   </target>
661

    
662
   <target name="dropdb" depends="prepare"
663
            description="WARNING: Drops the database tables">
664
     <echo/>
665
     <echo>Dropping the database tables...</echo>
666
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
667
     <echo/>
668
     <sql driver="${dbDriver}"
669
          url="${jdbc-connect}"
670
          userid="${user}"
671
          password="${password}"
672
          src="${build.src}/drop-postgres.sql">
673
       <classpath>
674
         <path refid="compile.classpath"/>
675
       </classpath>
676
     </sql>
677
   </target>
678

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

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

    
709
   <target name="upgrade14" depends="prepare"
710
            description="Updates the database tables to upgrade to version 1.4">
711
     <echo/>
712
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
713
     <sql driver="${dbDriver}"
714
          url="${jdbc-connect}"
715
          userid="${user}"
716
          password="${password}"
717
          src="${build.src}/${upgrade-1.4-sql}">
718
       <classpath>
719
         <path refid="compile.classpath"/>
720
       </classpath>
721
     </sql>
722
   </target>
723

    
724
   <target name="upgrade15" depends="sqlupgrade15"
725
           description="Updates the database tables to upgrade to version 1.5">
726
     <echo/>
727
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
728
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
729
           todir="${build.tmp}" filtering="yes"/>
730

    
731
     <javac srcdir="${build.tmp}"
732
            destdir="${build.tmp}"
733
            debug="${debug}"
734
            includes="upgrade_db_to_1_5.java">
735
       <classpath>
736
         <path refid="compile.classpath"/>
737
       </classpath>
738
     </javac>
739

    
740
     <java classname="upgrade_db_to_1_5">
741
       <classpath>
742
         <path refid="compile.classpath"/>
743
         <fileset dir="${build.tmp}"/>
744
       </classpath>
745
     </java>
746

    
747
   </target>
748

    
749
   <target name="upgrade16" depends="prepare"
750
            description="Updates the database tables from version 1.5 to version 1.6">
751
     <echo/>
752
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
753
     <sql driver="${dbDriver}"
754
          url="${jdbc-connect}"
755
          userid="${user}"
756
          password="${password}"
757
          src="${build.src}/${upgrade-1.6-sql}">
758
       <classpath>
759
         <path refid="compile.classpath"/>
760
       </classpath>
761
     </sql>
762
   </target>
763

    
764
   <target name="upgrade17" depends="prepare"
765
            description="Updates the database tables from version 1.6 to version 1.7">
766
     <echo/>
767
     <echo>Updating the database tables to upgrade to version 1.7...</echo>
768
     <sql driver="${dbDriver}"
769
          url="${jdbc-connect}"
770
          userid="${user}"
771
          password="${password}"
772
          src="${build.src}/${upgrade-1.7-sql}">
773
       <classpath>
774
         <path refid="compile.classpath"/>
775
       </classpath>
776
     </sql>
777
   </target>
778
        
779
   <target name="upgrade18" depends="prepare"
780
                    description="Updates the database tables from version 1.7 to version 1.8">
781
             <echo/>
782
             <echo>Updating the database tables to upgrade to version 1.8...</echo>
783
             <sql driver="${dbDriver}"
784
                  url="${jdbc-connect}"
785
                  userid="${user}"
786
                  password="${password}"
787
                  src="${build.src}/${upgrade-1.8-sql}">
788
               <classpath>
789
                 <path refid="compile.classpath"/>
790
               </classpath>
791
             </sql>
792
   </target>
793

    
794
   <target name="sqlupgrade15" depends="prepare">
795
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
796
      <sql driver="${dbDriver}"
797
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
798
          url="${jdbc-connect}"
799
          userid="${user}"
800
          password="${password}"
801
          src="${build.src}/${upgrade-1.5-sql}" />
802
      <sql driver="${dbDriver}"
803
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
804
          url="${jdbc-connect}"
805
          userid="${user}"
806
          password="${password}"
807
          rdbms="oracle"
808
          delimiter="/">
809
        <transaction>
810
           CREATE TRIGGER xml_returnfield_before_insert
811
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
812
           BEGIN
813
              SELECT xml_returnfield_id_seq.nextval
814
                 INTO :new.returnfield_id
815
                 FROM dual;
816
           END;
817
           /
818
        </transaction>
819
        <transaction>
820
           CREATE TRIGGER xml_queryresult_before_insert
821
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
822
           BEGIN
823
              SELECT xml_queryresult_id_seq.nextval
824
              INTO :new.queryresult_id
825
              FROM dual;
826
           END;
827
           /
828
        </transaction>
829
      </sql>
830
   </target>
831

    
832
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
833
           description="Installs spatial option for metacat">
834

    
835
      <property name="spatial.dir" value="./lib/spatial"/>
836
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
837
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
838

    
839
      <!-- Copy geoserver libs into ${war.lib} -->
840
      <copy todir="${war.lib}" filtering="no">
841
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
842
          <include name="**"/>
843
        </fileset>
844
      </copy>
845

    
846
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
847
      <copy todir="${war.webinf}" filtering="no">
848
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
849
          <exclude name="lib/**"/>
850
          <exclude name="web.xml"/>
851
        </fileset>
852
      </copy>
853

    
854
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
855
      <copy todir="${war.context}" filtering="no">
856
        <fileset dir="${spatial.geoserver.dir}">
857
          <exclude name="WEB-INF/**"/>
858
          <exclude name="index.jsp"/>
859
        </fileset>
860
      </copy>
861

    
862
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
863
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
864
          tofile="${war.context}/geoserver.jsp"
865
          overwrite="true"
866
          filtering="no"/>
867

    
868
      <!-- Copy the rest of the modified geoserver web-inf files
869
      <copy todir="${war.webinf}" filtering="no">
870
        <fileset dir="${spatial.webinf-mods}">
871
          <exclude name="web.xml.combined"/>
872
        </fileset>
873
      </copy> -->
874

    
875
    </target>
876

    
877

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

    
937
   <target name="install-registry" depends="init,getConversionXSL"
938
            description="Install Registry">
939

    
940
      <copy file="${srcdir}/perl/register-dataset.cgi"
941
            todir="${inst.cgi.dir}" filtering="yes"/>
942
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
943

    
944
      <mkdir dir="${temp-dir}" />
945
      <copy todir="${temp-dir}" filtering="yes">
946
       <fileset dir="lib/style/common/emlb6toeml2">
947
         <include name="*.xsl"/>
948
         <include name="*.xml"/>
949
       </fileset>
950
      </copy>
951

    
952
      <echo message="Install Registry completed." />
953
   </target>
954

    
955
   <target name="install-ldap" depends="init">
956
      <copy file="${srcdir}/perl/ldapweb.cgi"
957
            todir="${inst.cgi.dir}" filtering="yes"/>
958
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
959
      <copy file="lib/ldapweb.cfg"
960
            todir="${inst.cgi.dir}" filtering="yes"/>
961
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
962
      <mkdir dir="${templates.dir}" />
963
      <copy todir="${templates.dir}" filtering="yes">
964
        <fileset dir="lib/style/common/templates">
965
            <include name="${defaultChangePass}"/>
966
            <include name="${defaultResetPass}"/>
967
            <include name="${changePassSuccess}"/>
968
            <include name="${resetPassSuccess}"/>
969
            <include name="${registerFailed}"/>
970
            <include name="${registerLter}"/>
971
            <include name="${registerMatch}"/>
972
            <include name="${registerSuccess}"/>
973
            <include name="${register}"/>
974
            <include name="${searchResults}"/>
975
            <include name="${defaultHeader}"/>
976
            <include name="${defaultFooter}"/>
977
            <include name="${responseForm}"/>
978
                <include name="${ldapMainServerFailure}"/>               
979
        </fileset>
980
      </copy>
981
      <echo message="ldapweb install complete." />
982
   </target>
983

    
984

    
985
   <target name="install-skin" depends="init"
986
            description="Install a Skin">
987

    
988
      <input message="Please enter name of the skin"
989
             addproperty="skin-name"/>
990

    
991
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
992
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
993
       <fileset dir="lib/style/skins/${skin-name}">
994
           <exclude name="**/*.png"/>
995
           <exclude name="**/*.gif"/>
996
           <exclude name="**/*.jpg"/>
997
           <exclude name="**/CVS*"/>
998
           <exclude name="**/.#*"/>
999
       </fileset>
1000
      </copy>
1001
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
1002
       <fileset dir="lib/style/skins/${skin-name}">
1003
           <include name="**/*.png"/>
1004
           <include name="**/*.gif"/>
1005
           <include name="**/*.jpg"/>
1006
           <exclude name="**/CVS*"/>
1007
           <exclude name="**/.#*"/>
1008
       </fileset>
1009
      </copy>
1010
      <copy todir="${installdir}/style/common" filtering="yes">
1011
       <fileset dir="lib/style/common">
1012
           <include name="*.js"/>
1013
           <include name="*.jsp"/>
1014
           <include name="*.css"/>
1015
           <exclude name="*.png"/>
1016
           <exclude name="*.gif"/>
1017
           <exclude name="*.jpg"/>
1018
           <exclude name="**/CVS*"/>
1019
           <exclude name="**/.#*"/>
1020
       </fileset>
1021
      </copy>
1022
      <!--
1023
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
1024
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
1025
       <fileset dir="lib/style/skins/${skin-name}/images">
1026
           <include name="*.png"/>
1027
           <include name="*.gif"/>
1028
           <include name="*.jpg"/>
1029
       </fileset>
1030
      </copy>
1031
      -->
1032

    
1033
      <echo message="Install Skin completed." />
1034
   </target>
1035

    
1036
   <target name="war" depends="warPrepare,warMSSQL,install-spatial"
1037
            description="Create a web archive (WAR) for servlet deployment">
1038
       <mkdir dir="${dist.dir}" />
1039
       <war destfile="${dist.dir}/${metacat.context}.war"
1040
            webxml="${build.war}/web.xml">
1041
         <fileset dir="${war.context}"/>
1042
         <lib dir="${war.lib}"/>
1043
         <webinf dir="${war.webinf}"/>
1044
       </war>
1045
   </target>
1046
        
1047
        
1048

    
1049
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
1050
            description="Prepare files for creating a web archive (WAR)">
1051

    
1052
       <property name="war.lib" value="${build.war}/lib" />
1053
       <property name="war.webinf" value="${build.war}/WEB-INF" />
1054
       <property name="war.context" value="${build.war}/${metacat.context}" />
1055
       <mkdir dir="${war.lib}" />
1056
       <mkdir dir="${war.webinf}" />
1057
       <mkdir dir="${war.context}" />
1058
       
1059
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
1060
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
1061
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
1062
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
1063
       <copy todir="${war.lib}" filtering="no">
1064
         <fileset dir="lib">
1065
            <not>
1066
               <filename name="${jdbc-jar-name}"/>
1067
            </not>
1068
            <include name="*.jar"/>
1069
         </fileset>
1070
         <fileset dir="lib">
1071
           <include name="xalan.jar"/>
1072
           <include name="gwt*.jar"/>
1073
         </fileset>
1074
       </copy>
1075
       <copy file="lib/web.xml.${tomcatversion}"
1076
             tofile="${build.war}/web.xml" />
1077
       <copy file="lib/metacat.properties" todir="${war.webinf}"
1078
             filtering="yes" />
1079
              <copy file="lib/metacat.properties.metadata" todir="${war.webinf}"
1080
                        filtering="no" />
1081
       <copy todir="${war.webinf}" filtering="yes">
1082
                     <fileset dir="lib">
1083
           <include name="skin.configs/**"/>
1084
                  </fileset>
1085
           </copy>
1086
       <copy file="lib/log4j.properties" todir="${war.webinf}"
1087
             filtering="yes" />
1088
       <copy todir="${war.context}" filtering="no">
1089
         <fileset dir="lib">
1090
           <include name="**/*.jpg"/>
1091
           <include name="**/*.png"/>
1092
           <include name="**/*.gif"/>
1093
           <include name="LiveMap_30/**"/>
1094
         </fileset>
1095
       </copy>
1096
       <copy todir="${war.context}" filtering="yes">
1097
         <fileset dir="lib">
1098
           <exclude name="*.jar"/>
1099
           <exclude name="*.properties"/>
1100
                 <exclude name="*.metadata"/>
1101
           <exclude name="web.xml"/>
1102
           <exclude name="**/*.jpg"/>
1103
           <exclude name="**/*.png"/>
1104
           <exclude name="**/*.gif"/>
1105
           <exclude name="lsid_lib/**"/>
1106
           <exclude name="lsid_conf/**"/>
1107
           <exclude name="LiveMap_30/**"/>
1108
           <exclude name="skin.configs/**"/>
1109
           <exclude name="spatial/geoserver/**"/>
1110
           <exclude name="spatial/WEB-INF/**"/>
1111
         </fileset>
1112
       </copy>
1113
   </target>
1114

    
1115
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1116
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1117
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1118
   </target>
1119

    
1120
   <target name="getConversionXSL" depends="prepare"
1121
            unless="styles.not.needed"
1122
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1123

    
1124
     <echo>Enter CVS password: </echo>
1125
     <cvs cvsRoot="${cvsroot}"
1126
          package="${eml-module}"
1127
          tag="${eml2_0_1-tag}"
1128
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
1129

    
1130
     <mkdir dir="lib/style/common/emlb6toeml2" />
1131
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1132
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
1133
         <include name="*.xsl"/>
1134
         <include name="*.xml"/>
1135
       </fileset>
1136
      </copy>
1137
   </target>
1138

    
1139
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1140
      <mkdir dir="${build.tests}"/>
1141
      <copy todir="${build.tests}" filtering="yes">
1142
        <fileset dir="${testdir}">
1143
          <include name="edu/**"/>
1144
        </fileset>
1145
      </copy>
1146
           <copy todir="${build.tests}" file="lib/metacat.properties" filtering="yes">
1147
                   
1148
            </copy>
1149
      <!-- copy and compile the tests into a jar file -->
1150
      <javac srcdir="${build.tests}"
1151
             destdir="${build.tests}"
1152
             debug="on"
1153
             includes="**/*.java">
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
          </fileset>
1161
        </classpath>
1162
      </javac>
1163

    
1164
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1165
        basedir="${build.tests}"
1166
                includes="**/*.class" />
1167
   </target>
1168

    
1169
   <target name="test" depends="testprep"
1170
            description="Uses the ant junit task to run all JUnit tests">
1171

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

    
1186
        <formatter type="plain" />
1187

    
1188
        <batchtest fork="yes" todir="${build.dir}">
1189
          <fileset dir="${build.tests}">
1190
            <include name="**/*.class" />
1191
          </fileset>
1192
        </batchtest>
1193
     </junit>
1194
   </target>
1195

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

    
1199
              <echo>testtorun: ${testtorun}</echo>
1200

    
1201
      <!-- use the ant "junit" task to run JUnit tests. -->
1202
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1203
             haltonerror="no" showoutput="yes">
1204
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1205
        <classpath>
1206
          <path refid="compile.classpath"/>
1207
          <fileset dir="${build.dir}">
1208
            <include name="${name}.jar"/>
1209
            <include name="${name}-client.jar"/>
1210
            <include name="harvester.jar"/>
1211
            <include name="${name}-junittests.jar"/>
1212
          </fileset>
1213
        </classpath>
1214

    
1215
        <formatter type="plain" />
1216

    
1217
        <batchtest fork="yes" todir="${build.dir}">
1218
          <fileset dir="${build.tests}">
1219
            <include name="**/${testtorun}.class" />
1220
          </fileset>
1221
        </batchtest>
1222
     </junit>
1223
   </target>
1224

    
1225
   <target name="testharvester"
1226
           depends="testprep"
1227
           description="Uses the ant junit task to test only the Harvester code">
1228
     <junit printsummary="yes"
1229
            haltonfailure="off"
1230
            fork="yes"
1231
            haltonerror="off">
1232
        <classpath>
1233
          <path refid="compile.classpath"/>
1234
          <fileset dir="${build.dir}">
1235
            <include name="${name}.jar"/>
1236
            <include name="${name}-client.jar"/>
1237
            <include name="harvester.jar"/>
1238
            <include name="${name}-junittests.jar"/>
1239
          </fileset>
1240
        </classpath>
1241
       <formatter type="plain" />
1242
       <batchtest fork="yes" todir="${build.dir}">
1243
         <fileset dir="${build.tests}">
1244
           <include name="**/harvesterClient/*.class" />
1245
         </fileset>
1246
       </batchtest>
1247
     </junit>
1248
   </target>
1249

    
1250
  <target name="gethttpclient" depends="prepare"
1251
            description="checks out and compiles morpho httpclient code">
1252
  <!--mkdir dir="${morphosourcedir}" -->
1253
        <cvs cvsRoot="${cvsroot}"
1254
             package="morpho"
1255
             dest="." />
1256
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1257
   </target>
1258

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

    
1263
      <echo>***********************************
1264
      Please run ant gethttpclient first!
1265
      ***********************************
1266
      </echo>
1267
      <!-- copy and compile the tests into a jar file -->
1268
      <mkdir dir="${build.metacatnettest}"/>
1269
      <javac srcdir="${junitnettestsdir}"
1270
             destdir="${build.metacatnettest}"
1271
             includes="**/*.java">
1272
        <classpath>
1273
          <path refid="compile.classpath"/>
1274
          <fileset dir="${build.dir}">
1275
            <include name="${name}.jar"/>
1276
          </fileset>
1277
        </classpath>
1278
      </javac>
1279

    
1280
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1281
                    basedir="${build.metacatnettest}"
1282
                    includes="**/*.class" />
1283

    
1284
      <!-- use the ant "junit" task to run JUnit tests. -->
1285
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1286
             haltonerror="no">
1287
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1288
        <classpath>
1289
          <path refid="compile.classpath"/>
1290
          <fileset dir="${build.dir}">
1291
            <include name="${name}.jar"/>
1292
            <include name="${name}-junitnettests.jar"/>
1293
          </fileset>
1294
        </classpath>
1295

    
1296
        <formatter type="plain" />
1297

    
1298
        <batchtest fork="yes" todir="${build.dir}">
1299
          <fileset dir="${build.metacatnettest}">
1300
            <include name="**/*.class" />
1301
          </fileset>
1302
        </batchtest>
1303
     </junit>
1304
   </target>
1305

    
1306
   <target name="cleanweb" depends="clean"
1307
            description="deletes tomcat web context dir and all its contents">
1308
     <delete dir="${installdir}" />
1309
   </target>
1310

    
1311

    
1312
   <target name="clean" depends="init"
1313
            description="deletes build dir and files that can be regenerated form the release">
1314
       <delete dir="${build.dir}" />
1315
       <delete dir="${dist.dir}" />
1316
   </target>
1317

    
1318
   <target name="fullclean" depends="clean"
1319
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1320
       <delete file="lib/httpclient.jar" />
1321
       <delete file="lib/utilities.jar" />
1322
       <delete includeEmptyDirs="true" failonerror="false">
1323
         <fileset dir="${style-common-cvsrelpath}">
1324
           <include name="${eml-css}" />
1325
           <include name="eml-*/*.xsl" />
1326
           <include name="eml-*" />
1327
         </fileset>
1328
       </delete>
1329
   </target>
1330

    
1331
   <target name="jdoc" depends="prepare"
1332
            description="generates javadoc documentation">
1333
       <javadoc packagenames="edu.ucsb.nceas.*"
1334
           sourcepath="${build.src}"
1335
           destdir="${build.javadocs}"
1336
           author="true"
1337
           version="true"
1338
           use="true"
1339
           windowtitle="${Name} API"
1340
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1341
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1342
         <classpath>
1343
           <path refid="compile.classpath"/>
1344
         </classpath>
1345
       </javadoc>
1346
   </target>
1347

    
1348
   <target name="dist"
1349
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1350
            description="prepares a full release distribution">
1351
      <mkdir dir="${dist.dir}"/>
1352
      <delete dir="${ver.dir}" />
1353
      <mkdir dir="${ver.dir}"/>
1354
      <copy todir="${ver.dir}">
1355
        <fileset dir="."
1356
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1357
      </copy>
1358
      <copy todir="${ver.dir}" file="build.xml"/>
1359
      <copy todir="${ver.dir}" file="build.properties"/>
1360

    
1361
      <copy todir="${ver.dir}/docs" filtering="yes">
1362
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1363
      </copy>
1364
      <copy todir="${ver.dir}/docs" filtering="no">
1365
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1366
      </copy>
1367
      <copy todir="${ver.dir}/docs/dev">
1368
        <fileset dir="${build.dir}/docs"/>
1369
      </copy>
1370
      <copy todir="${ver.dir}/src">
1371
        <fileset dir="${build.dir}/src"/>
1372
      </copy>
1373
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1374
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1375
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1376
      <!--
1377
      <delete dir="./${ver.dir}/${build.dir}"/>
1378
      <delete dir="./${ver.dir}/dist"/>
1379
      -->
1380
      <delete file="./${name}-${release}.zip"/>
1381
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1382
      <delete file="./${name}-${release}.tar.gz" />
1383
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1384
      <gzip zipfile="./${name}-${release}.tar.gz"
1385
                src="./${name}-${release}.tar"/>
1386
      <delete file="./${name}-${release}.tar" />
1387
  </target>
1388

    
1389
  <target name="distsrc" depends="dist"
1390
            description="prepares a source distribution">
1391
      <mkdir dir="${ver.src}"/>
1392
      <copy todir="${ver.src}">
1393
        <fileset dir="./src"/>
1394
      </copy>
1395
      <mkdir dir="${util.dir}"/>
1396
      <copy todir="${util.dir}">
1397
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1398
      </copy>
1399
            
1400
            <mkdir dir="${ecogrid-dist-dir}"/>
1401
            <copy todir="${ecogrid-dist-dir}">
1402
                  <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1403
            </copy>
1404

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

    
1407
      <delete file="./${name}-src-${release}.zip"/>
1408
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1409
      <delete file="./${name}-src-${release}.tar.gz" />
1410
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1411
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1412
                src="./${name}-src-${release}.tar"/>
1413
      <delete file="./${name}-src-${release}.tar" />
1414
      <delete dir="${dist.dir}"/> 
1415
  </target>
1416

    
1417
   <target name="stylesheettest">
1418
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1419
      <param name="displaymodule" expression="${displaymodule}"/>
1420
      <param name="docid" expression="${input}"/>
1421
      <param name="entitytype" expression="${entitytype}"/>
1422
      <param name="entityindex" expression="${entityindex}"/>
1423
      <outputproperty name="method" value="html"/>
1424
      <outputproperty name="standalone" value="yes"/>
1425
      <outputproperty name="encoding" value="iso8859_1"/>
1426
      <outputproperty name="indent" value="yes"/>
1427
    </xslt>
1428
  </target>
1429

    
1430
 
1431
  <target name="compilewebclient" depends="prepare">
1432
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1433
  </target>
1434

    
1435
  <target name="runwebclient" depends="compilewebclient">
1436
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1437
           dir="${build.dest}" fork="yes"
1438
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1439
         <arg value="${serviceUrl}"/>
1440
         <arg value="${docid}"/>
1441
     </java>
1442
  </target>
1443
  
1444
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1445

    
1446
    <echo message="Compiling the metatcat shapefile creator"/>
1447
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1448
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1449
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1450
    </exec>
1451
  
1452
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1453
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1454
    </exec>
1455
  </target>
1456

    
1457
    <!-- LSID Authority support -->
1458
    <patternset id="lsid.jars">
1459
        <include name="axis.jar" />
1460
        <include name="commons-discovery-0.2.jar" />
1461
        <include name="jaxrpc.jar" />
1462
        <include name="lsid-client-1.1.1.jar" />
1463
        <include name="lsid-server-1.1.1.jar" />
1464
        <include name="saaj.jar" />
1465
        <include name="wsdl4j-1.5.1.jar" />
1466
        <include name="activation.jar" />
1467
        <include name="castor-0.9.5.jar" />
1468
        <include name="dnsjava-1.3.2.jar" />
1469
        <include name="mail.jar" />
1470
        <include name="commons-logging-1.0.4.jar" />
1471
        <!-- These jars may be needed but seem to not actually be,
1472
             so leaving them out for now
1473
        <include name="axis-ant.jar" />
1474
        -->
1475
        <!--<include name="GenCastor.class" />-->
1476
    </patternset>
1477
    <patternset id="lib.jars">
1478
        <include name="httpclient.jar" />
1479
        <include name="log4j-1.2.12.jar" />
1480
        <include name="utilities.jar" />
1481
        <include name="xercesImpl.jar" />
1482
        <include name="xalan.jar" />
1483
        <include name="xml-apis.jar" />
1484
    </patternset>
1485

    
1486
    <path id="lsid.classpath">
1487
        <fileset dir="${lsid.lib.dir}">
1488
            <patternset refid="lsid.jars"/>
1489
        </fileset>
1490
        <fileset dir="${lib.dir}">
1491
            <patternset refid="lsid.jars"/>
1492
        </fileset>
1493
        <fileset dir="${lib.dir}">
1494
            <include name="xalan.jar" />
1495
            <include name="xml-apis.jar" />
1496
        </fileset>
1497
        <fileset dir="${build.dir}">
1498
            <include name="metacat-client.jar" />
1499
        </fileset>
1500
    </path>
1501

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