Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2 1311 berkley
<!--
3 670 jones
  *   '$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 113 jones
  *
9 670 jones
  *    '$Author$'
10 1292 tao
  *    '$Date$'
11
  *    '$Revision$'
12 666 jones
  *
13 670 jones
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15 113 jones
  *
16 303 jones
  * usage: ant [compile|jar|install|jdoc]
17 666 jones
  *
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 1311 berkley
-->
32 329 jones
<project name="metacat" default="jar" basedir=".">
33 2277 jones
  <property environment="env"/>
34 1929 brooke
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35
36 2599 jones
  <!-- Determine which tomcat we are using and tomcat-specific settings -->
37
  <condition property="jsdk" value="${tomcat}/lib/common/servlet.jar">
38
    <equals arg1="${tomcatversion}" arg2="tomcat3" />
39
  </condition>
40
  <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
41
    <equals arg1="${tomcatversion}" arg2="tomcat4" />
42
  </condition>
43
  <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
44
    <equals arg1="${tomcatversion}" arg2="tomcat5" />
45
  </condition>
46
47 1929 brooke
  <target name="check-db">
48
    <condition property="use-oracle">
49
      <equals arg1="${database}" arg2="oracle" />
50
    </condition>
51
    <condition property="use-postgresql">
52
      <equals arg1="${database}" arg2="postgresql" />
53
    </condition>
54
    <condition property="use-sqlserver">
55
      <equals arg1="${database}" arg2="sqlserver" />
56
    </condition>
57
  </target>
58
59
  <target name="oracle" if="use-oracle">
60 931 jones
     <!-- Customize these properties if you are using oracle -->
61 1929 brooke
     <echo message="Using oracle..."/>
62 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
63
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
64 2617 tao
     <property name="jdbc-jar-name" value="classes111.zip" />
65
     <property name="jdbc" value="${jdbc_base}/${jdbc-jar-name}" />
66 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
67
     <property name="other" value="yes"/>
68 2175 tao
     <property name="install-sql"
69 2103 jones
               value="xmltables.sql" />
70 2175 tao
     <property name="upgrade-1.2-sql"
71 2103 jones
               value="upgrade-db-to-1.2.sql" />
72 2175 tao
     <property name="upgrade-1.3-sql"
73 2103 jones
               value="upgrade-db-to-1.3.sql" />
74 2175 tao
     <property name="upgrade-1.4-sql"
75 2103 jones
               value="upgrade-db-to-1.4.sql" />
76 2518 sgarg
     <property name="upgrade-1.5-sql"
77 2431 sgarg
               value="upgrade-db-to-1.5.sql" />
78 2518 sgarg
     <property name="upgrade-1.6-sql"
79
               value="upgrade-db-to-1.6.sql" />
80 925 berkley
   </target>
81 1311 berkley
82 1929 brooke
   <target name="postgresql" if="use-postgresql">
83 931 jones
     <!-- Customize these properties if you are using postgres -->
84 1929 brooke
     <echo message="Using PostgreSQL..."/>
85 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
86 1311 berkley
     <property name="dbAdapter"
87 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
88 2610 tao
     <property name="jdbc-jar-name" value="postgresql-8.0-312.jdbc3.jar" />
89
     <property name="jdbc" value="lib/${jdbc-jar-name}" />
90 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
91
     <property name="other" value="yes"/>
92 2175 tao
     <property name="install-sql"
93 2277 jones
               value="xmltables-postgres.sql" />
94 2175 tao
     <property name="upgrade-1.2-sql"
95 2277 jones
               value="upgrade-db-to-1.2-postgres.sql" />
96 2175 tao
     <property name="upgrade-1.3-sql"
97 2277 jones
               value="upgrade-db-to-1.3-postgres.sql" />
98 2175 tao
     <property name="upgrade-1.4-sql"
99 2277 jones
               value="upgrade-db-to-1.4-postgres.sql" />
100 2518 sgarg
     <property name="upgrade-1.5-sql"
101 2431 sgarg
               value="upgrade-db-to-1.5-postgres.sql" />
102 2518 sgarg
     <property name="upgrade-1.6-sql"
103
               value="upgrade-db-to-1.6-postgres.sql" />
104 1744 tao
    </target>
105 2175 tao
106 1929 brooke
   <target name="sqlserver" if="use-sqlserver">
107 1739 tao
     <!-- Customize these properties if you are using SQL server -->
108 1929 brooke
     <echo message="Using SQL Server..."/>
109 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
110
     <property name="dbAdapter"
111
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
112 2296 sgarg
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
113
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
114
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
115 1744 tao
     <!-- Property to indicate is a MSSQL installation-->
116
     <property name="MSSQL" value="yes"/>
117 2175 tao
     <property name="install-sql"
118 2118 costa
               value="xmltables-sqlserver.sql" />
119 1739 tao
   </target>
120 1311 berkley
121 1929 brooke
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
122 1814 tao
      <!-- usr for client testing, generally you don't need change-->
123 2277 jones
      <property name="mcuser" value="uid=jones,o=NCEAS,dc=ecoinformatics,dc=org"/>
124 1783 jones
      <property name="mcpassword" value=""/>
125 1801 tao
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
126
      <property name="mcanotherpassword" value=""/>
127
128 1827 jones
      <property name="debug" value="on" />
129 2053 sgarg
      <property name="debuglevel" value="55" />
130 1716 berkley
131 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
132 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
133 1780 jones
      <property name="utilitiesdir" value="../utilities" />
134 2175 tao
135 1941 brooke
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
136
      <echo>*********** set jsdk to ${jsdk}</echo>
137 1103 tao
  </target>
138
139 931 jones
   <target name="init" depends="config">
140 2631 tao
      <path id="compile.classpath">
141
        <pathelement location="${jsdk}"/>
142
        <pathelement location="lib" />
143
        <fileset dir="lib">
144
          <include name="*.jar"/>
145
        </fileset>
146
       <fileset dir="lib/lsid_lib">
147
         <include name="*.jar"/>
148
       </fileset>
149
       <fileset dir="${jdbc_base}">
150
         <include name="${jdbc-jar-name}"/>
151
          <include name="msbase.jar"/>
152
          <include name="msutil.jar"/>
153
          <include name="mssqlserver.jar"/>
154
        </fileset>
155
       </path>
156
157 931 jones
      <!-- It is less likely you'll need to make any changes from here down,
158
           but customization is possible -->
159 2737 jones
      <property name="installdir"          value="${deploy.dir}/${metacat.context}" />
160
      <property name="temp-dir"            value="/tmp/${metacat.context}" />
161 1929 brooke
      <property name="name"                value="metacat"/>
162
      <property name="Name"                value="MetaCat"/>
163
      <property name="debugprefix"         value="${Name}:"/>
164 2577 sgarg
      <property name="release"             value="1.6.0"/>
165 2737 jones
      <property name="replication-path"    value="/${metacat.context}/servlet/replication"/>
166
      <property name="harvester-registration-login-path" value="/${metacat.context}/harvesterRegistrationLogin"/>
167
      <property name="harvester-registration-path"       value="/${metacat.context}/harvesterRegistration"/>
168
      <property name="servlet-path"        value="/${metacat.context}/metacat"/>
