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
  <target name="check-db">
37
    <condition property="use-oracle">
38
      <equals arg1="${database}" arg2="oracle" />
39
    </condition>
40
    <condition property="use-postgresql">
41
      <equals arg1="${database}" arg2="postgresql" />
42
    </condition>
43
    <condition property="use-sqlserver">
44
      <equals arg1="${database}" arg2="sqlserver" />
45
    </condition>
46
  </target>
47
48
  <target name="oracle" if="use-oracle">
49 931 jones
     <!-- Customize these properties if you are using oracle -->
50 1929 brooke
     <echo message="Using oracle..."/>
51 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
52
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
53 1929 brooke
     <property name="jdbc" value="${jdbc_base}/classes111.zip" />
54 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
55
     <property name="other" value="yes"/>
56 2175 tao
     <property name="install-sql"
57 2103 jones
               value="xmltables.sql" />
58 2175 tao
     <property name="upgrade-1.2-sql"
59 2103 jones
               value="upgrade-db-to-1.2.sql" />
60 2175 tao
     <property name="upgrade-1.3-sql"
61 2103 jones
               value="upgrade-db-to-1.3.sql" />
62 2175 tao
     <property name="upgrade-1.4-sql"
63 2103 jones
               value="upgrade-db-to-1.4.sql" />
64 2518 sgarg
     <property name="upgrade-1.5-sql"
65 2431 sgarg
               value="upgrade-db-to-1.5.sql" />
66 2518 sgarg
     <property name="upgrade-1.6-sql"
67
               value="upgrade-db-to-1.6.sql" />
68 925 berkley
   </target>
69 1311 berkley
70 1929 brooke
   <target name="postgresql" if="use-postgresql">
71 931 jones
     <!-- Customize these properties if you are using postgres -->
72 1929 brooke
     <echo message="Using PostgreSQL..."/>
73 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
74 1311 berkley
     <property name="dbAdapter"
75 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
76 1716 berkley
     <property name="jdbc" value="lib/jdbc7.1-1.2.jar" />
77 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
78
     <property name="other" value="yes"/>
79 2175 tao
     <property name="install-sql"
80 2277 jones
               value="xmltables-postgres.sql" />
81 2175 tao
     <property name="upgrade-1.2-sql"
82 2277 jones
               value="upgrade-db-to-1.2-postgres.sql" />
83 2175 tao
     <property name="upgrade-1.3-sql"
84 2277 jones
               value="upgrade-db-to-1.3-postgres.sql" />
85 2175 tao
     <property name="upgrade-1.4-sql"
86 2277 jones
               value="upgrade-db-to-1.4-postgres.sql" />
87 2518 sgarg
     <property name="upgrade-1.5-sql"
88 2431 sgarg
               value="upgrade-db-to-1.5-postgres.sql" />
89 2518 sgarg
     <property name="upgrade-1.6-sql"
90
               value="upgrade-db-to-1.6-postgres.sql" />
91 1744 tao
    </target>
92 2175 tao
93 1929 brooke
   <target name="sqlserver" if="use-sqlserver">
94 1739 tao
     <!-- Customize these properties if you are using SQL server -->
95 1929 brooke
     <echo message="Using SQL Server..."/>
96 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
97
     <property name="dbAdapter"
98
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
99 2296 sgarg
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
100
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
101
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
102 1744 tao
     <!-- Property to indicate is a MSSQL installation-->
103
     <property name="MSSQL" value="yes"/>
104 2175 tao
     <property name="install-sql"
105 2118 costa
               value="xmltables-sqlserver.sql" />
106 1739 tao
   </target>
107 1311 berkley
108 1929 brooke
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
109 1814 tao
      <!-- usr for client testing, generally you don't need change-->
110 2277 jones
      <property name="mcuser" value="uid=jones,o=NCEAS,dc=ecoinformatics,dc=org"/>
111 1783 jones
      <property name="mcpassword" value=""/>
112 1801 tao
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
113
      <property name="mcanotherpassword" value=""/>
114
115 1827 jones
      <property name="debug" value="on" />
116 2053 sgarg
      <property name="debuglevel" value="55" />
117 1716 berkley
118 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
119 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
120 1780 jones
      <property name="utilitiesdir" value="../utilities" />
121 2175 tao
122 931 jones
      <!-- Make sure these paths match the location of the jar files
123
           on your system, the defaults should usually work -->
124 1941 brooke
      <condition property="jsdk" value="${tomcat}/lib/common/servlet.jar">
125
        <equals arg1="${tomcatversion}" arg2="tomcat3" />
126
      </condition>
127
      <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
128
        <equals arg1="${tomcatversion}" arg2="tomcat4" />
129
      </condition>
130 2011 cjones
      <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
131
        <equals arg1="${tomcatversion}" arg2="tomcat5" />
132
      </condition>
133 1941 brooke
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
134
      <echo>*********** set jsdk to ${jsdk}</echo>
135 1311 berkley
      <property name="xmlp"
136 1376 tao
                value="lib/xercesImpl.jar" />
137 1311 berkley
      <property name="cos"
138 931 jones
                value="lib/cos.jar" />
139 939 tao
      <property name="morpho"
140
                value="lib/morpho.jar" />
141 931 jones
      <property name="xalan"
142
                value="lib/xalan/xalan.jar" />
143
      <property name="apis"
144
                value="lib/xalan/xml-apis.jar" />
145 1103 tao
      <property name="httpclient"
146 1780 jones
                value="lib/httpclient.jar" />
