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 780 berkley
      <property name="installdir" value="/opt/tomcat/webapps/jones" />
37 348 jones
      <property name="name" value="metacat"/>
38
      <property name="Name" value="MetaCat"/>
39 806 jones
      <property name="release" value="1.0beta2"/>
40 685 jones
      <property name="web-base-url"
41 811 bojilova
                value="http://knb.ecoinformatics.org"/>
42 845 jones
      <property name="replication-path" value="/servlet/replication"/>
43 780 berkley
      <property name="servlet-path" value="/jones/servlet/metacat"/>
44
      <property name="html-path" value="/jones"/>
45
      <property name="image-path" value="/img/jones" />
46 833 jones
      <property name="style-path" value="/jones/style"/>
47 838 bojilova
      <property name="server" value="dev.nceas.ucsb.edu:8443"/>
48 780 berkley
      <property name="replication-log" value="/tmp/metacatreplication.log"/>
49
      <property name="user" value="jones"/>
50 798 jones
      <property name="password" value="your-pw-goes-here"/>
51 832 jones
      <property name="config-dir" value="${installdir}" />
52
      <property name="default-style" value="knb" />
53 348 jones
54 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
55 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
56 586 berkley
      <filter token="server" value="${server}"/>
57
      <filter token="replication-log" value="${replication-log}"/>
58 348 jones
      <filter token="release" value="${release}"/>
59
      <filter token="servlet-path" value="${servlet-path}"/>
60 359 bojilova
      <filter token="html-path" value="${html-path}"/>
61 362 jones
      <filter token="user" value="${user}"/>
62
      <filter token="password" value="${password}"/>
63 409 berkley
      <filter token="image-path" value="${image-path}"/>
64 828 jones
      <filter token="style-path" value="${style-path}"/>
65 506 jones
      <filter token="web-base-url" value="${web-base-url}"/>
66 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
67 832 jones
      <filter token="config-dir" value="${config-dir}"/>
68
      <filter token="default-style" value="${default-style}"/>
69 254 jones
      <property name="srcdir" value="./src" />
70 348 jones
71
      <property name="build.dir" value="./build"/>
72
      <property name="build.src" value="${build.dir}/src"/>
73
      <property name="build.dest" value="${build.dir}/classes"/>
74 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
75 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
76
      <property name="build.tests" value="${build.dir}/tests"/>
77
      <property name="build.data" value="${build.dir}/data"/>
78 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
79 409 berkley
      <property name="build.img" value="/opt/httpd/html${image-path}"/>
80 348 jones
81 806 jones
      <property name="dist.dir" value="./dist"/>
82
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
83
      <property name="ver.src" value="${ver.dir}/src"/>
84
85 113 jones
      <property name="oracle_home"
86 329 jones
                value="/oracle01/app/oracle/product/8.1.6" />
87
      <property name="toolsdir"
88
                value="/usr/local/devtools" />
89 113 jones
      <property name="xmlp"
90 329 jones
                value="${toolsdir}/OracleXSU111/lib/xmlparserv2.jar" />
91 185 jones
      <property name="xmlp2"
92 329 jones
                value="${toolsdir}/xerces-1_1_3/xerces.jar" />
93 113 jones
      <property name="jdbc"
94
                value="${oracle_home}/jdbc/lib/classes111.zip" />
95
      <property name="jserv"
96
                value="/usr/lib/apache/ApacheJServ.jar" />
97
      <property name="jsdk"
98 329 jones
                value="${toolsdir}/jakarta-tomcat/lib/servlet.jar" />
99 213 jones
      <property name="srb"
100
                value="lib/srbrmi" />
101 798 jones
      <property name="cos"
102
                value="lib/cos.jar" />
103 113 jones
      <property name="cpath"
104 798 jones
                value="${xmlp2}:${xmlp}:${jdbc}:${jserv}:${jsdk}:${srb}:${cos}"/>
105 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
106 348 jones
107 113 jones
   </target>
108
109 348 jones
   <target name="prepare" depends="init">
110
      <mkdir dir="${build.dir}"/>
111
      <mkdir dir="${build.src}"/>
112
      <mkdir dir="${build.dest}"/>
113 516 jones
      <mkdir dir="${build.javadocs}"/>
114 348 jones
115 822 jones
      <copy todir="${build.src}" filtering="yes">
116
        <fileset dir="${srcdir}">
117
          <include name="edu/**"/>
118
          <include name="com/**"/>
119
          <exclude name="**/CVS*"/>
120
          <exclude name="**/.#*"/>
121
          <exclude name="**/*.sql"/>
122
        </fileset>
123
      </copy>
124 348 jones
   </target>
125
126
   <target name="compile" depends="prepare">
127
       <javac srcdir="${build.src}"
128
              destdir="${build.dest}"
129 257 jones
              classpath="${cpath}"
130
              excludes="**/*.sql" />
131 822 jones
       <copy file="lib/metacat.properties"
132
             tofile="${build.dest}/${package.home}/metacat.properties"
