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-11-26 15:41:39 -0800 (Mon, 26 Nov 2007) $'
11
  *    '$Revision: 3610 $'
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"/>
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-tag"        value="RELEASE_EML_2_0_1_UPDATE_5" />
213
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
214
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
215
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
216
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
217
      <property name="eml-css"             value="eml_xsl.css"/>
218
      <property name="eml-module.default.css"
219
                                           value="default.css"/>
220
   	  
221
      <!-- Config for registry variables -->
222
      <property name="scope"               value="obfs"/>
223
      <property name="responseForm"        value="genericResponse.tmpl"/>
224
      <property name="entryForm"           value="entryForm.tmpl"/>
225
      <property name="guide"               value="genericGuide.tmpl"/>
226
      <property name="loginForm"           value="loginForm.tmpl"/>
227
      <property name="confirmData"         value="confirmData.tmpl"/>
228
      <property name="deleteData"          value="deleteData.tmpl"/>
229
      <property name="genericHeader"       value="genericHeader.tmpl"/>
230
      <property name="genericFooter"       value="genericFooter.tmpl"/>
231
      <property name="adminname"           value="KNB Support"/>
232
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
233

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

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

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

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

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

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

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

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

    
406
   </target>
407

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
578
     </copy>
579
     <!-- <antcall target="copyxsl">
580
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
581
        <param name="dirname" value="eml-2.0.0" />
582
     </antcall> -->
583

    
584
     <echo>Enter CVS password: </echo>
585
     <cvs cvsRoot="${cvsroot}"
586
          package="${eml-module}"
587
          tag="${eml2_0_1-tag}"
588
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
589
     <mkdir dir="lib/schema/eml-2.0.1" />
590
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
591
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
592
         <include name="*.xsd"/>
593
       </fileset>
594
     </copy>
595
     <antcall target="copyxsl">
596
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
597
        <param name="dirname" value="eml-2.0.1" />
598
     </antcall>
599
   </target>
600

    
601
   <target  name="copyxsl"
602
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
603

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

    
606
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
607
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
608
       <include name="**/*.xsl"/>
609
     </fileset>
610
     </copy>
611

    
612

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

    
618
   </target>
619

    
620

    
621

    
622
   <target name="register-schemas" depends="prepare"
623
   description="Registers the Schemas with a new Metacat instance">
624
     <echo/>
625
     <echo>Registering the Schemas with the new Metacat instance...</echo>
626
     <sql driver="${dbDriver}"
627
          url="${jdbc-connect}"
628
          userid="${user}"
629
          password="${password}"
630
          src="${build.src}/loaddtdschema.sql">
631
       <classpath>
632
         <path refid="compile.classpath"/>
633
       </classpath>
634
     </sql>
635
   </target>
636

    
637
   <target name="installdb" depends="prepare"
638
            description="Installs the database tables">
639
     <echo/>
640
     <echo>Installing the database tables...</echo>
641
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
642
     <echo/>
643
     <sql driver="${dbDriver}"
644
          url="${jdbc-connect}"
645
          userid="${user}"
646
          password="${password}"
647
          src="${build.src}/${install-sql}">
648
       <classpath>
649
         <path refid="compile.classpath"/>
650
       </classpath>
651
     </sql>
652
   </target>
653

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

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

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

    
701
   <target name="upgrade14" depends="prepare"
702
            description="Updates the database tables to upgrade to version 1.4">
703
     <echo/>
704
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
705
     <sql driver="${dbDriver}"
706
          url="${jdbc-connect}"
707
          userid="${user}"
708
          password="${password}"
709
          src="${build.src}/${upgrade-1.4-sql}">
710
       <classpath>
711
         <path refid="compile.classpath"/>
712
       </classpath>
713
     </sql>
714
   </target>
715

    
716
   <target name="upgrade15" depends="sqlupgrade15"
717
           description="Updates the database tables to upgrade to version 1.5">
718
     <echo/>
719
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
720
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
721
           todir="${build.tmp}" filtering="yes"/>
722

    
723
     <javac srcdir="${build.tmp}"
724
            destdir="${build.tmp}"
725
            debug="${debug}"
726
            includes="upgrade_db_to_1_5.java">
727
       <classpath>
728
         <path refid="compile.classpath"/>