147 1470 tao
      <property name="emlparser"
148
                value="lib/eml.jar" />
149
      <property name="configxml"
150
                value="lib/configxml.jar" />
151 1578 tao
      <property name="itislib"
152
                value="lib/itislib.jar" />
153 1487 tao
      <property name="emlparser"
154 2175 tao
155 1487 tao
                value="lib/eml.jar" />
156 1780 jones
      <property name="util"
157
                value="lib/utilities.jar" />
158 1103 tao
  </target>
159
160 931 jones
   <target name="init" depends="config">
161
      <!-- It is less likely you'll need to make any changes from here down,
162
           but customization is possible -->
163 1929 brooke
      <property name="installdir"          value="${webapps}/${context}" />
164
      <property name="temp-dir"            value="/tmp/${context}" />
165
      <property name="name"                value="metacat"/>
166
      <property name="Name"                value="MetaCat"/>
167
      <property name="debugprefix"         value="${Name}:"/>
168 2461 sgarg
      <property name="release"             value="1.5.0"/>
169 1929 brooke
      <property name="replication-path"    value="/${context}/servlet/replication"/>
170 2331 costa
      <property name="harvester-registration-login-path" value="/${context}/harvesterRegistrationLogin"/>
171
      <property name="harvester-registration-path"       value="/${context}/harvesterRegistration"/>
172 1952 jones
      <property name="servlet-path"        value="/${context}/metacat"/>
173 1929 brooke
      <property name="html-path"           value="/${context}"/>
174 2180 tao
      <property name="systemidserver"      value="http://${httpserver}"/>
175 2175 tao
      <property name="style-common-relpath"
176 1933 brooke
                                           value="/style/common"/>
177 2175 tao
      <property name="style-common-cvsrelpath"
178 1938 brooke
                                           value="lib${style-common-relpath}"/>
179 2175 tao
      <property name="style-common-fullpath"
180 1933 brooke
                                           value="/${installdir}${style-common-relpath}"/>
181 2343 sgarg
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
182 2175 tao
      <property name="style-common-path"
183 1933 brooke
                                           value="/${context}${style-common-relpath}"/>
184 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
185
      <property name="style-skins-path"    value="/${context}${style-skins-relpath}"/>
186
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
187 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
188 1929 brooke
      <property name="config-dir"          value="${webapps}/${style-skins-path}" />
189 2461 sgarg
      <property name="util-module"         value="utilities" />
190 1929 brooke
      <property name="eml-module"          value="eml" />
191
      <property name="eml-version"         value="2.0.0beta6" />
192
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
193 2232 sgarg
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
194 2477 sgarg
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1_UPDATE_1" />
195 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
196
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
197
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
198 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
199 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
200
      <property name="eml-module.default.css"
201
                                           value="default.css"/>
202 348 jones
203 1929 brooke
      <!-- Config for registry variables -->
204 1933 brooke
      <property name="scope"               value="obfs"/>
205
      <property name="responseForm"        value="genericResponse.tmpl"/>
206
      <property name="entryForm"           value="entryForm.tmpl"/>
207
      <property name="guide"               value="genericGuide.tmpl"/>
208 2343 sgarg
      <property name="confirmData"         value="confirmData.tmpl"/>
209
      <property name="deleteData"          value="deleteData.tmpl"/>
210
      <property name="genericHeader"       value="genericHeader.tmpl"/>
211
      <property name="genericFooter"       value="genericFooter.tmpl"/>
212
      <property name="adminname"           value="KNB Support"/>
213
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
214 1929 brooke
215 2343 sgarg
      <property name="defaultStage"        value="initregister"/>
216
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
217
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
218
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
219
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
220
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
221
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
222
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
223
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
224
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
225
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
226
      <property name="register"            value="ldapRegister.tmpl"/>
227
      <property name="searchResults"       value="searchResults.tmpl"/>
228
229
      <filter token="scope"                value="${scope}"/>
230
      <filter token="responseForm"         value="${responseForm}"/>
231
      <filter token="entryForm"            value="${entryForm}"/>
232
      <filter token="guide"                value="${guide}"/>
233
      <filter token="confirmData"          value="${confirmData}"/>
234
      <filter token="deleteData"           value="${deleteData}"/>
235
      <filter token="genericHeader"        value="${genericHeader}"/>
236
      <filter token="genericFooter"        value="${genericFooter}"/>
237
      <filter token="adminname"            value="${adminname}"/>
238
      <filter token="recipient"            value="${recipient}"/>
239
240
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
241
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
242
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
243
      <filter token="ldap_password"        value="ldap_password"/>
244
      <filter token="mailhost"             value="smtp.ecoinformatics.org"/>
245
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
246 2461 sgarg
      <filter token="cgiurl"               value="http://${server}/cgi-bin/ldapweb.cgi"/>
247 2343 sgarg
248 1311 berkley
      <property name="cpath"
249 1986 jones
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}"/>
250 882 jones
251
      <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 1009 tao
      <filter token="context" value="${context}"/>
295 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
296 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
297 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
298 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
299 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
300 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
301 2308 jones
      <filter token="administrators" value="${administrators}"/>
302 1487 tao
303 2343 sgarg
      <filter token="defaultStage" value="${defaultStage}"/>
304
      <filter token="defaultHeader" value="${defaultHeader}"/>
305
      <filter token="defaultFooter" value="${defaultFooter}"/>
306
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
307
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
308
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
309
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
310
      <filter token="registerFailed" value="${registerFailed}"/>
