Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2
<!--
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
  *      '$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 113 jones
-->
32 329 jones
<project name="metacat" default="jar" basedir=".">
33 113 jones
   <target name="init">
34 685 jones
      <property name="jdbc-connect"
35
                value="jdbc:oracle:thin:@dev.nceas.ucsb.edu:1521:exp"/>
36 877 jones
      <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
37 780 berkley
      <property name="installdir" value="/opt/tomcat/webapps/jones" />
38 348 jones
      <property name="name" value="metacat"/>
39
      <property name="Name" value="MetaCat"/>
40 877 jones
      <property name="release" value="1.0.1"/>
41 685 jones
      <property name="web-base-url"
42 811 bojilova
                value="http://knb.ecoinformatics.org"/>
43 845 jones
      <property name="replication-path" value="/servlet/replication"/>
44 780 berkley
      <property name="servlet-path" value="/jones/servlet/metacat"/>
45
      <property name="html-path" value="/jones"/>
46
      <property name="image-path" value="/img/jones" />
47 833 jones
      <property name="style-path" value="/jones/style"/>
48 861 jones
      <property name="server" value="dev.nceas.ucsb.edu"/>
49 780 berkley
      <property name="replication-log" value="/tmp/metacatreplication.log"/>
50 852 jones
      <property name="user" value="jones"/>
51 858 jones
      <property name="password" value="your-pw-goes-here"/>
52 832 jones
      <property name="config-dir" value="${installdir}" />
53
      <property name="default-style" value="knb" />
54 877 jones
      <property name="eml-module" value="mdstandards/eml" />
55
      <property name="eml-version" value="2.0.0beta6" />
56
      <property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6" />
57
      <property name="cvsroot"
58
                value=":ext:jones@cvs.nceas.ucsb.edu:/cvs/pbi" />
59 348 jones
60 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
61 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
62 586 berkley
      <filter token="server" value="${server}"/>
63
      <filter token="replication-log" value="${replication-log}"/>
64 348 jones
      <filter token="release" value="${release}"/>
65
      <filter token="servlet-path" value="${servlet-path}"/>
66 359 bojilova
      <filter token="html-path" value="${html-path}"/>
67 362 jones
      <filter token="user" value="${user}"/>
68
      <filter token="password" value="${password}"/>
69 409 berkley
      <filter token="image-path" value="${image-path}"/>
70 828 jones
      <filter token="style-path" value="${style-path}"/>
71 506 jones
      <filter token="web-base-url" value="${web-base-url}"/>
72 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
73 832 jones
      <filter token="config-dir" value="${config-dir}"/>
74
      <filter token="default-style" value="${default-style}"/>
75 877 jones
      <filter token="eml-version" value="${eml-version}"/>
76
77 254 jones
      <property name="srcdir" value="./src" />
78 348 jones
      <property name="build.dir" value="./build"/>
79
      <property name="build.src" value="${build.dir}/src"/>
80
      <property name="build.dest" value="${build.dir}/classes"/>
81 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
82 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
83
      <property name="build.tests" value="${build.dir}/tests"/>
84
      <property name="build.data" value="${build.dir}/data"/>
85 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
86 409 berkley
      <property name="build.img" value="/opt/httpd/html${image-path}"/>
87 348 jones
88 806 jones
      <property name="dist.dir" value="./dist"/>
89
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
90
      <property name="ver.src" value="${ver.dir}/src"/>
91
92 113 jones
      <property name="oracle_home"
93 329 jones
                value="/oracle01/app/oracle/product/8.1.6" />
94
      <property name="toolsdir"
95
                value="/usr/local/devtools" />
96 113 jones
      <property name="xmlp"
97 329 jones
                value="${toolsdir}/OracleXSU111/lib/xmlparserv2.jar" />
98 185 jones
      <property name="xmlp2"
99 329 jones
                value="${toolsdir}/xerces-1_1_3/xerces.jar" />
100 113 jones
      <property name="jdbc"