729
       </classpath>
730
     </javac>
731

    
732
     <java classname="upgrade_db_to_1_5">
733
       <classpath>
734
         <path refid="compile.classpath"/>
735
         <fileset dir="${build.tmp}"/>
736
       </classpath>
737
     </java>
738

    
739
   </target>
740

    
741
   <target name="upgrade16" depends="prepare"
742
            description="Updates the database tables from version 1.5 to version 1.6">
743
     <echo/>
744
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
745
     <sql driver="${dbDriver}"
746
          url="${jdbc-connect}"
747
          userid="${user}"
748
          password="${password}"
749
          src="${build.src}/${upgrade-1.6-sql}">
750
       <classpath>
751
         <path refid="compile.classpath"/>
752
       </classpath>
753
     </sql>
754
   </target>
755

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

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

    
824
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
825
           description="Installs spatial option for metacat">
826

    
827
      <property name="spatial.dir" value="./lib/spatial"/>
828
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
829
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
830

    
831
      <!-- Copy geoserver libs into ${war.lib} -->
832
      <copy todir="${war.lib}" filtering="no">
833
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
834
          <include name="**"/>
835
        </fileset>
836
      </copy>
837

    
838
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
839
      <copy todir="${war.webinf}" filtering="no">
840
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
841
          <exclude name="lib/**"/>
842
          <exclude name="web.xml"/>
843
        </fileset>
844
      </copy>
845

    
846
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
847
      <copy todir="${war.context}" filtering="no">
848
        <fileset dir="${spatial.geoserver.dir}">
849
          <exclude name="WEB-INF/**"/>
850
          <exclude name="index.jsp"/>
851
        </fileset>
852
      </copy>
853

    
854
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
855
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
856
          tofile="${war.context}/geoserver.jsp"
857
          overwrite="true"
858
          filtering="no"/>
859

    
860
      <!-- Copy the rest of the modified geoserver web-inf files
861
      <copy todir="${war.webinf}" filtering="no">
862
        <fileset dir="${spatial.webinf-mods}">
863
          <exclude name="web.xml.combined"/>
864
        </fileset>
865
      </copy> -->
866

    
867
    </target>
868

    
869

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

    
929
   <target name="install-registry" depends="init,getConversionXSL"
930
            description="Install Registry">
931

    
932
      <copy file="${srcdir}/perl/register-dataset.cgi"
933
            todir="${inst.cgi.dir}" filtering="yes"/>
934
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
935

    
936
      <mkdir dir="${temp-dir}" />
937
      <copy todir="${temp-dir}" filtering="yes">
938
       <fileset dir="lib/style/common/emlb6toeml2">
939
         <include name="*.xsl"/>
940
         <include name="*.xml"/>
941
       </fileset>
942
      </copy>
943

    
944
      <echo message="Install Registry completed." />
945
   </target>
946

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

    
976

    
977
   <target name="install-skin" depends="init"
978
            description="Install a Skin">
979

    
980
      <input message="Please enter name of the skin"
981
             addproperty="skin-name"/>
982

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

    
1025
      <echo message="Install Skin completed." />
1026
   </target>
1027

    
1028
   <target name="war" depends="warPrepare,warMSSQL,install-spatial"
1029
            description="Create a web archive (WAR) for servlet deployment">
1030
       <mkdir dir="${dist.dir}" />
1031
       <war destfile="${dist.dir}/${metacat.context}.war"
1032
            webxml="${build.war}/web.xml">
1033
         <fileset dir="${war.context}"/>
1034
         <lib dir="${war.lib}"/>
1035
         <webinf dir="${war.webinf}"/>
1036
       </war>
1037
   </target>
1038
	
1039
	
1040

    
1041
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
1042
            description="Prepare files for creating a web archive (WAR)">
1043

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

    
1107
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1108
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1109
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1110
   </target>
1111

    
1112
   <target name="getConversionXSL" depends="prepare"
1113
            unless="styles.not.needed"
1114
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1115

    
1116
     <echo>Enter CVS password: </echo>
1117
     <cvs cvsRoot="${cvsroot}"
1118
          package="${eml-module}"
1119
          tag="${eml2_0_1-tag}"
1120
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
1121

    
1122
     <mkdir dir="lib/style/common/emlb6toeml2" />