311
      <filter token="registerLter" value="${registerLter}"/>
312
      <filter token="registerMatch" value="${registerMatch}"/>
313
      <filter token="registerSuccess" value="${registerSuccess}"/>
314
      <filter token="register" value="${register}"/>
315
      <filter token="searchResults" value="${searchResults}"/>
316
317 254 jones
      <property name="srcdir" value="./src" />
318 1783 jones
      <property name="testdir" value="./test" />
319 2277 jones
      <property name="testtorun" value="BuildIndexTest" />
320 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
321
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
322 348 jones
      <property name="build.dir" value="./build"/>
323
      <property name="build.src" value="${build.dir}/src"/>
324
      <property name="build.dest" value="${build.dir}/classes"/>
325 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
326 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
327
      <property name="build.tests" value="${build.dir}/tests"/>
328 1778 tao
      <property name="build.tmp" value="${build.dir}/tmp"/>
329 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
330
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
331 348 jones
      <property name="build.data" value="${build.dir}/data"/>
332 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
333 1952 jones
      <property name="build.war" value="${build.dir}/war"/>
334 348 jones
335 882 jones
      <property name="dist.dir" value="dist"/>
336 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
337
      <property name="ver.src" value="${ver.dir}/src"/>
338 2461 sgarg
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
339 2401 costa
	  <!-- directories for creating a Harvest List Editor distribution -->
340
      <property name="dist.dir.hle" value="disthle"/>
341
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
342 806 jones
343 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
344 2317 jones
      <condition property="utilities.required">
345
        <or>
346
          <not><available file="lib/httpclient.jar"/></not>
347
          <not><available file="lib/utilities.jar"/></not>
348
        </or>
349
      </condition>
350 2318 jones
      <condition property="eml.required">
351
        <or>
352
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
353
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
354
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
355
        </or>
356
      </condition>
357 113 jones
   </target>
358 1311 berkley
359 348 jones
   <target name="prepare" depends="init">
360
      <mkdir dir="${build.dir}"/>
361
      <mkdir dir="${build.src}"/>
362
      <mkdir dir="${build.dest}"/>
363 516 jones
      <mkdir dir="${build.javadocs}"/>
364 1778 tao
      <mkdir dir="${build.tmp}"/>
365 348 jones
366 822 jones
      <copy todir="${build.src}" filtering="yes">
367
        <fileset dir="${srcdir}">
368
          <include name="edu/**"/>
369
          <include name="com/**"/>
370 877 jones
          <include name="**/*.sql"/>
371 822 jones
          <exclude name="**/CVS*"/>
372
          <exclude name="**/.#*"/>
373
        </fileset>
374
      </copy>
375 2344 sgarg
      <available file="lib/style/common/emlb6toeml2" type="dir"
376 1954 jones
                 property="styles.not.needed"/>
377 348 jones
   </target>
378
379 1939 brooke
   <target name="compile" depends="prepare,utilities"
380 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
381 1939 brooke
382 1311 berkley
       <javac srcdir="${build.src}"
383
              destdir="${build.dest}"
384
              classpath="${cpath}"
385 1827 jones
              debug="${debug}"
386 2135 costa
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java"/>
387 1311 berkley
   </target>
388 113 jones
389 2322 jones
   <target name="jar" depends="compile,geteml"
390 1939 brooke
    description="Compiles and jars metacat java code to metacat.jar in build dir">
391
392 353 jones
       <delete file="${build.dir}/${name}.jar" />
393 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
394 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
395 1311 berkley
   </target>
396
397 1939 brooke
   <target name="protocol" depends="compile"
398
    description="Compiles and jars protocol java code to protocol.jar in build dir">
399 635 jones
       <delete file="${build.dir}/protocol.jar" />
400
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
401
            includes="**/protocols/" />
402 1311 berkley
   </target>
403 113 jones
404 2317 jones
   <target name="utilities" depends="config" if="utilities.required">
405 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
406
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
407 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
408
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
409
   </target>
410
411 2461 sgarg
   <target name="getutilities" depends="prepare"
412
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
413
     <echo>Enter CVS password: </echo>
414
     <cvs cvsRoot="${cvsroot}"
415 2468 sgarg
          package="${util-module}"
416 2461 sgarg
          dest="${build.tmp}" />
417
   </target>
418
419 1939 brooke
   <target name="client" depends="utilities, prepare"
420
    description="Compiles metacat-client java code to build dir">
421 1780 jones
       <javac srcdir="${build.src}"
422
              destdir="${build.dest}"
423
              classpath="${cpath}"
424
              includes="edu/ucsb/nceas/metacat/client/*" />
425
   </target>
426
427 1939 brooke
   <target name="clientjar" depends="client"
428
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
429 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
430
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
431
            includes="**/metacat/client/" />
432
   </target>
433
434 2059 costa
   <target name="harvester" depends="client"
435 1950 costa
           description="Compiles harvester java code to build dir">
436
       <echo message="classpath is:   ${cpath}"/>
437
       <javac srcdir="${build.src}"
438
              destdir="${build.dest}"
439
              classpath="${cpath}"
440
              includes="edu/ucsb/nceas/metacat/harvesterClient/*" />
441
   </target>
442
443
   <target name="harvesterjar" depends="harvester"
444 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
445
       <delete file="${build.dir}/harvester.jar" />
446
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
447 1950 costa
            includes="**/metacat/harvesterClient/" />
448
   </target>
449
450 2369 costa
   <target name="harvestListEditorDist" depends="harvesterjar"