169
      <property name="html-path"           value="/${metacat.context}"/>
170 2180 tao
      <property name="systemidserver"      value="http://${httpserver}"/>
171 2175 tao
      <property name="style-common-relpath"
172 1933 brooke
                                           value="/style/common"/>
173 2175 tao
      <property name="style-common-cvsrelpath"
174 1938 brooke
                                           value="lib${style-common-relpath}"/>
175 2175 tao
      <property name="style-common-fullpath"
176 1933 brooke
                                           value="/${installdir}${style-common-relpath}"/>
177 2343 sgarg
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
178 2175 tao
      <property name="style-common-path"
179 2737 jones
                                           value="/${metacat.context}${style-common-relpath}"/>
180 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
181 2737 jones
      <property name="style-skins-path"    value="/${metacat.context}${style-skins-relpath}"/>
182 1929 brooke
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
183 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
184 2737 jones
      <property name="config-dir"          value="${deploy.dir}/${style-skins-path}" />
185 2461 sgarg
      <property name="util-module"         value="utilities" />
186 1929 brooke
      <property name="eml-module"          value="eml" />
187
      <property name="eml-version"         value="2.0.0beta6" />
188
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
189 2232 sgarg
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
190 2870 sgarg
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1_UPDATE_2" />
191 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
192
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
193
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
194 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
195 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
196
      <property name="eml-module.default.css"
197
                                           value="default.css"/>
198 348 jones
199 1929 brooke
      <!-- Config for registry variables -->
200 1933 brooke
      <property name="scope"               value="obfs"/>
201
      <property name="responseForm"        value="genericResponse.tmpl"/>
202
      <property name="entryForm"           value="entryForm.tmpl"/>
203
      <property name="guide"               value="genericGuide.tmpl"/>
204 2781 sgarg
      <property name="loginForm"           value="loginForm.tmpl"/>
205 2343 sgarg
      <property name="confirmData"         value="confirmData.tmpl"/>
206
      <property name="deleteData"          value="deleteData.tmpl"/>
207
      <property name="genericHeader"       value="genericHeader.tmpl"/>
208
      <property name="genericFooter"       value="genericFooter.tmpl"/>
209
      <property name="adminname"           value="KNB Support"/>
210
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
211 1929 brooke
212 2343 sgarg
      <property name="defaultStage"        value="initregister"/>
213
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
214
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
215
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
216
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
217
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
218
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
219
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
220
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
221
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
222
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
223
      <property name="register"            value="ldapRegister.tmpl"/>
224
      <property name="searchResults"       value="searchResults.tmpl"/>
225
226
      <filter token="scope"                value="${scope}"/>
227
      <filter token="responseForm"         value="${responseForm}"/>
228
      <filter token="entryForm"            value="${entryForm}"/>
229
      <filter token="guide"                value="${guide}"/>
230 2781 sgarg
      <filter token="loginForm"            value="${loginForm}"/>
231 2343 sgarg
      <filter token="confirmData"          value="${confirmData}"/>
232
      <filter token="deleteData"           value="${deleteData}"/>
233
      <filter token="genericHeader"        value="${genericHeader}"/>
234
      <filter token="genericFooter"        value="${genericFooter}"/>
235
      <filter token="adminname"            value="${adminname}"/>
236
      <filter token="recipient"            value="${recipient}"/>
237
238
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
239
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
240
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
241
      <filter token="ldap_password"        value="ldap_password"/>
242 2870 sgarg
      <filter token="mailhost"             value="localhost"/>
243 2343 sgarg
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
244 2461 sgarg
      <filter token="cgiurl"               value="http://${server}/cgi-bin/ldapweb.cgi"/>
245 2343 sgarg
246 882 jones
      <filter token="docrooturl" value="./" />
247 2356 sgarg
      <filter token="database" value="${database}" />
248 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
249 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
250 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
251 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
252 1929 brooke
      <filter token="temp-dir" value="${temp-dir}"/>
253 586 berkley
      <filter token="server" value="${server}"/>
254 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
255 1929 brooke
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
256
      <filter token="ldapUrl" value="${ldapUrl}"/>
257 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
258 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
259 348 jones
      <filter token="release" value="${release}"/>
260
      <filter token="servlet-path" value="${servlet-path}"/>
261 359 bojilova
      <filter token="html-path" value="${html-path}"/>
262 362 jones
      <filter token="user" value="${user}"/>
263
      <filter token="password" value="${password}"/>
264 1783 jones
      <filter token="mcuser" value="${mcuser}"/>
265
      <filter token="mcpassword" value="${mcpassword}"/>
266 1801 tao
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
267
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
268 1929 brooke
      <filter token="knb-site-url" value="${knb-site-url}"/>
269 1933 brooke
      <filter token="eml-css" value="${eml-css}"/>
270 1929 brooke
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
271
      <filter token="style-skins-path" value="${style-skins-path}"/>
272
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
273
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
274
      <filter token="style-common-path" value="${style-common-path}"/>
275 2343 sgarg
      <filter token="templates.dir" value="${templates.dir}"/>
276
277 1929 brooke
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
278
      <filter token="style-path" value="${style-skins-path}"/>
279 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
280 2299 costa
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
281
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
282 832 jones
      <filter token="config-dir" value="${config-dir}"/>
283
      <filter token="default-style" value="${default-style}"/>
284 877 jones
      <filter token="eml-version" value="${eml-version}"/>
285 2175 tao
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
286 2228 sgarg
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
287 2175 tao
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
288 1718 tao
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
289 2737 jones
      <filter token="context" value="${metacat.context}"/>
290 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
291 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
292 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
293 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
294 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
295 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
296 2308 jones
      <filter token="administrators" value="${administrators}"/>
297 2577 sgarg
      <filter token="moderators" value="${moderators}"/>
298
      <filter token="allowedSubmitters" value="${allowedSubmitters}"/>
299
      <filter token="deniedSubmitters" value="${deniedSubmitters}"/>
300 2872 sgarg
      <filter token="indexPaths" value="${indexPaths}"/>
301 1487 tao
302 2343 sgarg
      <filter token="defaultStage" value="${defaultStage}"/>
303
      <filter token="defaultHeader" value="${defaultHeader}"/>
304
      <filter token="defaultFooter" value="${defaultFooter}"/>
305
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
306
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
307
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
308
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
309
      <filter token="registerFailed" value="${registerFailed}"/>
310
      <filter token="registerLter" value="${registerLter}"/>
311
      <filter token="registerMatch" value="${registerMatch}"/>
312
      <filter token="registerSuccess" value="${registerSuccess}"/>
313
      <filter token="register" value="${register}"/>
314
      <filter token="searchResults" value="${searchResults}"/>
315 2549 tao
316
   	  <filter token="timedreplication" value="${timedreplication}" />
317
   	  <filter token="firsttimedreplication" value="${firsttimedreplication}" />
318
   	  <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
319
320
   	  <property name="srcdir" value="./src" />
321 2599 jones
   	  <property name="lib.dir" value="./lib" />
322 1783 jones
      <property name="testdir" value="./test" />
323 2277 jones
      <property name="testtorun" value="BuildIndexTest" />
324 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
325
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
326 348 jones
      <property name="build.dir" value="./build"/>