101
                value="${oracle_home}/jdbc/lib/classes111.zip" />
102
      <property name="jserv"
103
                value="/usr/lib/apache/ApacheJServ.jar" />
104
      <property name="jsdk"
105 329 jones
                value="${toolsdir}/jakarta-tomcat/lib/servlet.jar" />
106 213 jones
      <property name="srb"
107
                value="lib/srbrmi" />
108 798 jones
      <property name="cos"
109
                value="lib/cos.jar" />
110 113 jones
      <property name="cpath"
111 798 jones
                value="${xmlp2}:${xmlp}:${jdbc}:${jserv}:${jsdk}:${srb}:${cos}"/>
112 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
113 348 jones
114 113 jones
   </target>
115
116 348 jones
   <target name="prepare" depends="init">
117
      <mkdir dir="${build.dir}"/>
118
      <mkdir dir="${build.src}"/>
119
      <mkdir dir="${build.dest}"/>
120 516 jones
      <mkdir dir="${build.javadocs}"/>
121 348 jones
122 822 jones
      <copy todir="${build.src}" filtering="yes">
123
        <fileset dir="${srcdir}">
124
          <include name="edu/**"/>
125
          <include name="com/**"/>
126 877 jones
          <include name="**/*.sql"/>
127 822 jones
          <exclude name="**/CVS*"/>
128
          <exclude name="**/.#*"/>
129
        </fileset>
130
      </copy>
131 348 jones
   </target>
132
133
   <target name="compile" depends="prepare">
134
       <javac srcdir="${build.src}"
135
              destdir="${build.dest}"
136 257 jones
              classpath="${cpath}"
137
              excludes="**/*.sql" />
138 822 jones
       <copy file="lib/metacat.properties"
139
             tofile="${build.dest}/${package.home}/metacat.properties"
140
             filtering="yes" />
141
       <copy file="lib/srbProps.properties"
142
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
143 113 jones
   </target>
144
145 204 jones
   <target name="jar" depends="compile">
146 353 jones
       <delete file="${build.dir}/${name}.jar" />
147 822 jones
       <copy todir="${build.dest}">
148
         <fileset dir="lib/srbrmi"/>
149
       </copy>
150 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
151
            excludes="**/protocols/" />
152 113 jones
   </target>
153 635 jones
154
   <target name="protocol" depends="compile">
155
       <delete file="${build.dir}/protocol.jar" />
156
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
157
            includes="**/protocols/" />
158
   </target>
159 113 jones
160 877 jones
   <target name="getdtd" depends="prepare">
161
        <cvs cvsRoot="${cvsroot}"
162
             package="${eml-module}"
163
             tag="${eml-tag}"
164
             dest="${build.src}" />
165
   </target>
166
167
   <target name="instdtd" depends="getdtd">
168
       <mkdir dir="${installdir}/dtd" />
169
       <copy todir="${installdir}/dtd" filtering="yes">
170
         <fileset dir="${build.src}/${eml-module}">
171
           <include name="*.dtd"/>
172
         </fileset>
173
         <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
174
       </copy>
175
   </target>
176
177
   <target name="dtdsql" depends="prepare">
178
     <echo/>
179
     <echo>Registering the DTDs with the new Metacat instance...</echo>
180
     <sql driver="${dbDriver}"
181
          classpath="${jdbc}"
182
          url="${jdbc-connect}"
183
          userid="${user}"
184
          password="${password}"
185
          src="${build.src}/loaddtd.sql" />
186
   </target>
187
188 204 jones
   <target name="install" depends="jar">
189 329 jones
       <mkdir dir="${installdir}/WEB-INF/lib" />
190 822 jones
       <copy file="${build.dir}/${name}.jar"
191
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
192
       <copy file="${xmlp2}"
193
             tofile="${installdir}/WEB-INF/lib/xerces.jar" />
194
       <copy file="${xmlp}"
195
             tofile="${installdir}/WEB-INF/lib/xmlparserv2.jar" />
196
       <copy file="${jdbc}"
