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
         </fileset>
894
       </copy>
895 1952 jones
       <copy todir="${war.context}" filtering="yes">
896 822 jones
         <fileset dir="lib">
897
           <exclude name="*.jar"/>
898
           <exclude name="*.properties"/>
899
           <exclude name="web.xml"/>
900 1437 berkley
           <exclude name="**/*.jpg"/>
901
           <exclude name="**/*.png"/>
902
           <exclude name="**/*.gif"/>
903 2778 jones
           <exclude name="lsid_lib/**"/>
904
           <exclude name="lsid_conf/**"/>
905 822 jones
         </fileset>
906
       </copy>
907 1952 jones
       <copy todir="${war.context}" filtering="no">
908 1929 brooke
         <fileset dir="lib">
909
           <include name="**/*.jpg"/>
910
           <include name="**/*.png"/>
911
           <include name="**/*.gif"/>
912
         </fileset>
913
       </copy>
914 1311 berkley
   </target>
915 1929 brooke
916 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
917
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
918
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
919 1929 brooke
   </target>
920
921 2175 tao
   <target name="getConversionXSL" depends="prepare"
922 1954 jones
            unless="styles.not.needed"
923 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
924 2497 sgarg
925 1929 brooke
     <echo>Enter CVS password: </echo>
926 2497 sgarg
     <cvs cvsRoot="${cvsroot}"
927
          package="${eml-module}"
928
          tag="${eml2_0_1-tag}"
929
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
930 2343 sgarg
931
     <mkdir dir="lib/style/common/emlb6toeml2" />
932
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
933 2497 sgarg
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
934 2343 sgarg
         <include name="*.xsl"/>
935
         <include name="*.xml"/>
936
       </fileset>
937
      </copy>
938 1929 brooke
   </target>
939
940 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
941 1783 jones
      <mkdir dir="${build.tests}"/>
942
      <copy todir="${build.tests}" filtering="yes">
943
        <fileset dir="${testdir}">
944
          <include name="edu/**"/>
945
        </fileset>
946
      </copy>
947 971 tao
      <!-- copy and compile the tests into a jar file -->
948 1783 jones
      <javac srcdir="${build.tests}"
949
             destdir="${build.tests}"
950 1612 tao
             debug="on"
951 2599 jones
       includes="**/*.java">
952
        <classpath>
953
          <path refid="compile.classpath"/>
954
          <fileset dir="${build.dir}">
955
            <includes name="${name}.jar"/>
956
            <includes name="${name}-client.jar"/>
957
            <includes name="harvester.jar"/>
958
          </fileset>
959
        </classpath>
960
      </javac>
961 204 jones
962 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
963 1783 jones
        basedir="${build.tests}"
964 1311 berkley
                includes="**/*.class" />
965 1822 jones
   </target>
966 971 tao
967 1939 brooke
   <target name="test" depends="testprep"
968
            description="Uses the ant junit task to run all JUnit tests">
969 1822 jones
970 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
971 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
972 971 tao
             haltonerror="no">
973 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
974 971 tao
        <classpath>
975 2599 jones
          <path refid="compile.classpath"/>
976
          <fileset dir="${build.dir}">
977
            <includes name="${name}.jar"/>
978
            <includes name="${name}-client.jar"/>
979
            <includes name="harvester.jar"/>
980
            <includes name="${name}-junittests.jar"/>
981
          </fileset>
982 971 tao
        </classpath>
983
984
        <formatter type="plain" />
985
986
        <batchtest fork="yes" todir="${build.dir}">
987 1783 jones
          <fileset dir="${build.tests}">
988 1116 tao
            <include name="**/*.class" />
989 971 tao
          </fileset>
990
        </batchtest>
991
     </junit>
992
   </target>
993 1103 tao
994 1939 brooke
    <target name="runonetest" depends="testprep"
995
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
996 1500 tao
997 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
998
999 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1000 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1001 1500 tao
             haltonerror="no">
1002 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1003 1500 tao
        <classpath>
1004 2599 jones
          <path refid="compile.classpath"/>
1005
          <fileset dir="${build.dir}">
1006
            <includes name="${name}.jar"/>
1007
            <includes name="${name}-client.jar"/>
1008
            <includes name="harvester.jar"/>
1009
            <includes name="${name}-junittests.jar"/>
1010
          </fileset>
1011 1500 tao
        </classpath>
1012
1013
        <formatter type="plain" />
1014
1015
        <batchtest fork="yes" todir="${build.dir}">
1016 1783 jones
          <fileset dir="${build.tests}">
