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