197
             tofile="${installdir}/WEB-INF/lib/oracle-jdbc111.jar" />
198
       <copy file="${cos}"
199
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
200
       <copy file="lib/web.xml"
201
             tofile="${installdir}/WEB-INF/web.xml" />
202
       <copy todir="${build.img}" filtering="no">
203
         <fileset dir="lib">
204
           <include name="**/*.jpg"/>
205
           <include name="**/*.png"/>
206
           <include name="**/*.gif"/>
207
         </fileset>
208
       </copy>
209
       <copy todir="${installdir}" filtering="yes">
210
         <fileset dir="lib">
211
           <exclude name="*.jar"/>
212
           <exclude name="*.properties"/>
213
           <exclude name="web.xml"/>
214
           <exclude name="**/srbrmi*"/>
215
         </fileset>
216
       </copy>
217 810 berkley
       <mkdir dir="${installdir}/dtd" />
218 877 jones
       <echo>
219
             ***********************************************************
220
              Remember to copy the appropriate DTD
221
              files to the installation dtd directory. If you have cvs
222
              access this can be done using "ant instdtd".
223
224
              Remember to register the default DTDs by running the
225
              "${build.src}/loaddtd.sql script". This is most easily
226
              done by using the "ant dtdsql" which will run it for you.
227
             ***********************************************************
228
       </echo>
229 204 jones
   </target>
230
231 113 jones
   <target name="clean" depends="init">
232 822 jones
       <delete dir="${build.dir}" />
233 113 jones
   </target>
234
235 516 jones
   <target name="jdoc" depends="prepare">
236 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
237 516 jones
           sourcepath="${build.src}"
238
           destdir="${build.javadocs}"
239 113 jones
           author="true"
240
           version="true"
241
           use="true"
242 348 jones
           windowtitle="${Name} API"
243
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
244 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
245
       />
246
   </target>
247
248 806 jones
   <target name="dist" depends="jar,protocol,jdoc">
249
      <mkdir dir="${dist.dir}"/>
250
      <delete dir="${ver.dir}" />
251
      <mkdir dir="${ver.dir}"/>
252
      <copy todir="${ver.dir}">
253
        <fileset dir="." excludes="**/CVS* **/.#* **/src* **/test* **/build*"/>
254
      </copy>
255
      <copy todir="${ver.dir}" file="build.xml"/>
256
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
257
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
258
      <copy todir="${ver.dir}/docs/dev">
259
        <fileset dir="${build.dir}/docs"/>
260
      </copy>
261
262
      <delete file="./lib/${name}-${release}.zip"/>
263
      <zip zipfile="./lib/${name}-${release}.zip" basedir="${dist.dir}"/>
264
      <delete file="./lib/${name}-${release}.tar.gz" />
265
      <tar tarfile="./lib/${name}-${release}.tar" basedir="${dist.dir}"/>
266
      <gzip zipfile="./lib/${name}-${release}.tar.gz"
267
                src="./lib/${name}-${release}.tar"/>
268
      <delete file="./lib/${name}-${release}.tar" />
269
  </target>
270
271
  <target name="distsrc" depends="dist">
272
      <mkdir dir="${ver.src}"/>
273
      <copy todir="${ver.src}">
274
        <fileset dir="./src"/>
275
      </copy>
276
277
      <delete file="./lib/${name}-src-${release}.zip"/>
278
      <zip zipfile="./lib/${name}-src-${release}.zip" basedir="${dist.dir}"/>
279
      <delete file="./lib/${name}-src-${release}.tar.gz" />
280
      <tar tarfile="./lib/${name}-src-${release}.tar" basedir="${dist.dir}"/>
281
      <gzip zipfile="./lib/${name}-src-${release}.tar.gz"
282
                src="./lib/${name}-src-${release}.tar"/>
283
      <delete file="./lib/${name}-src-${release}.tar" />
284 807 jones
      <delete dir="${dist.dir}"/>
285 806 jones
  </target>
286
287 113 jones
</project>