1017 1500 tao
            <include name="**/${testtorun}.class" />
1018
          </fileset>
1019
        </batchtest>
1020
     </junit>
1021
   </target>
1022
1023 2175 tao
   <target name="testharvester"
1024 2135 costa
           depends="testprep"
1025
           description="Uses the ant junit task to test only the Harvester code">
1026 2175 tao
     <junit printsummary="yes"
1027
            haltonfailure="off"
1028 2135 costa
            fork="yes"
1029
            haltonerror="off">
1030 2599 jones
        <classpath>
1031
          <path refid="compile.classpath"/>
1032
          <fileset dir="${build.dir}">
1033
            <includes name="${name}.jar"/>
1034
            <includes name="${name}-client.jar"/>
1035
            <includes name="harvester.jar"/>
1036
            <includes name="${name}-junittests.jar"/>
1037
          </fileset>
1038
        </classpath>
1039 2135 costa
       <formatter type="plain" />
1040
       <batchtest fork="yes" todir="${build.dir}">
1041
         <fileset dir="${build.tests}">
1042
           <include name="**/harvesterClient/*.class" />
1043
         </fileset>
1044
       </batchtest>
1045
     </junit>
1046
   </target>
1047
1048 1939 brooke
  <target name="gethttpclient" depends="prepare"
1049
            description="checks out and compiles morpho httpclient code">
1050 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
1051 1487 tao
        <cvs cvsRoot="${cvsroot}"
1052 1103 tao
             package="morpho"
1053
             dest="." />
1054 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1055 1103 tao
   </target>
1056
1057
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1058 1939 brooke
   <target name="nettest" depends="install"
1059
            description="compiles and runs the metacatnettest code">
1060 2175 tao
1061 1103 tao
      <echo>***********************************
1062 1311 berkley
      Please run ant gethttpclient first!
1063
      ***********************************
1064 1103 tao
      </echo>
1065
      <!-- copy and compile the tests into a jar file -->
1066 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
1067 1103 tao
      <javac srcdir="${junitnettestsdir}"
1068 1116 tao
             destdir="${build.metacatnettest}"
1069 2599 jones
             includes="**/*.java">
1070
        <classpath>
1071
          <path refid="compile.classpath"/>
1072
          <fileset dir="${build.dir}">
1073
            <includes name="${name}.jar"/>
1074
          </fileset>
1075
        </classpath>
1076
      </javac>
1077 1103 tao
1078
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1079 1116 tao
                    basedir="${build.metacatnettest}"
1080 1103 tao
                    includes="**/*.class" />
1081
1082
      <!-- use the ant "junit" task to run JUnit tests. -->
1083 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1084 1103 tao
             haltonerror="no">
1085 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1086 1103 tao
        <classpath>
1087 2599 jones
          <path refid="compile.classpath"/>
1088
          <fileset dir="${build.dir}">
1089
            <includes name="${name}.jar"/>
1090
            <includes name="${name}-junitnettests.jar"/>
1091
          </fileset>
1092 1103 tao
        </classpath>
1093
1094
        <formatter type="plain" />
1095
1096
        <batchtest fork="yes" todir="${build.dir}">
1097 1116 tao
          <fileset dir="${build.metacatnettest}">
1098
            <include name="**/*.class" />
1099 1103 tao
          </fileset>
1100
        </batchtest>
1101
     </junit>
1102 1311 berkley
   </target>
1103 1103 tao
1104 1939 brooke
   <target name="cleanweb" depends="clean"
1105
            description="deletes tomcat web context dir and all its contents">
1106 1522 berkley
     <delete dir="${installdir}" />
1107
   </target>
1108
1109
1110 1939 brooke
   <target name="clean" depends="init"
1111 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1112 822 jones
       <delete dir="${build.dir}" />
1113 2737 jones
       <delete dir="${dist.dir}" />
1114 2320 jones
   </target>
1115
1116
   <target name="fullclean" depends="clean"
1117
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1118
       <delete file="lib/httpclient.jar" />
1119
       <delete file="lib/utilities.jar" />
1120 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1121
         <fileset dir="${style-common-cvsrelpath}">
1122
           <include name="${eml-css}" />
1123
           <include name="eml-*/*.xsl" />
1124
           <include name="eml-*" />
1125
         </fileset>
1126 2320 jones
       </delete>
1127 113 jones
   </target>
1128
1129 1939 brooke
   <target name="jdoc" depends="prepare"
1130
            description="generates javadoc documentation">
1131 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1132 516 jones
           sourcepath="${build.src}"