327
      <property name="build.src" value="${build.dir}/src"/>
328
      <property name="build.dest" value="${build.dir}/classes"/>
329 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
330 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
331
      <property name="build.tests" value="${build.dir}/tests"/>
332 1778 tao
      <property name="build.tmp" value="${build.dir}/tmp"/>
333 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
334
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
335 348 jones
      <property name="build.data" value="${build.dir}/data"/>
336 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
337 1952 jones
      <property name="build.war" value="${build.dir}/war"/>
338 348 jones
339 882 jones
      <property name="dist.dir" value="dist"/>
340 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
341
      <property name="ver.src" value="${ver.dir}/src"/>
342 2461 sgarg
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
343 2401 costa
	  <!-- directories for creating a Harvest List Editor distribution -->
344
      <property name="dist.dir.hle" value="disthle"/>
345
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
346 806 jones
347 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
348 2317 jones
      <condition property="utilities.required">
349
        <or>
350
          <not><available file="lib/httpclient.jar"/></not>
351
          <not><available file="lib/utilities.jar"/></not>
352
        </or>
353
      </condition>
354 2318 jones
      <condition property="eml.required">
355
        <or>
356
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
357
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
358
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
359
        </or>
360
      </condition>
361 2599 jones
362 113 jones
   </target>
363 1311 berkley
364 348 jones
   <target name="prepare" depends="init">
365
      <mkdir dir="${build.dir}"/>
366
      <mkdir dir="${build.src}"/>
367
      <mkdir dir="${build.dest}"/>
368 516 jones
      <mkdir dir="${build.javadocs}"/>
369 1778 tao
      <mkdir dir="${build.tmp}"/>
370 348 jones
371 822 jones
      <copy todir="${build.src}" filtering="yes">
372
        <fileset dir="${srcdir}">
373
          <include name="edu/**"/>
374
          <include name="com/**"/>
375 877 jones
          <include name="**/*.sql"/>
376 822 jones
          <exclude name="**/CVS*"/>
377
          <exclude name="**/.#*"/>
378
        </fileset>
379
      </copy>
380 2344 sgarg
      <available file="lib/style/common/emlb6toeml2" type="dir"
381 1954 jones
                 property="styles.not.needed"/>
382 348 jones
   </target>
383
384 1939 brooke
   <target name="compile" depends="prepare,utilities"
385 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
386 1939 brooke
387 1311 berkley
       <javac srcdir="${build.src}"
388
              destdir="${build.dest}"
389 1827 jones
              debug="${debug}"
390 2599 jones
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
391
        <classpath>
392
          <path refid="compile.classpath"/>
393
        </classpath>
394
      </javac>
395 1311 berkley
   </target>
396 113 jones
397 2322 jones
   <target name="jar" depends="compile,geteml"
398 1939 brooke
    description="Compiles and jars metacat java code to metacat.jar in build dir">
399
400 353 jones
       <delete file="${build.dir}/${name}.jar" />
401 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
402 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
403 1311 berkley
   </target>
404
405 1939 brooke
   <target name="protocol" depends="compile"
406
    description="Compiles and jars protocol java code to protocol.jar in build dir">
407 635 jones
       <delete file="${build.dir}/protocol.jar" />
408
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
409
            includes="**/protocols/" />
410 1311 berkley
   </target>
411 113 jones
412 2317 jones
   <target name="utilities" depends="config" if="utilities.required">
413 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
414
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
415 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
416
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
417
   </target>
418
419 2461 sgarg
   <target name="getutilities" depends="prepare"
420
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
421
     <echo>Enter CVS password: </echo>
422
     <cvs cvsRoot="${cvsroot}"
423 2468 sgarg
          package="${util-module}"
424 2461 sgarg
          dest="${build.tmp}" />
425
   </target>
426
427 1939 brooke
   <target name="client" depends="utilities, prepare"
428
    description="Compiles metacat-client java code to build dir">
429 1780 jones
       <javac srcdir="${build.src}"
430
              destdir="${build.dest}"
431 2599 jones
              includes="edu/ucsb/nceas/metacat/client/*">
432
          <classpath>
433
            <path refid="compile.classpath"/>
434
          </classpath>
435
        </javac>
436 1780 jones
   </target>
437
438 1939 brooke
   <target name="clientjar" depends="client"
439
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
440 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
441
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
442
            includes="**/metacat/client/" />
443
   </target>
444
445 2748 costa
    <target name="advancedsearchjar" depends="compile"
446
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
447
        <delete file="${build.dir}/advancedsearch.jar" />
448
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
449
             includes="**/metacat/advancedsearch/" />
450
    </target>
451
452 2059 costa
   <target name="harvester" depends="client"
453 1950 costa
           description="Compiles harvester java code to build dir">
454
       <javac srcdir="${build.src}"
455
              destdir="${build.dest}"
456 2599 jones
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
457
          <classpath>
458
            <path refid="compile.classpath"/>
459
          </classpath>
460
        </javac>
461 1950 costa
   </target>
462
463
   <target name="harvesterjar" depends="harvester"
464 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
465
       <delete file="${build.dir}/harvester.jar" />
466
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
467 1950 costa
            includes="**/metacat/harvesterClient/" />
468
   </target>
469
470 2369 costa
   <target name="harvestListEditorDist" depends="harvesterjar"
471
           description="Prepares a distribution of the Harvest List Editor tool">
472 2401 costa
       <mkdir dir="${dist.dir.hle}"/>
473
       <delete dir="${ver.dir.hle}" />
474
       <mkdir dir="${ver.dir.hle}"/>
475
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
476
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
477
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
478
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
479
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
480
       <delete file="./harvest-list-editor-${release}.zip"/>
481
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
482
       <delete file="./harvest-list-editor-${release}.tar.gz" />
483
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
484
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
485
             src="./harvest-list-editor-${release}.tar"/>
486
       <delete file="./harvest-list-editor-${release}.tar" />
487 2369 costa
   </target>
488
489 2318 jones
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
490 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
491
492 2318 jones
   <target name="getemlpre2" depends="prepare" if="eml.required"
493 1939 brooke
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
494 1612 tao
     <echo>Enter CVS password: </echo>
495
     <cvs cvsRoot="${cvsroot}"
496
          package="${eml-module}"
497
          tag="${eml-tag}"
498 1939 brooke
          dest="${build.tmp}/eml_${eml-tag}" />
499 1612 tao
     <mkdir dir="lib/dtd" />
500
     <copy todir="lib/dtd" filtering="yes">
501 1939 brooke
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
502 1612 tao
         <include name="*.dtd"/>
503
       </fileset>
504
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
505
     </copy>
506 2228 sgarg
507
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
508
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
509
       <include name="**/*.xsl"/>
510
     </fileset>
511
     </copy>
512 1939 brooke
   </target>
513
514 2318 jones
   <target name="geteml2+" depends="prepare" if="eml.required"
515 1939 brooke
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
516
     <echo>Enter CVS password: </echo>
517 1612 tao
     <cvs cvsRoot="${cvsroot}"
518
          package="${eml-module}"
519 2228 sgarg
          tag="${eml2_0_0-tag}"
520
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
521
     <mkdir dir="lib/schema/eml-2.0.0" />