1123
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1124
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
1125
         <include name="*.xsl"/>
1126
         <include name="*.xml"/>
1127
       </fileset>
1128
      </copy>
1129
   </target>
1130

    
1131
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1132
      <mkdir dir="${build.tests}"/>
1133
      <copy todir="${build.tests}" filtering="yes">
1134
        <fileset dir="${testdir}">
1135
          <include name="edu/**"/>
1136
        </fileset>
1137
      </copy>
1138
   	<copy todir="${build.tests}" file="lib/metacat.properties" filtering="yes">
1139
   	        
1140
   	 </copy>
1141
      <!-- copy and compile the tests into a jar file -->
1142
      <javac srcdir="${build.tests}"
1143
             destdir="${build.tests}"
1144
             debug="on"
1145
             includes="**/*.java">
1146
        <classpath>
1147
          <path refid="compile.classpath"/>
1148
          <fileset dir="${build.dir}">
1149
            <include name="${name}.jar"/>
1150
            <include name="${name}-client.jar"/>
1151
            <include name="harvester.jar"/>
1152
          </fileset>
1153
        </classpath>
1154
      </javac>
1155

    
1156
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1157
        basedir="${build.tests}"
1158
                includes="**/*.class" />
1159
   </target>
1160

    
1161
   <target name="test" depends="testprep"
1162
            description="Uses the ant junit task to run all JUnit tests">
1163

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

    
1178
        <formatter type="plain" />
1179

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

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

    
1191
              <echo>testtorun: ${testtorun}</echo>
1192

    
1193
      <!-- use the ant "junit" task to run JUnit tests. -->
1194
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1195
             haltonerror="no">
1196
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1197
        <classpath>
1198
          <path refid="compile.classpath"/>
1199
          <fileset dir="${build.dir}">
1200
            <include name="${name}.jar"/>
1201
            <include name="${name}-client.jar"/>
1202
            <include name="harvester.jar"/>
1203
            <include name="${name}-junittests.jar"/>
1204
          </fileset>
1205
        </classpath>
1206

    
1207
        <formatter type="plain" />
1208

    
1209
        <batchtest fork="yes" todir="${build.dir}">
1210
          <fileset dir="${build.tests}">
1211
            <include name="**/${testtorun}.class" />
1212
          </fileset>
1213
        </batchtest>
1214
     </junit>
1215
   </target>
1216

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

    
1242
  <target name="gethttpclient" depends="prepare"
1243
            description="checks out and compiles morpho httpclient code">
1244
  <!--mkdir dir="${morphosourcedir}" -->
1245
        <cvs cvsRoot="${cvsroot}"
1246
             package="morpho"
1247
             dest="." />
1248
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1249
   </target>
1250

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

    
1255
      <echo>***********************************
1256
      Please run ant gethttpclient first!
1257
      ***********************************
1258
      </echo>
1259
      <!-- copy and compile the tests into a jar file -->
1260
      <mkdir dir="${build.metacatnettest}"/>
1261
      <javac srcdir="${junitnettestsdir}"
1262
             destdir="${build.metacatnettest}"
1263
             includes="**/*.java">
1264
        <classpath>
1265
          <path refid="compile.classpath"/>
1266
          <fileset dir="${build.dir}">
1267
            <include name="${name}.jar"/>
1268
          </fileset>
1269
        </classpath>
1270
      </javac>
1271

    
1272
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1273
                    basedir="${build.metacatnettest}"
1274
                    includes="**/*.class" />
1275

    
1276
      <!-- use the ant "junit" task to run JUnit tests. -->
1277
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1278
             haltonerror="no">
1279
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1280
        <classpath>
1281
          <path refid="compile.classpath"/>
1282
          <fileset dir="${build.dir}">
1283
            <include name="${name}.jar"/>
1284
            <include name="${name}-junitnettests.jar"/>
1285
          </fileset>
1286
        </classpath>
1287

    
1288
        <formatter type="plain" />
1289

    
1290
        <batchtest fork="yes" todir="${build.dir}">
1291
          <fileset dir="${build.metacatnettest}">
1292
            <include name="**/*.class" />
1293
          </fileset>
1294
        </batchtest>
1295
     </junit>
1296
   </target>