451
           description="Prepares a distribution of the Harvest List Editor tool">
452 2401 costa
       <mkdir dir="${dist.dir.hle}"/>
453
       <delete dir="${ver.dir.hle}" />
454
       <mkdir dir="${ver.dir.hle}"/>
455
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
456
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
457
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
458
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
459
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
460
       <delete file="./harvest-list-editor-${release}.zip"/>
461
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
462
       <delete file="./harvest-list-editor-${release}.tar.gz" />
463
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
464
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
465
             src="./harvest-list-editor-${release}.tar"/>
466
       <delete file="./harvest-list-editor-${release}.tar" />
467 2369 costa
   </target>
468
469 2318 jones
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
470 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
471
472 2318 jones
   <target name="getemlpre2" depends="prepare" if="eml.required"
473 1939 brooke
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
474 1612 tao
     <echo>Enter CVS password: </echo>
475
     <cvs cvsRoot="${cvsroot}"
476
          package="${eml-module}"
477
          tag="${eml-tag}"
478 1939 brooke
          dest="${build.tmp}/eml_${eml-tag}" />
479 1612 tao
     <mkdir dir="lib/dtd" />
480
     <copy todir="lib/dtd" filtering="yes">
481 1939 brooke
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
482 1612 tao
         <include name="*.dtd"/>
483
       </fileset>
484
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
485
     </copy>
486 2228 sgarg
487
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
488
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
489
       <include name="**/*.xsl"/>
490
     </fileset>
491
     </copy>
492 1939 brooke
   </target>
493
494 2318 jones
   <target name="geteml2+" depends="prepare" if="eml.required"
495 1939 brooke
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
496
     <echo>Enter CVS password: </echo>
497 1612 tao
     <cvs cvsRoot="${cvsroot}"
498
          package="${eml-module}"
499 2228 sgarg
          tag="${eml2_0_0-tag}"
500
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
501
     <mkdir dir="lib/schema/eml-2.0.0" />
502
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
503
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
504 1612 tao
         <include name="*.xsd"/>
505
       </fileset>
506 2175 tao
507 1939 brooke
       <!-- shouldn't we have a mapper here like this??
508
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
509 2175 tao
510
       Jing's code didn't nave one - does it need to be added?
511 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
512 2175 tao
513 1612 tao
     </copy>
514 1939 brooke
     <antcall target="copyxsl">
515 2228 sgarg
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
516
        <param name="dirname" value="eml-2.0.0" />
517 1939 brooke
     </antcall>
518 2228 sgarg
519
     <echo>Enter CVS password: </echo>
520
     <cvs cvsRoot="${cvsroot}"
521
          package="${eml-module}"
522
          tag="${eml2_0_1-tag}"
523
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
524
     <mkdir dir="lib/schema/eml-2.0.1" />
525
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
526
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
527
         <include name="*.xsd"/>
528
       </fileset>
529
     </copy>
530
     <antcall target="copyxsl">
531
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
532
        <param name="dirname" value="eml-2.0.1" />
533
     </antcall>
534 1939 brooke
   </target>
535
536 2175 tao
   <target  name="copyxsl"
537 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
538
539
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
540 2175 tao
541 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
542
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
543 1929 brooke
       <include name="**/*.xsl"/>
544 1612 tao
     </fileset>
545
     </copy>
546 1939 brooke
547 2175 tao
548
     <!-- now copy default css from eml module and put it in style-common-path
549 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
550 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
551 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
552 1612 tao
553 1463 tao
   </target>
554 2175 tao
555
556
557 2322 jones
   <target name="register-schemas" depends="prepare"
558
   description="Registers the Schemas with a new Metacat instance">
559 877 jones
     <echo/>
560 2322 jones
     <echo>Registering the Schemas with the new Metacat instance...</echo>
561 877 jones
     <sql driver="${dbDriver}"
562 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
563 877 jones
          url="${jdbc-connect}"
564
          userid="${user}"
565
          password="${password}"
566 1593 tao
          src="${build.src}/loaddtdschema.sql" />
567 877 jones
   </target>
568 1716 berkley
569 1939 brooke
   <target name="installdb" depends="prepare"
570
            description="Installs the database tables">
571 1827 jones
     <echo/>
572
     <echo>Installing the database tables...</echo>
573 2445 sgarg
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
574 1827 jones
     <sql driver="${dbDriver}"
575
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
576
          url="${jdbc-connect}"
577
          userid="${user}"
578
          password="${password}"
579 2103 jones
          src="${build.src}/${install-sql}" />
580 1827 jones
   </target>
581
582 1939 brooke
   <target name="upgrade12" depends="prepare"
583
            description="Updates the database tables to upgrade to version 1.2">
584 1827 jones
     <echo/>
585
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
586
     <sql driver="${dbDriver}"
587
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
588
          url="${jdbc-connect}"
589
          userid="${user}"
590
          password="${password}"
591 2103 jones
          src="${build.src}/${upgrade-1.2-sql}" />
592 1827 jones
   </target>
593
594 1939 brooke
   <target name="upgrade13" depends="prepare"
595
            description="Updates the database tables to upgrade to version 1.3">
596 1827 jones
     <echo/>
597
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
598
     <sql driver="${dbDriver}"
599
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
600
          url="${jdbc-connect}"
601
          userid="${user}"
602
          password="${password}"
603 2103 jones
          src="${build.src}/${upgrade-1.3-sql}" />
604 1827 jones
   </target>