522
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
523
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
524 1612 tao
         <include name="*.xsd"/>
525
       </fileset>
526 2175 tao
527 1939 brooke
       <!-- shouldn't we have a mapper here like this??
528
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
529 2175 tao
530
       Jing's code didn't nave one - does it need to be added?
531 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
532 2175 tao
533 1612 tao
     </copy>
534 1939 brooke
     <antcall target="copyxsl">
535 2228 sgarg
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
536
        <param name="dirname" value="eml-2.0.0" />
537 1939 brooke
     </antcall>
538 2228 sgarg
539
     <echo>Enter CVS password: </echo>
540
     <cvs cvsRoot="${cvsroot}"
541
          package="${eml-module}"
542
          tag="${eml2_0_1-tag}"
543
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
544
     <mkdir dir="lib/schema/eml-2.0.1" />
545
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
546
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
547
         <include name="*.xsd"/>
548
       </fileset>
549
     </copy>
550
     <antcall target="copyxsl">
551
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
552
        <param name="dirname" value="eml-2.0.1" />
553
     </antcall>
554 1939 brooke
   </target>
555
556 2175 tao
   <target  name="copyxsl"
557 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
558
559
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
560 2175 tao
561 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
562
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
563 1929 brooke
       <include name="**/*.xsl"/>
564 1612 tao
     </fileset>
565
     </copy>
566 1939 brooke
567 2175 tao
568
     <!-- now copy default css from eml module and put it in style-common-path
569 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
570 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
571 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
572 1612 tao
573 1463 tao
   </target>
574 2175 tao
575
576
577 2322 jones
   <target name="register-schemas" depends="prepare"
578
   description="Registers the Schemas with a new Metacat instance">
579 877 jones
     <echo/>
580 2322 jones
     <echo>Registering the Schemas with the new Metacat instance...</echo>
581 877 jones
     <sql driver="${dbDriver}"
582
          url="${jdbc-connect}"
583
          userid="${user}"
584
          password="${password}"
585 2599 jones
          src="${build.src}/loaddtdschema.sql">
586
       <classpath>
587
         <path refid="compile.classpath"/>
588
       </classpath>
589
     </sql>
590 877 jones
   </target>
591 1716 berkley
592 1939 brooke
   <target name="installdb" depends="prepare"
593
            description="Installs the database tables">
594 1827 jones
     <echo/>
595
     <echo>Installing the database tables...</echo>
596 2445 sgarg
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
597 2599 jones
     <echo/>
598 1827 jones
     <sql driver="${dbDriver}"
599
          url="${jdbc-connect}"
600
          userid="${user}"
601
          password="${password}"
602 2599 jones
          src="${build.src}/${install-sql}">
603
       <classpath>
604
         <path refid="compile.classpath"/>
605
       </classpath>
606
     </sql>
607 1827 jones
   </target>
608
609 2599 jones
   <target name="dropdb" depends="prepare"
610
            description="WARNING: Drops the database tables">
611
     <echo/>
612
     <echo>Dropping the database tables...</echo>
613
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
614
     <echo/>
615
     <sql driver="${dbDriver}"
616
          url="${jdbc-connect}"
617
          userid="${user}"
618
          password="${password}"
619
          src="${build.src}/drop-postgres.sql">
620
       <classpath>
621
         <path refid="compile.classpath"/>
622
       </classpath>
623
     </sql>
624
   </target>
625
626 1939 brooke
   <target name="upgrade12" depends="prepare"
627
            description="Updates the database tables to upgrade to version 1.2">
628 1827 jones
     <echo/>
629
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
630
     <sql driver="${dbDriver}"
631
          url="${jdbc-connect}"
632
          userid="${user}"
633
          password="${password}"
634 2599 jones
          src="${build.src}/${upgrade-1.2-sql}">
635
       <classpath>
636
         <path refid="compile.classpath"/>
637
       </classpath>
638
     </sql>
639 1827 jones
   </target>
640
641 1939 brooke
   <target name="upgrade13" depends="prepare"
642
            description="Updates the database tables to upgrade to version 1.3">
643 1827 jones
     <echo/>
644
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
645
     <sql driver="${dbDriver}"
646
          url="${jdbc-connect}"
647
          userid="${user}"
648
          password="${password}"
649 2599 jones
          src="${build.src}/${upgrade-1.3-sql}">
650
       <classpath>
651
         <path refid="compile.classpath"/>
652
       </classpath>
653
     </sql>
654 1827 jones
   </target>
655
656 2103 jones
   <target name="upgrade14" depends="prepare"
657
            description="Updates the database tables to upgrade to version 1.4">
658
     <echo/>
659
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
660
     <sql driver="${dbDriver}"
661
          url="${jdbc-connect}"
662
          userid="${user}"
663
          password="${password}"
664 2599 jones
          src="${build.src}/${upgrade-1.4-sql}">
665
       <classpath>
666
         <path refid="compile.classpath"/>
667
       </classpath>
668
     </sql>
669 2103 jones
   </target>
670
671 2395 tao
   <target name="upgrade15" depends="sqlupgrade15"
672 2391 tao
           description="Updates the database tables to upgrade to version 1.5">
673 2353 sgarg
     <echo/>
674 2461 sgarg
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
675 2353 sgarg
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
676 2391 tao
           todir="${build.tmp}" filtering="yes"/>
677 2461 sgarg
678 2353 sgarg
     <javac srcdir="${build.tmp}"
679
            destdir="${build.tmp}"
680
            debug="${debug}"
681 2599 jones
            includes="upgrade_db_to_1_5.java">
682
       <classpath>
683
         <path refid="compile.classpath"/>
684
       </classpath>
685
     </javac>
686 2461 sgarg
687 2599 jones
     <java classname="upgrade_db_to_1_5">
688
       <classpath>
689
         <path refid="compile.classpath"/>
690
         <fileset dir="${build.tmp}"/>
691
       </classpath>
692
     </java>
693 2353 sgarg
694 2393 tao
   </target>
695 2461 sgarg
696 2518 sgarg
   <target name="upgrade16" depends="prepare"
697
            description="Updates the database tables from version 1.5 to version 1.6">
698
     <echo/>
699
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
700
     <sql driver="${dbDriver}"
701
          url="${jdbc-connect}"
702
          userid="${user}"
703
          password="${password}"
704 2599 jones
          src="${build.src}/${upgrade-1.6-sql}">
705
       <classpath>
706
         <path refid="compile.classpath"/>
707
       </classpath>
708
     </sql>
709 2518 sgarg
   </target>
710
711
712 2395 tao
   <target name="sqlupgrade15" depends="prepare">
713
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
714 2393 tao
      <sql driver="${dbDriver}"
715
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
716
          url="${jdbc-connect}"
717
          userid="${user}"
718
          password="${password}"
719
          src="${build.src}/${upgrade-1.5-sql}" />
720 2444 sgarg
      <sql driver="${dbDriver}"
721
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
722
          url="${jdbc-connect}"
723
          userid="${user}"
724
          password="${password}"
725
          rdbms="oracle"
726
          delimiter="/">
727
        <transaction>
728
           CREATE TRIGGER xml_returnfield_before_insert
729
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
730
           BEGIN
731
              SELECT xml_returnfield_id_seq.nextval
