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