605
606 2103 jones
   <target name="upgrade14" depends="prepare"
607
            description="Updates the database tables to upgrade to version 1.4">
608
     <echo/>
609
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
610
     <sql driver="${dbDriver}"
611
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
612
          url="${jdbc-connect}"
613
          userid="${user}"
614
          password="${password}"
615
          src="${build.src}/${upgrade-1.4-sql}" />
616
   </target>
617
618 2395 tao
   <target name="upgrade15" depends="sqlupgrade15"
619 2391 tao
           description="Updates the database tables to upgrade to version 1.5">
620 2353 sgarg
     <echo/>
621 2461 sgarg
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
622 2353 sgarg
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
623 2391 tao
           todir="${build.tmp}" filtering="yes"/>
624 2461 sgarg
625 2353 sgarg
     <javac srcdir="${build.tmp}"
626
            destdir="${build.tmp}"
627
            classpath="${cpath}"
628
            debug="${debug}"
629
            includes="upgrade_db_to_1_5.java"/>
630 2461 sgarg
631 2353 sgarg
     <java classname="upgrade_db_to_1_5"
632
           classpath="${cpath}:${build.tmp}"/>
633
634 2393 tao
   </target>
635 2461 sgarg
636 2518 sgarg
   <target name="upgrade16" depends="prepare"
637
            description="Updates the database tables from version 1.5 to version 1.6">
638
     <echo/>
639
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
640
     <sql driver="${dbDriver}"
641
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
642
          url="${jdbc-connect}"
643
          userid="${user}"
644
          password="${password}"
645
          src="${build.src}/${upgrade-1.6-sql}" />
646
   </target>
647
648
649 2395 tao
   <target name="sqlupgrade15" depends="prepare">
650
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
651 2393 tao
      <sql driver="${dbDriver}"
652
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
653
          url="${jdbc-connect}"
654
          userid="${user}"
655
          password="${password}"
656
          src="${build.src}/${upgrade-1.5-sql}" />
657 2444 sgarg
      <sql driver="${dbDriver}"
658
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
659
          url="${jdbc-connect}"
660
          userid="${user}"
661
          password="${password}"
662
          rdbms="oracle"
663
          delimiter="/">
664
        <transaction>
665
           CREATE TRIGGER xml_returnfield_before_insert
666
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
667
           BEGIN
668
              SELECT xml_returnfield_id_seq.nextval
669
                 INTO :new.returnfield_id
670
                 FROM dual;
671
           END;
672
           /
673
        </transaction>
674
        <transaction>
675
           CREATE TRIGGER xml_queryresult_before_insert
676
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
677
           BEGIN
678
              SELECT xml_queryresult_id_seq.nextval
679
              INTO :new.queryresult_id
680
              FROM dual;
681
           END;
682
           /
683
        </transaction>
684
      </sql>
685 2393 tao
   </target>
686 2353 sgarg
687 1952 jones
   <target name="install" depends="war" description="* Full Install *">
688 1079 tao
       <mkdir dir="${datafilepath}" />
689 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
690 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
691 1929 brooke
       <mkdir dir="${temp-dir}"/>
692
       <chmod dir="${temp-dir}" perm="ug+w" />
693 1952 jones
       <copy file="${build.dir}/${context}.war" todir="${webapps}"/>
694
   </target>
695 2175 tao
696
   <target name="upgrade" depends="install"
697 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
698
       <unwar src="${webapps}/${context}.war" dest="${webapps}/${context}" />
699
   </target>
700
701 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
702 1952 jones
            description="Install Registry">
703 2175 tao
704 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
705
            todir="${inst.cgi.dir}" filtering="yes"/>
706
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
707 2175 tao
708 1952 jones
      <mkdir dir="${temp-dir}" />
709 2343 sgarg
      <copy todir="${temp-dir}" filtering="yes">
710
       <fileset dir="lib/style/common/emlb6toeml2">
711 1952 jones
         <include name="*.xsl"/>
712
         <include name="*.xml"/>
713
       </fileset>
714 2343 sgarg
      </copy>
715 1952 jones
716
      <echo message="Install Registry completed." />
717
   </target>
718
719 2343 sgarg
   <target name="install-ldap" depends="init">
720
      <copy file="${srcdir}/perl/ldapweb.cgi"
721
            todir="${inst.cgi.dir}" filtering="yes"/>
722
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
723
      <copy file="lib/ldapweb.cfg"
724
            todir="${inst.cgi.dir}" filtering="yes"/>
725
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
726
      <mkdir dir="${templates.dir}" />
727
      <copy todir="${templates.dir}" filtering="yes">
728
        <fileset dir="lib/style/common/templates">
729
            <include name="${defaultChangePass}"/>
730
            <include name="${defaultResetPass}"/>
731
            <include name="${changePassSuccess}"/>
732
            <include name="${resetPassSuccess}"/>
733
            <include name="${registerFailed}"/>
734
            <include name="${registerLter}"/>
735
            <include name="${registerMatch}"/>
736
            <include name="${registerSuccess}"/>
737
            <include name="${register}"/>
738
            <include name="${searchResults}"/>
739
        </fileset>
740
      </copy>
741
      <echo message="ldapweb install complete." />
742
   </target>
743
744
745 2175 tao
   <target name="install-skin" depends="init"
746 2052 sgarg
            description="Install a Skin">
747
748 2175 tao
      <input message="Please enter name of the skin"
749 2052 sgarg
             addproperty="skin-name"/>
750
751
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
752
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
753
       <fileset dir="lib/style/skins/${skin-name}">