1133
           destdir="${build.javadocs}"
1134 113 jones
           author="true"
1135
           version="true"
1136
           use="true"
1137 348 jones
           windowtitle="${Name} API"
1138
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1139 2599 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1140
         <classpath>
1141
           <path refid="compile.classpath"/>
1142
         </classpath>
1143
       </javadoc>
1144 113 jones
   </target>
1145
1146 2461 sgarg
   <target name="dist"
1147
       depends="geteml,jar,protocol,jdoc,getConversionXSL,getutilities"
1148 1939 brooke
            description="prepares a full release distribution">
1149 806 jones
      <mkdir dir="${dist.dir}"/>
1150
      <delete dir="${ver.dir}" />
1151
      <mkdir dir="${ver.dir}"/>
1152
      <copy todir="${ver.dir}">
1153 1311 berkley
        <fileset dir="."
1154 2401 costa
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1155 806 jones
      </copy>
1156
      <copy todir="${ver.dir}" file="build.xml"/>
1157 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1158 882 jones
1159
      <copy todir="${ver.dir}/docs" filtering="yes">
1160
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1161
      </copy>
1162
      <copy todir="${ver.dir}/docs" filtering="no">
1163
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1164
      </copy>
1165 806 jones
      <copy todir="${ver.dir}/docs/dev">
1166
        <fileset dir="${build.dir}/docs"/>
1167
      </copy>
1168 917 berkley
      <copy todir="${ver.dir}/src">
1169
        <fileset dir="${build.dir}/src"/>
1170
      </copy>
1171 2391 tao
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1172
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1173 2395 tao
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1174 2323 jones
      <!--
1175 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
1176
      <delete dir="./${ver.dir}/dist"/>
1177 2323 jones
      -->
1178 882 jones
      <delete file="./${name}-${release}.zip"/>
1179 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1180 882 jones
      <delete file="./${name}-${release}.tar.gz" />
1181 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1182 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
1183 882 jones
                src="./${name}-${release}.tar"/>
1184
      <delete file="./${name}-${release}.tar" />
1185 1311 berkley
  </target>
1186 806 jones
1187 1939 brooke
  <target name="distsrc" depends="dist"
1188
            description="prepares a source distribution">
1189 806 jones
      <mkdir dir="${ver.src}"/>
1190
      <copy todir="${ver.src}">
1191
        <fileset dir="./src"/>
1192
      </copy>
1193 2461 sgarg
      <mkdir dir="${util.dir}"/>
1194
      <copy todir="${util.dir}">
1195
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1196
      </copy>
1197 806 jones
1198 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1199
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1200
      <delete file="./${name}-src-${release}.tar.gz" />
1201
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1202 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1203 882 jones
                src="./${name}-src-${release}.tar"/>
1204
      <delete file="./${name}-src-${release}.tar" />
1205 807 jones
      <delete dir="${dist.dir}"/>
1206 1311 berkley
  </target>
1207 806 jones
1208 1702 tao
   <target name="stylesheettest">
1209 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1210 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1211
      <param name="docid" expression="${input}"/>
1212
      <param name="entitytype" expression="${entitytype}"/>
1213
      <param name="entityindex" expression="${entityindex}"/>
1214
      <outputproperty name="method" value="html"/>
1215
      <outputproperty name="standalone" value="yes"/>
1216
      <outputproperty name="encoding" value="iso8859_1"/>
1217
      <outputproperty name="indent" value="yes"/>
1218
    </xslt>
1219
  </target>
1220 2175 tao
1221 1819 tao
 <target name="gridinit" depends="init">
1222
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
1223
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
1224
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
1225
   <property environment="env"/>
1226
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1227 1820 tao
    <path id="webservicepath">
1228
        <pathelement location="."/>
1229
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1230
        <pathelement location="${build.dest}"/>
1231
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1232
           <include name="*.jar"/>
1233
        </fileset>
1234
      </path>
1235 1819 tao
</target>
1236
1237 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
1238 2175 tao
 </target>
1239
1240 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
1241 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1242 1811 tao
  </target>
1243 2175 tao
1244 1811 tao
  <target name="generateWSDL" depends="compileinterface">
1245
    <echo message="Generating wsdl from ${interface.name} interface"/>
1246
    <java classname="${java2wsdl.tool}"
1247 1814 tao
          dir="${build.src}" fork="yes"
1248 1811 tao
          classpathref="webservicepath"  failonerror="true" >
1249
      <arg value="-P"/>
1250
      <arg value="${interface.name}PortType"/>