732
                 INTO :new.returnfield_id
733
                 FROM dual;
734
           END;
735
           /
736
        </transaction>
737
        <transaction>
738
           CREATE TRIGGER xml_queryresult_before_insert
739
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
740
           BEGIN
741
              SELECT xml_queryresult_id_seq.nextval
742
              INTO :new.queryresult_id
743
              FROM dual;
744
           END;
745
           /
746
        </transaction>
747
      </sql>
748 2393 tao
   </target>
749 2353 sgarg
750 1952 jones
   <target name="install" depends="war" description="* Full Install *">
751 1079 tao
       <mkdir dir="${datafilepath}" />
752 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
753 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
754 1929 brooke
       <mkdir dir="${temp-dir}"/>
755
       <chmod dir="${temp-dir}" perm="ug+w" />
756 2737 jones
       <copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
757 1952 jones
   </target>
758 2175 tao
759
   <target name="upgrade" depends="install"
760 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
761 2737 jones
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
762 1952 jones
   </target>
763
764 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
765 1952 jones
            description="Install Registry">
766 2175 tao
767 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
768
            todir="${inst.cgi.dir}" filtering="yes"/>
769
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
770 2175 tao
771 1952 jones
      <mkdir dir="${temp-dir}" />
772 2343 sgarg
      <copy todir="${temp-dir}" filtering="yes">
773
       <fileset dir="lib/style/common/emlb6toeml2">
774 1952 jones
         <include name="*.xsl"/>
775
         <include name="*.xml"/>
776
       </fileset>
777 2343 sgarg
      </copy>
778 1952 jones
779
      <echo message="Install Registry completed." />
780
   </target>
781
782 2343 sgarg
   <target name="install-ldap" depends="init">
783
      <copy file="${srcdir}/perl/ldapweb.cgi"
784
            todir="${inst.cgi.dir}" filtering="yes"/>
785
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
786
      <copy file="lib/ldapweb.cfg"
787
            todir="${inst.cgi.dir}" filtering="yes"/>
788
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
789
      <mkdir dir="${templates.dir}" />
790
      <copy todir="${templates.dir}" filtering="yes">
791
        <fileset dir="lib/style/common/templates">
792
            <include name="${defaultChangePass}"/>
793
            <include name="${defaultResetPass}"/>
794
            <include name="${changePassSuccess}"/>
795
            <include name="${resetPassSuccess}"/>
796
            <include name="${registerFailed}"/>
797
            <include name="${registerLter}"/>
798
            <include name="${registerMatch}"/>
799
            <include name="${registerSuccess}"/>
800
            <include name="${register}"/>
801
            <include name="${searchResults}"/>
802
        </fileset>
803
      </copy>
804
      <echo message="ldapweb install complete." />
805
   </target>
806
807
808 2175 tao
   <target name="install-skin" depends="init"
809 2052 sgarg
            description="Install a Skin">
810
811 2175 tao
      <input message="Please enter name of the skin"
812 2052 sgarg
             addproperty="skin-name"/>
813
814
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
815
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
816
       <fileset dir="lib/style/skins/${skin-name}">
817 2054 sgarg
           <exclude name="*.png"/>
818
           <exclude name="*.gif"/>
819 2210 jones
           <exclude name="*.jpg"/>
820 2277 jones
           <exclude name="**/CVS*"/>
821
           <exclude name="**/.#*"/>
822 2052 sgarg
       </fileset>
823
      </copy>
824 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
825
       <fileset dir="lib/style/skins/${skin-name}">
826
           <include name="*.png"/>
827
           <include name="*.gif"/>
828 2210 jones
           <include name="*.jpg"/>
829 2277 jones
           <exclude name="**/CVS*"/>
830
           <exclude name="**/.#*"/>
831 2054 sgarg
       </fileset>
832
      </copy>
833 2277 jones
      <!--
834 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
835
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
836
       <fileset dir="lib/style/skins/${skin-name}/images">
837
           <include name="*.png"/>
838
           <include name="*.gif"/>
839
           <include name="*.jpg"/>
840
       </fileset>
841
      </copy>
842 2277 jones
      -->
843 2052 sgarg
844
      <echo message="Install Skin completed." />
845
   </target>
846
847 1952 jones
   <target name="war" depends="warPrepare,warMSSQL"
848
            description="Create a web archive (WAR) for servlet deployment">
849 2737 jones
       <mkdir dir="${dist.dir}" />
850
       <war destfile="${dist.dir}/${metacat.context}.war"
851 1952 jones
            webxml="${build.war}/web.xml">
852
         <fileset dir="${war.context}"/>
853
         <lib dir="${war.lib}"/>
854
         <webinf dir="${war.webinf}"/>
855
       </war>
856
   </target>
857
858 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
859 1952 jones
            description="Prepare files for creating a web archive (WAR)">
860
861
       <property name="war.lib" value="${build.war}/lib" />
862
       <property name="war.webinf" value="${build.war}/WEB-INF" />
863 2737 jones
       <property name="war.context" value="${build.war}/${metacat.context}" />
864 1952 jones
       <mkdir dir="${war.lib}" />
865
       <mkdir dir="${war.webinf}" />
866
       <mkdir dir="${war.context}" />
867 2610 tao
868
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
869 1952 jones
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
870
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
871 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
872 1952 jones
       <copy todir="${war.lib}" filtering="no">
873 1823 jones
         <fileset dir="lib">
874 2610 tao
            <not>
875
               <filename name="${jdbc-jar-name}"/>
876
            </not>
877
            <include name="*.jar"/>
878 1823 jones
         </fileset>
879
         <fileset dir="lib/xalan">
880
           <include name="*.jar"/>
881
         </fileset>
882
       </copy>
883 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
884 1952 jones
             tofile="${build.war}/web.xml" />
885
       <copy file="lib/metacat.properties" todir="${war.webinf}"
886 1951 jones
             filtering="yes" />
887 2900 sgarg
       <copy todir="${war.webinf}" filtering="yes">
888
	   	  <fileset dir="lib">
889
           <include name="skin.configs/**"/>
890
		  </fileset>
891
	   </copy>
892 2583 sgarg
       <copy file="lib/log4j.properties" todir="${war.webinf}"
893
             filtering="yes" />
894 1952 jones
       <copy todir="${war.context}" filtering="no">
895 822 jones
         <fileset dir="lib">
896
           <include name="**/*.jpg"/>
897
           <include name="**/*.png"/>
898
           <include name="**/*.gif"/>
899 2844 costa
           <include name="LiveMap_30/**"/>
900 822 jones
         </fileset>
901
       </copy>
902 1952 jones
       <copy todir="${war.context}" filtering="yes">
903 822 jones
         <fileset dir="lib">
904
           <exclude name="*.jar"/>
905
           <exclude name="*.properties"/>
906
           <exclude name="web.xml"/>
907 1437 berkley
           <exclude name="**/*.jpg"/>
908
           <exclude name="**/*.png"/>
909
           <exclude name="**/*.gif"/>
910 2778 jones
           <exclude name="lsid_lib/**"/>
911
           <exclude name="lsid_conf/**"/>
912 2844 costa
           <exclude name="LiveMap_30/**"/>