754 2054 sgarg
           <exclude name="*.png"/>
755
           <exclude name="*.gif"/>
756 2210 jones
           <exclude name="*.jpg"/>
757 2277 jones
           <exclude name="**/CVS*"/>
758
           <exclude name="**/.#*"/>
759 2052 sgarg
       </fileset>
760
      </copy>
761 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
762
       <fileset dir="lib/style/skins/${skin-name}">
763
           <include name="*.png"/>
764
           <include name="*.gif"/>
765 2210 jones
           <include name="*.jpg"/>
766 2277 jones
           <exclude name="**/CVS*"/>
767
           <exclude name="**/.#*"/>
768 2054 sgarg
       </fileset>
769
      </copy>
770 2277 jones
      <!--
771 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
772
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
773
       <fileset dir="lib/style/skins/${skin-name}/images">
774
           <include name="*.png"/>
775
           <include name="*.gif"/>
776
           <include name="*.jpg"/>
777
       </fileset>
778
      </copy>
779 2277 jones
      -->
780 2052 sgarg
781
      <echo message="Install Skin completed." />
782
   </target>
783
784 1952 jones
   <target name="war" depends="warPrepare,warMSSQL"
785
            description="Create a web archive (WAR) for servlet deployment">
786 2175 tao
       <war destfile="${build.dir}/${context}.war"
787 1952 jones
            webxml="${build.war}/web.xml">
788
         <fileset dir="${war.context}"/>
789
         <lib dir="${war.lib}"/>
790
         <webinf dir="${war.webinf}"/>
791
       </war>
792
   </target>
793
794 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
795 1952 jones
            description="Prepare files for creating a web archive (WAR)">
796
797
       <property name="war.lib" value="${build.war}/lib" />
798
       <property name="war.webinf" value="${build.war}/WEB-INF" />
799
       <property name="war.context" value="${build.war}/${context}" />
800
       <mkdir dir="${war.lib}" />
801
       <mkdir dir="${war.webinf}" />
802
       <mkdir dir="${war.context}" />
803
804
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
805
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
806 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
807 1952 jones
       <copy todir="${war.lib}" filtering="no">
808 1823 jones
         <fileset dir="lib">
809
           <include name="*.jar"/>
810
         </fileset>
811
         <fileset dir="lib/xalan">
812
           <include name="*.jar"/>
813
         </fileset>
814
       </copy>
815 1952 jones
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
816 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
817 1952 jones
             tofile="${build.war}/web.xml" />
818
       <copy file="lib/metacat.properties" todir="${war.webinf}"
819 1951 jones
             filtering="yes" />
820 1952 jones
       <copy todir="${war.context}" filtering="no">
821 822 jones
         <fileset dir="lib">
822
           <include name="**/*.jpg"/>
823
           <include name="**/*.png"/>
824
           <include name="**/*.gif"/>
825
         </fileset>
826
       </copy>
827 1952 jones
       <copy todir="${war.context}" filtering="yes">
828 822 jones
         <fileset dir="lib">
829
           <exclude name="*.jar"/>
830
           <exclude name="*.properties"/>
831
           <exclude name="web.xml"/>
832 1437 berkley
           <exclude name="**/*.jpg"/>
833
           <exclude name="**/*.png"/>
834
           <exclude name="**/*.gif"/>
835 822 jones
         </fileset>
836
       </copy>
837 1952 jones
       <copy todir="${war.context}" filtering="no">
838 1929 brooke
         <fileset dir="lib">
839
           <include name="**/*.jpg"/>
840
           <include name="**/*.png"/>
841
           <include name="**/*.gif"/>
842
         </fileset>
843
       </copy>
844 1311 berkley
   </target>
845 1929 brooke
846 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
847
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
848
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
849 1929 brooke
   </target>
850
851 2175 tao
   <target name="getConversionXSL" depends="prepare"
852 1954 jones
            unless="styles.not.needed"
853 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
854 2497 sgarg
855 1929 brooke
     <echo>Enter CVS password: </echo>
856 2497 sgarg
     <cvs cvsRoot="${cvsroot}"
857
          package="${eml-module}"
858
          tag="${eml2_0_1-tag}"
859
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
860 2343 sgarg
861
     <mkdir dir="lib/style/common/emlb6toeml2" />
862
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
863 2497 sgarg
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
864 2343 sgarg
         <include name="*.xsl"/>
865
         <include name="*.xml"/>
866
       </fileset>
867
      </copy>
868 1929 brooke
   </target>
869
870 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
871 1783 jones
      <mkdir dir="${build.tests}"/>
872
      <copy todir="${build.tests}" filtering="yes">
873
        <fileset dir="${testdir}">
874
          <include name="edu/**"/>
875
        </fileset>
876
      </copy>
877 971 tao
      <!-- copy and compile the tests into a jar file -->
878 1783 jones
      <javac srcdir="${build.tests}"
879
             destdir="${build.tests}"
880 2135 costa
             classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar"
881 1612 tao
             debug="on"
882 1311 berkley
       includes="**/*.java" />
883 204 jones
884 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
885 1783 jones
        basedir="${build.tests}"
886 1311 berkley
                includes="**/*.class" />
887 1822 jones
   </target>
888 971 tao
889 1939 brooke
   <target name="test" depends="testprep"
890
            description="Uses the ant junit task to run all JUnit tests">
891 1822 jones
892 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
893 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
894 971 tao
             haltonerror="no">
895 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
896 971 tao
        <classpath>