1251
      <arg value="-S"/>
1252
      <arg value="${interface.name}Service"/>
1253
      <arg value="-y"/>
1254
      <arg value="WRAPPED"/>
1255
      <arg value="-u"/>
1256
      <arg value="LITERAL"/>
1257
      <arg value="-l"/>
1258
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1259
      <arg value="-n"/>
1260
      <arg value="http://${services.namespace}/${interface.name}"/>
1261
      <arg value="${interface.package}.${interface.name}"/>
1262
    </java>
1263
  </target>
1264 2175 tao
1265 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
1266
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1267 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1268 1811 tao
            fork="yes"
1269
            classpathref="webservicepath" failonerror="true" >
1270
        <arg value="${binding.file}"/>
1271
        <arg value="${wsdl.file}"/>
1272
      </java>
1273
   </target>
1274 2175 tao
1275 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
1276
      <echo message=" Generating stubs " />
1277 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
1278
      <echo message="build.src is ${build.src}"/>
1279 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1280
            classpathref="webservicepath" failonerror="true" >
1281 1814 tao
         <arg value="${wsdl.file}"/>
1282 1811 tao
    </java>
1283
  </target>
1284 2175 tao
1285 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1286
     <echo message=" Compiling stubs " />
1287
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1288
     <echo message=" Compiling impl " />
1289
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1290
  </target>
1291 2175 tao
1292 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1293
     <echo message=" jar stubs classes " />
1294
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1295
     <echo message=" jar impl classes " />
1296
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1297
  </target>
1298 2175 tao
1299 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
1300
     <echo message=" jar the gar file"/>
1301
     <mkdir dir="${build.dir}/gar"/>
1302
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1303
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1304
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1305 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1306
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1307
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1308
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1309 1811 tao
  </target>
1310 2175 tao
1311 1814 tao
  <target name="compilewebclient" depends="prepare">
1312
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1313
  </target>
1314 2175 tao
1315 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1316 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1317 1814 tao
           dir="${build.dest}" fork="yes"
1318
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1319
         <arg value="${serviceUrl}"/>
1320
         <arg value="${docid}"/>
1321
     </java>
1322
  </target>
1323 2598 harris
1324 2639 harris
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1325 2598 harris
1326
    <echo message="Compiling the metatcat shapefile creator"/>
1327
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1328
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1329
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1330
    </exec>
1331
1332
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1333 2639 harris
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1334 2598 harris
    </exec>
1335
  </target>
1336
1337 2737 jones
    <!-- LSID Authority support -->
1338
    <patternset id="lsid.jars">
1339
        <include name="axis.jar" />
1340 2772 jones
        <include name="commons-discovery-0.2.jar" />
1341 2737 jones
        <include name="jaxrpc.jar" />
1342
        <include name="lsid-client-1.1.1.jar" />
1343
        <include name="lsid-server-1.1.1.jar" />
1344
        <include name="saaj.jar" />
1345 2772 jones
        <include name="wsdl4j-1.5.1.jar" />
1346 2737 jones
        <include name="activation.jar" />
1347
        <include name="castor-0.9.5.jar" />
1348
        <include name="dnsjava-1.3.2.jar" />
1349
        <include name="mail.jar" />
1350 2778 jones
        <include name="commons-logging-1.0.4.jar" />
1351
        <!-- These jars may be needed but seem to not actually be,
1352
             so leaving them out for now
1353
        <include name="axis-ant.jar" />
1354 2737 jones
        -->
1355
        <!--<include name="GenCastor.class" />-->
1356
    </patternset>
1357
    <patternset id="lib.jars">
1358
        <include name="httpclient.jar" />
1359
        <include name="log4j-1.2.12.jar" />
1360
        <include name="utilities.jar" />
1361
        <include name="xercesImpl.jar" />
1362
        <include name="xalan.jar" />
1363
        <include name="xml-apis.jar" />
1364
    </patternset>
1365
1366
    <path id="lsid.classpath">
1367
        <fileset dir="${lsid.lib.dir}">
1368
            <patternset refid="lsid.jars"/>
1369
        </fileset>
1370
        <fileset dir="${lib.dir}">
1371
            <patternset refid="lsid.jars"/>
1372
        </fileset>
1373
        <fileset dir="${lib.dir}/xalan">
1374
            <include name="xalan.jar" />
1375
            <include name="xml-apis.jar" />
1376
        </fileset>
1377
        <fileset dir="${build.dir}">
1378
            <include name="metacat-client.jar" />
1379
        </fileset>
1380
    </path>