133
             filtering="yes" />
134
       <copy file="lib/srbProps.properties"
135
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
136 113 jones
   </target>
137
138 204 jones
   <target name="jar" depends="compile">
139 353 jones
       <delete file="${build.dir}/${name}.jar" />
140 822 jones
       <copy todir="${build.dest}">
141
         <fileset dir="lib/srbrmi"/>
142
       </copy>
143 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
144
            excludes="**/protocols/" />
145 113 jones
   </target>
146 635 jones
147
   <target name="protocol" depends="compile">
148
       <delete file="${build.dir}/protocol.jar" />
149
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
150
            includes="**/protocols/" />
151
   </target>
152 113 jones
153 204 jones
   <target name="install" depends="jar">
154 329 jones
       <mkdir dir="${installdir}/WEB-INF/lib" />
155 822 jones
       <copy file="${build.dir}/${name}.jar"
156
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
157
       <copy file="${xmlp2}"
158
             tofile="${installdir}/WEB-INF/lib/xerces.jar" />
159
       <copy file="${xmlp}"
160
             tofile="${installdir}/WEB-INF/lib/xmlparserv2.jar" />
161
       <copy file="${jdbc}"
162
             tofile="${installdir}/WEB-INF/lib/oracle-jdbc111.jar" />
163
       <copy file="${cos}"
164
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
165
       <copy file="lib/web.xml"
166
             tofile="${installdir}/WEB-INF/web.xml" />
167
       <copy todir="${build.img}" filtering="no">
168
         <fileset dir="lib">
169
           <include name="**/*.jpg"/>
170
           <include name="**/*.png"/>
171
           <include name="**/*.gif"/>
172
         </fileset>
173
       </copy>
174
       <copy todir="${installdir}" filtering="yes">
175
         <fileset dir="lib">
176
           <exclude name="*.jar"/>
177
           <exclude name="*.properties"/>
178
           <exclude name="web.xml"/>
179
           <exclude name="**/srbrmi*"/>
180
         </fileset>
181
       </copy>
182 810 berkley
       <mkdir dir="${installdir}/dtd" />
183 822 jones
       <copy todir="${installdir}/dtd" filtering="yes">
184
         <fileset dir="lib/dtd">
185
           <include name="*.dtd"/>
186
         </fileset>
187
       </copy>
188 204 jones
   </target>
189
190 113 jones
   <target name="clean" depends="init">
191 822 jones
       <delete dir="${build.dir}" />
192 113 jones
   </target>
193
194 516 jones
   <target name="jdoc" depends="prepare">
195 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
196 516 jones
           sourcepath="${build.src}"
197
           destdir="${build.javadocs}"
198 113 jones
           author="true"
199
           version="true"
200
           use="true"
201 348 jones
           windowtitle="${Name} API"
202
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
203 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
204
       />
205
   </target>
206
207 806 jones
   <target name="dist" depends="jar,protocol,jdoc">
208
      <mkdir dir="${dist.dir}"/>
209
      <delete dir="${ver.dir}" />
210
      <mkdir dir="${ver.dir}"/>
211
      <copy todir="${ver.dir}">
212
        <fileset dir="." excludes="**/CVS* **/.#* **/src* **/test* **/build*"/>
213
      </copy>
214
      <copy todir="${ver.dir}" file="build.xml"/>
215
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
216
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
217
      <copy todir="${ver.dir}/docs/dev">
218
        <fileset dir="${build.dir}/docs"/>
219
      </copy>
220
221
      <delete file="./lib/${name}-${release}.zip"/>
222
      <zip zipfile="./lib/${name}-${release}.zip" basedir="${dist.dir}"/>
223
      <delete file="./lib/${name}-${release}.tar.gz" />
224
      <tar tarfile="./lib/${name}-${release}.tar" basedir="${dist.dir}"/>
225
      <gzip zipfile="./lib/${name}-${release}.tar.gz"
226
                src="./lib/${name}-${release}.tar"/>
227
      <delete file="./lib/${name}-${release}.tar" />
228
  </target>
229
230
  <target name="distsrc" depends="dist">
231
      <mkdir dir="${ver.src}"/>
232
      <copy todir="${ver.src}">
233
        <fileset dir="./src"/>
234
      </copy>
235
236
      <delete file="./lib/${name}-src-${release}.zip"/>
237
      <zip zipfile="./lib/${name}-src-${release}.zip" basedir="${dist.dir}"/>
238
      <delete file="./lib/${name}-src-${release}.tar.gz" />
239
      <tar tarfile="./lib/${name}-src-${release}.tar" basedir="${dist.dir}"/>
240
      <gzip zipfile="./lib/${name}-src-${release}.tar.gz"
241
                src="./lib/${name}-src-${release}.tar"/>
242
      <delete file="./lib/${name}-src-${release}.tar" />
243 807 jones
      <delete dir="${dist.dir}"/>
244 806 jones
  </target>
245
246 113 jones
</project>