897 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
898 971 tao
        </classpath>
899
900
        <formatter type="plain" />
901
902
        <batchtest fork="yes" todir="${build.dir}">
903 1783 jones
          <fileset dir="${build.tests}">
904 1116 tao
            <include name="**/*.class" />
905 971 tao
          </fileset>
906
        </batchtest>
907
     </junit>
908
   </target>
909 1103 tao
910 1939 brooke
    <target name="runonetest" depends="testprep"
911
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
912 1500 tao
913 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
914
915 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
916 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
917 1500 tao
             haltonerror="no">
918 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
919 1500 tao
        <classpath>
920 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
921 1500 tao
        </classpath>
922
923
        <formatter type="plain" />
924
925
        <batchtest fork="yes" todir="${build.dir}">
926 1783 jones
          <fileset dir="${build.tests}">
927 1500 tao
            <include name="**/${testtorun}.class" />
928
          </fileset>
929
        </batchtest>
930
     </junit>
931
   </target>
932
933 2175 tao
   <target name="testharvester"
934 2135 costa
           depends="testprep"
935
           description="Uses the ant junit task to test only the Harvester code">
936 2175 tao
     <junit printsummary="yes"
937
            haltonfailure="off"
938 2135 costa
            fork="yes"
939
            haltonerror="off">
940
       <classpath>
941
         <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar:${build.dir}/${name}-junittests.jar" />
942
       </classpath>
943
       <formatter type="plain" />
944
       <batchtest fork="yes" todir="${build.dir}">
945
         <fileset dir="${build.tests}">
946
           <include name="**/harvesterClient/*.class" />
947
         </fileset>
948
       </batchtest>
949
     </junit>
950
   </target>
951
952 1939 brooke
  <target name="gethttpclient" depends="prepare"
953
            description="checks out and compiles morpho httpclient code">
954 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
955 1487 tao
        <cvs cvsRoot="${cvsroot}"
956 1103 tao
             package="morpho"
957
             dest="." />
958 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
959 1103 tao
   </target>
960
961
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
962 1939 brooke
   <target name="nettest" depends="install"
963
            description="compiles and runs the metacatnettest code">
964 2175 tao
965 1103 tao
      <echo>***********************************
966 1311 berkley
      Please run ant gethttpclient first!
967
      ***********************************
968 1103 tao
      </echo>
969
      <!-- copy and compile the tests into a jar file -->
970 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
971 1103 tao
      <javac srcdir="${junitnettestsdir}"
972 1116 tao
             destdir="${build.metacatnettest}"
973 1103 tao
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
974
             includes="**/*.java" />
975
976
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
977 1116 tao
                    basedir="${build.metacatnettest}"
978 1103 tao
                    includes="**/*.class" />
979
980
      <!-- use the ant "junit" task to run JUnit tests. -->
981 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
982 1103 tao
             haltonerror="no">
983 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
984 1103 tao
        <classpath>
985 1807 tao
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
986 1103 tao
        </classpath>
987
988
        <formatter type="plain" />
989
990
        <batchtest fork="yes" todir="${build.dir}">
991 1116 tao
          <fileset dir="${build.metacatnettest}">
992
            <include name="**/*.class" />
993 1103 tao
          </fileset>
994
        </batchtest>
995
     </junit>
996 1311 berkley
   </target>
997 1103 tao
998 1939 brooke
   <target name="cleanweb" depends="clean"
999
            description="deletes tomcat web context dir and all its contents">
1000 1522 berkley
     <delete dir="${installdir}" />
1001
   </target>
1002
1003
1004 1939 brooke
   <target name="clean" depends="init"
1005 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1006 822 jones
       <delete dir="${build.dir}" />
1007 2320 jones
   </target>
1008
1009
   <target name="fullclean" depends="clean"
1010
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1011
       <delete file="lib/httpclient.jar" />
1012
       <delete file="lib/utilities.jar" />
1013 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1014
         <fileset dir="${style-common-cvsrelpath}">
1015
           <include name="${eml-css}" />
1016
           <include name="eml-*/*.xsl" />
1017
           <include name="eml-*" />
1018
         </fileset>
1019 2320 jones
       </delete>
1020 113 jones
   </target>
1021
1022 1939 brooke
   <target name="jdoc" depends="prepare"
1023
            description="generates javadoc documentation">
1024 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1025 516 jones
           sourcepath="${build.src}"
1026
           destdir="${build.javadocs}"
1027 2319 jones
           classpath="${cpath}"
1028 113 jones
           author="true"
1029
           version="true"
1030
           use="true"
1031 348 jones
           windowtitle="${Name} API"
1032
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1033 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
1034
       />
1035
   </target>
1036
1037 2461 sgarg
   <target name="dist"
1038
       depends="geteml,jar,protocol,jdoc,getConversionXSL,getutilities"
1039 1939 brooke
            description="prepares a full release distribution">
1040 806 jones
      <mkdir dir="${dist.dir}"/>
1041
      <delete dir="${ver.dir}" />
1042
      <mkdir dir="${ver.dir}"/>
1043
      <copy todir="${ver.dir}">
1044 1311 berkley
        <fileset dir="."
1045 2401 costa
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1046 806 jones
      </copy>
1047
      <copy todir="${ver.dir}" file="build.xml"/>
1048 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1049 882 jones
1050
      <copy todir="${ver.dir}/docs" filtering="yes">
1051
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1052
      </copy>
1053
      <copy todir="${ver.dir}/docs" filtering="no">
