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