913 2900 sgarg
           <exclude name="skin.configs/**"/>
914 822 jones
         </fileset>
915
       </copy>
916 1311 berkley
   </target>
917 1929 brooke
918 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
919
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
920
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
921 1929 brooke
   </target>
922
923 2175 tao
   <target name="getConversionXSL" depends="prepare"
924 1954 jones
            unless="styles.not.needed"
925 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
926 2497 sgarg
927 1929 brooke
     <echo>Enter CVS password: </echo>
928 2497 sgarg
     <cvs cvsRoot="${cvsroot}"
929
          package="${eml-module}"
930
          tag="${eml2_0_1-tag}"
931
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
932 2343 sgarg
933
     <mkdir dir="lib/style/common/emlb6toeml2" />
934
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
935 2497 sgarg
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
936 2343 sgarg
         <include name="*.xsl"/>
937
         <include name="*.xml"/>
938
       </fileset>
939
      </copy>
940 1929 brooke
   </target>
941
942 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
943 1783 jones
      <mkdir dir="${build.tests}"/>
944
      <copy todir="${build.tests}" filtering="yes">
945
        <fileset dir="${testdir}">
946
          <include name="edu/**"/>
947
        </fileset>
948
      </copy>
949 971 tao
      <!-- copy and compile the tests into a jar file -->
950 1783 jones
      <javac srcdir="${build.tests}"
951
             destdir="${build.tests}"
952 1612 tao
             debug="on"
953 2599 jones
       includes="**/*.java">
954
        <classpath>
955
          <path refid="compile.classpath"/>
956
          <fileset dir="${build.dir}">
957
            <includes name="${name}.jar"/>
958
            <includes name="${name}-client.jar"/>
959
            <includes name="harvester.jar"/>
960
          </fileset>
961
        </classpath>
962
      </javac>
963 204 jones
964 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
965 1783 jones
        basedir="${build.tests}"
966 1311 berkley
                includes="**/*.class" />
967 1822 jones
   </target>
968 971 tao
969 1939 brooke
   <target name="test" depends="testprep"
970
            description="Uses the ant junit task to run all JUnit tests">
971 1822 jones
972 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
973 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
974 971 tao
             haltonerror="no">
975 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
976 971 tao
        <classpath>
977 2599 jones
          <path refid="compile.classpath"/>
978
          <fileset dir="${build.dir}">
979
            <includes name="${name}.jar"/>
980
            <includes name="${name}-client.jar"/>
981
            <includes name="harvester.jar"/>
982
            <includes name="${name}-junittests.jar"/>
983
          </fileset>
984 971 tao
        </classpath>
985
986
        <formatter type="plain" />
987
988
        <batchtest fork="yes" todir="${build.dir}">
989 1783 jones
          <fileset dir="${build.tests}">
990 1116 tao
            <include name="**/*.class" />
991 971 tao
          </fileset>
992
        </batchtest>
993
     </junit>
994
   </target>
995 1103 tao
996 1939 brooke
    <target name="runonetest" depends="testprep"
997
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
998 1500 tao
999 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
1000
1001 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1002 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1003 1500 tao
             haltonerror="no">
1004 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1005 1500 tao
        <classpath>
1006 2599 jones
          <path refid="compile.classpath"/>
1007
          <fileset dir="${build.dir}">
1008
            <includes name="${name}.jar"/>
1009
            <includes name="${name}-client.jar"/>
1010
            <includes name="harvester.jar"/>
1011
            <includes name="${name}-junittests.jar"/>
1012
          </fileset>
1013 1500 tao
        </classpath>
1014
1015
        <formatter type="plain" />
1016
1017
        <batchtest fork="yes" todir="${build.dir}">
1018 1783 jones
          <fileset dir="${build.tests}">
1019 1500 tao
            <include name="**/${testtorun}.class" />
1020
          </fileset>
1021
        </batchtest>
1022
     </junit>
1023
   </target>
1024
1025 2175 tao
   <target name="testharvester"
1026 2135 costa
           depends="testprep"
1027
           description="Uses the ant junit task to test only the Harvester code">
1028 2175 tao
     <junit printsummary="yes"
1029
            haltonfailure="off"
1030 2135 costa
            fork="yes"
1031
            haltonerror="off">
1032 2599 jones
        <classpath>
1033
          <path refid="compile.classpath"/>
1034
          <fileset dir="${build.dir}">
1035
            <includes name="${name}.jar"/>
1036
            <includes name="${name}-client.jar"/>
1037
            <includes name="harvester.jar"/>
1038
            <includes name="${name}-junittests.jar"/>
1039
          </fileset>
1040
        </classpath>
1041 2135 costa
       <formatter type="plain" />
1042
       <batchtest fork="yes" todir="${build.dir}">
1043
         <fileset dir="${build.tests}">
1044
           <include name="**/harvesterClient/*.class" />
1045
         </fileset>
1046
       </batchtest>
1047
     </junit>
1048
   </target>
1049
1050 1939 brooke
  <target name="gethttpclient" depends="prepare"
1051
            description="checks out and compiles morpho httpclient code">
1052 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
1053 1487 tao
        <cvs cvsRoot="${cvsroot}"
1054 1103 tao
             package="morpho"
1055
             dest="." />
1056 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1057 1103 tao
   </target>
1058
1059
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1060 1939 brooke
   <target name="nettest" depends="install"
1061
            description="compiles and runs the metacatnettest code">
1062 2175 tao
1063 1103 tao
      <echo>***********************************
1064 1311 berkley
      Please run ant gethttpclient first!
1065
      ***********************************
1066 1103 tao
      </echo>
1067
      <!-- copy and compile the tests into a jar file -->
1068 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
1069 1103 tao
      <javac srcdir="${junitnettestsdir}"
1070 1116 tao
             destdir="${build.metacatnettest}"
1071 2599 jones
             includes="**/*.java">
1072
        <classpath>
1073
          <path refid="compile.classpath"/>
1074
          <fileset dir="${build.dir}">
1075
            <includes name="${name}.jar"/>
1076
          </fileset>
1077
        </classpath>
1078
      </javac>
1079 1103 tao
1080
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1081 1116 tao
                    basedir="${build.metacatnettest}"
1082 1103 tao
                    includes="**/*.class" />
1083
1084
      <!-- use the ant "junit" task to run JUnit tests. -->
1085 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1086 1103 tao
             haltonerror="no">
1087 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1088 1103 tao
        <classpath>
1089 2599 jones
          <path refid="compile.classpath"/>
1090
          <fileset dir="${build.dir}">
1091
            <includes name="${name}.jar"/>
1092
            <includes name="${name}-junitnettests.jar"/>
1093
          </fileset>
1094 1103 tao
        </classpath>
1095
1096
        <formatter type="plain" />
1097
1098
        <batchtest fork="yes" todir="${build.dir}">
1099 1116 tao
          <fileset dir="${build.metacatnettest}">
1100
            <include name="**/*.class" />
1101 1103 tao
          </fileset>
1102
        </batchtest>
1103
     </junit>
1104 1311 berkley
   </target>
1105 1103 tao
1106 1939 brooke
   <target name="cleanweb" depends="clean"
1107
            description="deletes tomcat web context dir and all its contents">
