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