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