1108 1522 berkley
     <delete dir="${installdir}" />
1109
   </target>
1110
1111
1112 1939 brooke
   <target name="clean" depends="init"
1113 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1114 822 jones
       <delete dir="${build.dir}" />
1115 2737 jones
       <delete dir="${dist.dir}" />
1116 2320 jones
   </target>
1117
1118
   <target name="fullclean" depends="clean"
1119
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1120
       <delete file="lib/httpclient.jar" />
1121
       <delete file="lib/utilities.jar" />
1122 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1123
         <fileset dir="${style-common-cvsrelpath}">
1124
           <include name="${eml-css}" />
1125
           <include name="eml-*/*.xsl" />
1126
           <include name="eml-*" />
1127
         </fileset>
1128 2320 jones
       </delete>
1129 113 jones
   </target>
1130
1131 1939 brooke
   <target name="jdoc" depends="prepare"
1132
            description="generates javadoc documentation">
1133 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1134 516 jones
           sourcepath="${build.src}"
1135
           destdir="${build.javadocs}"
1136 113 jones
           author="true"
1137
           version="true"
1138
           use="true"
1139 348 jones
           windowtitle="${Name} API"
1140
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1141 2599 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1142
         <classpath>
1143
           <path refid="compile.classpath"/>
1144
         </classpath>
1145
       </javadoc>
1146 113 jones
   </target>
1147
1148 2461 sgarg
   <target name="dist"
1149
       depends="geteml,jar,protocol,jdoc,getConversionXSL,getutilities"
1150 1939 brooke
            description="prepares a full release distribution">
1151 806 jones
      <mkdir dir="${dist.dir}"/>
1152
      <delete dir="${ver.dir}" />
1153
      <mkdir dir="${ver.dir}"/>
1154
      <copy todir="${ver.dir}">
1155 1311 berkley
        <fileset dir="."
1156 2401 costa
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1157 806 jones
      </copy>
1158
      <copy todir="${ver.dir}" file="build.xml"/>
1159 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1160 882 jones
1161
      <copy todir="${ver.dir}/docs" filtering="yes">
1162
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1163
      </copy>
1164
      <copy todir="${ver.dir}/docs" filtering="no">
1165
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1166
      </copy>
1167 806 jones
      <copy todir="${ver.dir}/docs/dev">
1168
        <fileset dir="${build.dir}/docs"/>
1169
      </copy>
1170 917 berkley
      <copy todir="${ver.dir}/src">
1171
        <fileset dir="${build.dir}/src"/>
1172
      </copy>
1173 2391 tao
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1174
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1175 2395 tao
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1176 2323 jones
      <!--
1177 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
1178
      <delete dir="./${ver.dir}/dist"/>
1179 2323 jones
      -->
1180 882 jones
      <delete file="./${name}-${release}.zip"/>
1181 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1182 882 jones
      <delete file="./${name}-${release}.tar.gz" />
1183 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1184 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
1185 882 jones
                src="./${name}-${release}.tar"/>
1186
      <delete file="./${name}-${release}.tar" />
1187 1311 berkley
  </target>
1188 806 jones
1189 1939 brooke
  <target name="distsrc" depends="dist"
1190
            description="prepares a source distribution">
1191 806 jones
      <mkdir dir="${ver.src}"/>
1192
      <copy todir="${ver.src}">
1193
        <fileset dir="./src"/>
1194
      </copy>
1195 2461 sgarg
      <mkdir dir="${util.dir}"/>
1196
      <copy todir="${util.dir}">
1197
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1198
      </copy>
1199 806 jones
1200 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1201
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1202
      <delete file="./${name}-src-${release}.tar.gz" />
1203
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1204 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1205 882 jones
                src="./${name}-src-${release}.tar"/>
1206
      <delete file="./${name}-src-${release}.tar" />
1207 807 jones
      <delete dir="${dist.dir}"/>
1208 1311 berkley
  </target>
1209 806 jones
1210 1702 tao
   <target name="stylesheettest">
1211 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1212 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1213
      <param name="docid" expression="${input}"/>
1214
      <param name="entitytype" expression="${entitytype}"/>
1215
      <param name="entityindex" expression="${entityindex}"/>
1216
      <outputproperty name="method" value="html"/>
1217
      <outputproperty name="standalone" value="yes"/>
1218
      <outputproperty name="encoding" value="iso8859_1"/>
1219
      <outputproperty name="indent" value="yes"/>
1220
    </xslt>
1221
  </target>
1222 2175 tao
1223 1819 tao
 <target name="gridinit" depends="init">
1224
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
1225
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
1226
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
1227
   <property environment="env"/>
1228
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1229 1820 tao
    <path id="webservicepath">
1230
        <pathelement location="."/>
1231
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1232
        <pathelement location="${build.dest}"/>
1233
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1234
           <include name="*.jar"/>
1235
        </fileset>
1236
      </path>
1237 1819 tao
</target>
1238
1239 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
1240 2175 tao
 </target>
1241
1242 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
1243 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1244 1811 tao
  </target>
1245 2175 tao
1246 1811 tao
  <target name="generateWSDL" depends="compileinterface">
1247
    <echo message="Generating wsdl from ${interface.name} interface"/>
1248
    <java classname="${java2wsdl.tool}"
1249 1814 tao
          dir="${build.src}" fork="yes"
1250 1811 tao
          classpathref="webservicepath"  failonerror="true" >
1251
      <arg value="-P"/>
1252
      <arg value="${interface.name}PortType"/>
1253
      <arg value="-S"/>
1254
      <arg value="${interface.name}Service"/>
1255
      <arg value="-y"/>
1256
      <arg value="WRAPPED"/>
1257
      <arg value="-u"/>
1258
      <arg value="LITERAL"/>
1259
      <arg value="-l"/>
1260
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1261
      <arg value="-n"/>
1262
      <arg value="http://${services.namespace}/${interface.name}"/>
1263
      <arg value="${interface.package}.${interface.name}"/>
1264
    </java>
1265
  </target>
1266 2175 tao
1267 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
1268
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1269 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1270 1811 tao
            fork="yes"
1271
            classpathref="webservicepath" failonerror="true" >
1272
        <arg value="${binding.file}"/>
1273
        <arg value="${wsdl.file}"/>
1274
      </java>
1275
   </target>
1276 2175 tao
1277 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
1278
      <echo message=" Generating stubs " />
1279 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
1280
      <echo message="build.src is ${build.src}"/>
1281 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1282
            classpathref="webservicepath" failonerror="true" >
1283 1814 tao
         <arg value="${wsdl.file}"/>
1284 1811 tao
    </java>
1285
  </target>
1286 2175 tao
1287 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1288
     <echo message=" Compiling stubs " />
1289
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1290
     <echo message=" Compiling impl " />
1291
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1292
  </target>
1293 2175 tao
1294 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1295
     <echo message=" jar stubs classes " />
1296
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1297
     <echo message=" jar impl classes " />
1298
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1299
  </target>
1300 2175 tao
1301 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
1302
     <echo message=" jar the gar file"/>
1303
     <mkdir dir="${build.dir}/gar"/>
1304
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1305
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1306
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1307 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1308
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1309
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1310
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1311 1811 tao
  </target>