1381
1382
    <filterset id="configFilters">
1383
        <filter token="LSID_AUTHORITY_HOSTNAME"
1384
                value="${config.hostname}" />
1385
        <filter token="LSID_AUTHORITY_PORT"
1386
                value="${config.port}" />
1387
        <filter token="METADATA_LABELS"
1388
                value="${config.metadataLabelLsid}" />
1389
        <filter token="METACAT_SERVER"
1390
                value="${config.metacatserver}" />
1391
        <filter token="LSID_AUTHORITY_STRING"
1392
                value="${config.lsidauthority}" />
1393
    </filterset>
1394
1395
    <target name="prepare-lsid"
1396
            depends="prepare,utilities,clientjar"
1397
            description="Configure files prior to compilation">
1398
        <mkdir dir="${lsid.build.dir}" />
1399
        <!-- Copy the properties file into the build -->
1400
        <copy file="${conf.dir}/metacat-lsid.properties"
1401
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1402
              overwrite="true">
1403
            <filterset refid="configFilters" />
1404
        </copy>
1405 2817 jones
        <copy file="${conf.dir}/log4j.properties"
1406
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1407
              overwrite="true">
1408
            <filterset refid="configFilters" />
1409
        </copy>
1410 2737 jones
        <!-- Copy config files into the build -->
1411
        <copy todir="${lsid.build.dir}/WEB-INF">
1412
            <fileset dir="${webinf.dir}"
1413
                     includes="**/*.wsdd" />
1414
        </copy>
1415
        <!-- Copy the metadata configuration files into the build -->
1416
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1417
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1418
            <fileset dir="${conf.dir}"
1419
                     includes="**/*.xml" />
1420
            <fileset dir="${conf.dir}"
1421
                     includes="**/*.xslt" />
1422
            <filterset refid="configFilters" />
1423
        </copy>
1424
        <!-- Copy services files into the build -->
1425
        <mkdir dir="${lsid.build.dir}/services" />
1426
        <copy todir="${lsid.build.dir}/services">
1427
            <fileset dir="${services.dir}" />
1428
            <filterset refid="configFilters" />
1429
        </copy>
1430 2778 jones
        <!-- Copy axis files into the build -->
1431
        <mkdir dir="${lsid.build.dir}" />
1432
        <copy todir="${lsid.build.dir}">
1433
            <fileset dir="${conf.dir}/axis"
1434
                     excludes="*.properties"/>
1435
        </copy>
1436
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1437
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1438
            <fileset dir="${conf.dir}/axis"
1439
                     includes="*.properties"/>
1440
        </copy>
1441 2737 jones
    </target>
1442
1443
    <target name="compile-lsid"
1444
            depends="prepare-lsid"
1445
            description="Compile Java sources">
1446
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1447
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1448
               destdir="${lsid.build.dir}/WEB-INF/classes"
1449
               debug="${compile.debug}"
1450
               deprecation="${compile.deprecation}"
1451
               optimize="${compile.optimize}">
1452
            <classpath refid="lsid.classpath" />
1453
        </javac>
1454
    </target>
1455
1456
    <target name="war-lsid"
1457
            depends="compile-lsid"
1458
            description="Create a war file for the application">
1459
        <mkdir dir="${dist.dir}" />
1460
        <war destfile="${dist.dir}/${authority.context}.war"
1461
             webxml="${webinf.dir}/web.xml">
1462
            <fileset dir="${lsid.build.dir}" />
1463
            <lib dir="${lsid.lib.dir}">
1464
                <patternset refid="lsid.jars"/>
1465
            </lib>
1466
            <lib dir="${lib.dir}">
1467
                <patternset refid="lib.jars"/>
1468
            </lib>
1469
            <lib dir="${lib.dir}/xalan">
1470
                <include name="xalan.jar" />
1471
                <include name="xml-apis.jar" />
1472
            </lib>
1473
            <lib dir="${build.dir}">
1474
                <include name="metacat-client.jar" />
1475
            </lib>
1476
        </war>
1477
    </target>
1478
1479
    <target name="deploy-lsid"
1480
            depends="war-lsid"
1481
            description="Deploy LSID war to servlet container">
1482
        <delete dir="${deploy.dir}/${authority.context}" />
1483
        <delete file="${deploy.dir}/${authority.context}.war" />
1484
        <mkdir dir="${deploy.dir}" />
1485
        <copy todir="${deploy.dir}">
1486
            <fileset dir="${dist.dir}" />
1487
        </copy>
1488
    </target>
1489 113 jones
</project>