1297

    
1298
   <target name="cleanweb" depends="clean"
1299
            description="deletes tomcat web context dir and all its contents">
1300
     <delete dir="${installdir}" />
1301
   </target>
1302

    
1303

    
1304
   <target name="clean" depends="init"
1305
            description="deletes build dir and files that can be regenerated form the release">
1306
       <delete dir="${build.dir}" />
1307
       <delete dir="${dist.dir}" />
1308
   </target>
1309

    
1310
   <target name="fullclean" depends="clean"
1311
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1312
       <delete file="lib/httpclient.jar" />
1313
       <delete file="lib/utilities.jar" />
1314
       <delete includeEmptyDirs="true" failonerror="false">
1315
         <fileset dir="${style-common-cvsrelpath}">
1316
           <include name="${eml-css}" />
1317
           <include name="eml-*/*.xsl" />
1318
           <include name="eml-*" />
1319
         </fileset>
1320
       </delete>
1321
   </target>
1322

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

    
1340
   <target name="dist"
1341
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1342
            description="prepares a full release distribution">
1343
      <mkdir dir="${dist.dir}"/>
1344
      <delete dir="${ver.dir}" />
1345
      <mkdir dir="${ver.dir}"/>
1346
      <copy todir="${ver.dir}">
1347
        <fileset dir="."
1348
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1349
      </copy>
1350
      <copy todir="${ver.dir}" file="build.xml"/>
1351
      <copy todir="${ver.dir}" file="build.properties"/>
1352

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

    
1381
  <target name="distsrc" depends="dist"
1382
            description="prepares a source distribution">
1383
      <mkdir dir="${ver.src}"/>
1384
      <copy todir="${ver.src}">
1385
        <fileset dir="./src"/>
1386
      </copy>
1387
      <mkdir dir="${util.dir}"/>
1388
      <copy todir="${util.dir}">
1389
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1390
      </copy>
1391
  	  
1392
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1393
  	  <copy todir="${ecogrid-dist-dir}">
1394
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1395
  	  </copy>
1396

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

    
1399
      <delete file="./${name}-src-${release}.zip"/>
1400
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1401
      <delete file="./${name}-src-${release}.tar.gz" />
1402
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1403
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1404
                src="./${name}-src-${release}.tar"/>
1405
      <delete file="./${name}-src-${release}.tar" />
1406
      <delete dir="${dist.dir}"/> 
1407
  </target>
1408

    
1409
   <target name="stylesheettest">
1410
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1411
      <param name="displaymodule" expression="${displaymodule}"/>
1412
      <param name="docid" expression="${input}"/>
1413
      <param name="entitytype" expression="${entitytype}"/>
1414
      <param name="entityindex" expression="${entityindex}"/>
1415
      <outputproperty name="method" value="html"/>
1416
      <outputproperty name="standalone" value="yes"/>
1417
      <outputproperty name="encoding" value="iso8859_1"/>
1418
      <outputproperty name="indent" value="yes"/>
1419
    </xslt>
1420
  </target>
1421

    
1422
 
1423
  <target name="compilewebclient" depends="prepare">
1424
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1425
  </target>
1426

    
1427
  <target name="runwebclient" depends="compilewebclient">
1428
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1429
           dir="${build.dest}" fork="yes"
1430
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1431
         <arg value="${serviceUrl}"/>
1432
         <arg value="${docid}"/>
1433
     </java>
1434
  </target>
1435
  
1436
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1437

    
1438
    <echo message="Compiling the metatcat shapefile creator"/>
1439
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1440
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1441
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1442
    </exec>
1443
  
1444
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1445
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1446
    </exec>
1447
  </target>
1448

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

    
1478
    <path id="lsid.classpath">
1479
        <fileset dir="${lsid.lib.dir}">
1480
            <patternset refid="lsid.jars"/>
1481
        </fileset>
1482
        <fileset dir="${lib.dir}">
1483
            <patternset refid="lsid.jars"/>
1484
        </fileset>
1485
        <fileset dir="${lib.dir}">
1486
            <include name="xalan.jar" />
1487
            <include name="xml-apis.jar" />
1488
        </fileset>
1489
        <fileset dir="${build.dir}">
1490
            <include name="metacat-client.jar" />
1491
        </fileset>
1492
    </path>
1493

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