1312 2175 tao
1313 1814 tao
  <target name="compilewebclient" depends="prepare">
1314
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1315
  </target>
1316 2175 tao
1317 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1318 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1319 1814 tao
           dir="${build.dest}" fork="yes"
1320
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1321
         <arg value="${serviceUrl}"/>
1322
         <arg value="${docid}"/>
1323
     </java>
1324
  </target>
1325 2598 harris
1326 2639 harris
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1327 2598 harris
1328
    <echo message="Compiling the metatcat shapefile creator"/>
1329
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1330
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1331
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1332
    </exec>
1333
1334
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1335 2639 harris
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1336 2598 harris
    </exec>
1337
  </target>
1338
1339 2737 jones
    <!-- LSID Authority support -->
1340
    <patternset id="lsid.jars">
1341
        <include name="axis.jar" />
1342 2772 jones
        <include name="commons-discovery-0.2.jar" />
1343 2737 jones
        <include name="jaxrpc.jar" />
1344
        <include name="lsid-client-1.1.1.jar" />
1345
        <include name="lsid-server-1.1.1.jar" />
1346
        <include name="saaj.jar" />
1347 2772 jones
        <include name="wsdl4j-1.5.1.jar" />
1348 2737 jones
        <include name="activation.jar" />
1349
        <include name="castor-0.9.5.jar" />
1350
        <include name="dnsjava-1.3.2.jar" />
1351
        <include name="mail.jar" />
1352 2778 jones
        <include name="commons-logging-1.0.4.jar" />
1353
        <!-- These jars may be needed but seem to not actually be,
1354
             so leaving them out for now
1355
        <include name="axis-ant.jar" />
1356 2737 jones
        -->
1357
        <!--<include name="GenCastor.class" />-->
1358
    </patternset>
1359
    <patternset id="lib.jars">
1360
        <include name="httpclient.jar" />
1361
        <include name="log4j-1.2.12.jar" />
1362
        <include name="utilities.jar" />
1363
        <include name="xercesImpl.jar" />
1364
        <include name="xalan.jar" />
1365
        <include name="xml-apis.jar" />
1366
    </patternset>
1367
1368
    <path id="lsid.classpath">
1369
        <fileset dir="${lsid.lib.dir}">
1370
            <patternset refid="lsid.jars"/>
1371
        </fileset>
1372
        <fileset dir="${lib.dir}">
1373
            <patternset refid="lsid.jars"/>
1374
        </fileset>
1375
        <fileset dir="${lib.dir}/xalan">
1376
            <include name="xalan.jar" />
1377
            <include name="xml-apis.jar" />
1378
        </fileset>
1379
        <fileset dir="${build.dir}">
1380
            <include name="metacat-client.jar" />
1381
        </fileset>
1382
    </path>
1383
1384
    <filterset id="configFilters">
1385
        <filter token="LSID_AUTHORITY_HOSTNAME"
1386
                value="${config.hostname}" />
1387
        <filter token="LSID_AUTHORITY_PORT"
1388
                value="${config.port}" />
1389
        <filter token="METADATA_LABELS"
1390
                value="${config.metadataLabelLsid}" />
1391
        <filter token="METACAT_SERVER"
1392
                value="${config.metacatserver}" />
1393
        <filter token="LSID_AUTHORITY_STRING"
1394
                value="${config.lsidauthority}" />
1395
    </filterset>
1396
1397
    <target name="prepare-lsid"
1398
            depends="prepare,utilities,clientjar"
1399
            description="Configure files prior to compilation">
1400
        <mkdir dir="${lsid.build.dir}" />
1401
        <!-- Copy the properties file into the build -->
1402
        <copy file="${conf.dir}/metacat-lsid.properties"
1403
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1404
              overwrite="true">
1405
            <filterset refid="configFilters" />
1406
        </copy>
1407 2817 jones
        <copy file="${conf.dir}/log4j.properties"
1408
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1409
              overwrite="true">
1410
            <filterset refid="configFilters" />
1411
        </copy>
1412 2737 jones
        <!-- Copy config files into the build -->
1413
        <copy todir="${lsid.build.dir}/WEB-INF">
1414
            <fileset dir="${webinf.dir}"
1415
                     includes="**/*.wsdd" />
1416
        </copy>
1417
        <!-- Copy the metadata configuration files into the build -->
1418
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1419
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1420
            <fileset dir="${conf.dir}"
1421
                     includes="**/*.xml" />
1422
            <fileset dir="${conf.dir}"
1423
                     includes="**/*.xslt" />
1424
            <filterset refid="configFilters" />
1425
        </copy>
1426
        <!-- Copy services files into the build -->
1427
        <mkdir dir="${lsid.build.dir}/services" />
1428
        <copy todir="${lsid.build.dir}/services">
1429
            <fileset dir="${services.dir}" />
1430
            <filterset refid="configFilters" />
1431
        </copy>
1432 2778 jones
        <!-- Copy axis files into the build -->
1433
        <mkdir dir="${lsid.build.dir}" />
1434
        <copy todir="${lsid.build.dir}">
1435
            <fileset dir="${conf.dir}/axis"
1436
                     excludes="*.properties"/>
1437
        </copy>
1438
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1439
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1440
            <fileset dir="${conf.dir}/axis"
1441
                     includes="*.properties"/>
1442
        </copy>
1443 2737 jones
    </target>
1444
1445
    <target name="compile-lsid"
1446
            depends="prepare-lsid"
1447
            description="Compile Java sources">
1448
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1449
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1450
               destdir="${lsid.build.dir}/WEB-INF/classes"
1451
               debug="${compile.debug}"
1452
               deprecation="${compile.deprecation}"
1453
               optimize="${compile.optimize}">
1454
            <classpath refid="lsid.classpath" />
1455
        </javac>
1456
    </target>
1457
1458
    <target name="war-lsid"
1459
            depends="compile-lsid"
1460
            description="Create a war file for the application">
1461
        <mkdir dir="${dist.dir}" />
1462
        <war destfile="${dist.dir}/${authority.context}.war"
1463
             webxml="${webinf.dir}/web.xml">
1464
            <fileset dir="${lsid.build.dir}" />
1465
            <lib dir="${lsid.lib.dir}">
1466
                <patternset refid="lsid.jars"/>
1467
            </lib>
1468
            <lib dir="${lib.dir}">
1469
                <patternset refid="lib.jars"/>
1470
            </lib>
1471
            <lib dir="${lib.dir}/xalan">
1472
                <include name="xalan.jar" />
1473
                <include name="xml-apis.jar" />
1474
            </lib>
1475
            <lib dir="${build.dir}">
1476
                <include name="metacat-client.jar" />
1477
            </lib>
1478
        </war>
1479
    </target>
1480
1481
    <target name="deploy-lsid"
1482
            depends="war-lsid"
1483
            description="Deploy LSID war to servlet container">
1484
        <delete dir="${deploy.dir}/${authority.context}" />
1485
        <delete file="${deploy.dir}/${authority.context}.war" />
1486
        <mkdir dir="${deploy.dir}" />
1487
        <copy todir="${deploy.dir}">
1488
            <fileset dir="${dist.dir}" />
1489
        </copy>
1490
    </target>
1491 113 jones
</project>