Project

General

Profile

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