1054
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1055
      </copy>
1056 806 jones
      <copy todir="${ver.dir}/docs/dev">
1057
        <fileset dir="${build.dir}/docs"/>
1058
      </copy>
1059 917 berkley
      <copy todir="${ver.dir}/src">
1060
        <fileset dir="${build.dir}/src"/>
1061
      </copy>
1062 2391 tao
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1063
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1064 2395 tao
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1065 2323 jones
      <!--
1066 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
1067
      <delete dir="./${ver.dir}/dist"/>
1068 2323 jones
      -->
1069 882 jones
      <delete file="./${name}-${release}.zip"/>
1070 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1071 882 jones
      <delete file="./${name}-${release}.tar.gz" />
1072 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1073 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
1074 882 jones
                src="./${name}-${release}.tar"/>
1075
      <delete file="./${name}-${release}.tar" />
1076 1311 berkley
  </target>
1077 806 jones
1078 1939 brooke
  <target name="distsrc" depends="dist"
1079
            description="prepares a source distribution">
1080 806 jones
      <mkdir dir="${ver.src}"/>
1081
      <copy todir="${ver.src}">
1082
        <fileset dir="./src"/>
1083
      </copy>
1084 2461 sgarg
      <mkdir dir="${util.dir}"/>
1085
      <copy todir="${util.dir}">
1086
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1087
      </copy>
1088 806 jones
1089 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1090
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1091
      <delete file="./${name}-src-${release}.tar.gz" />
1092
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1093 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1094 882 jones
                src="./${name}-src-${release}.tar"/>
1095
      <delete file="./${name}-src-${release}.tar" />
1096 807 jones
      <delete dir="${dist.dir}"/>
1097 1311 berkley
  </target>
1098 806 jones
1099 1702 tao
   <target name="stylesheettest">
1100 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1101 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1102
      <param name="docid" expression="${input}"/>
1103
      <param name="entitytype" expression="${entitytype}"/>
1104
      <param name="entityindex" expression="${entityindex}"/>
1105
      <outputproperty name="method" value="html"/>
1106
      <outputproperty name="standalone" value="yes"/>
1107
      <outputproperty name="encoding" value="iso8859_1"/>
1108
      <outputproperty name="indent" value="yes"/>
1109
    </xslt>
1110
  </target>
1111 2175 tao
1112 1819 tao
 <target name="gridinit" depends="init">
1113
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
1114
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
1115
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
1116
   <property environment="env"/>
1117
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1118 1820 tao
    <path id="webservicepath">
1119
        <pathelement location="."/>
1120
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1121
        <pathelement location="${build.dest}"/>
1122
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1123
           <include name="*.jar"/>
1124
        </fileset>
1125
      </path>
1126 1819 tao
</target>
1127
1128 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
1129 2175 tao
 </target>
1130
1131 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
1132 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1133 1811 tao
  </target>
1134 2175 tao
1135 1811 tao
  <target name="generateWSDL" depends="compileinterface">
1136
    <echo message="Generating wsdl from ${interface.name} interface"/>
1137
    <java classname="${java2wsdl.tool}"
1138 1814 tao
          dir="${build.src}" fork="yes"
1139 1811 tao
          classpathref="webservicepath"  failonerror="true" >
1140
      <arg value="-P"/>
1141
      <arg value="${interface.name}PortType"/>
1142
      <arg value="-S"/>
1143
      <arg value="${interface.name}Service"/>
1144
      <arg value="-y"/>
1145
      <arg value="WRAPPED"/>
1146
      <arg value="-u"/>
1147
      <arg value="LITERAL"/>
1148
      <arg value="-l"/>
1149
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1150
      <arg value="-n"/>
1151
      <arg value="http://${services.namespace}/${interface.name}"/>
1152
      <arg value="${interface.package}.${interface.name}"/>
1153
    </java>
1154
  </target>
1155 2175 tao
1156 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
1157
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1158 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1159 1811 tao
            fork="yes"
1160
            classpathref="webservicepath" failonerror="true" >
1161
        <arg value="${binding.file}"/>
1162
        <arg value="${wsdl.file}"/>
1163
      </java>
1164
   </target>
1165 2175 tao
1166 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
1167
      <echo message=" Generating stubs " />
1168 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
1169
      <echo message="build.src is ${build.src}"/>
1170 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1171
            classpathref="webservicepath" failonerror="true" >
1172 1814 tao
         <arg value="${wsdl.file}"/>
1173 1811 tao
    </java>
1174
  </target>
1175 2175 tao
1176 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1177
     <echo message=" Compiling stubs " />
1178
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1179
     <echo message=" Compiling impl " />
1180
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1181
  </target>
1182 2175 tao
1183 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1184
     <echo message=" jar stubs classes " />
1185
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1186
     <echo message=" jar impl classes " />
1187
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1188
  </target>
1189 2175 tao
1190 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
1191
     <echo message=" jar the gar file"/>
1192
     <mkdir dir="${build.dir}/gar"/>
1193
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1194
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1195
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1196 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1197
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1198
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1199
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1200 1811 tao
  </target>
1201 2175 tao
1202 1814 tao
  <target name="compilewebclient" depends="prepare">
1203
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1204
  </target>
1205 2175 tao
1206 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1207 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1208 1814 tao
           dir="${build.dest}" fork="yes"
1209
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1210
         <arg value="${serviceUrl}"/>
1211
         <arg value="${docid}"/>
1212
     </java>
1213
  </target>
1214 113 jones
</project>