Project

General

Profile

1
<?xml version="1.0"?>
2
<!-- 
3
  *   '$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
  *
9
  *    '$Author: berkley $'
10
  *      '$Date: 2002-01-29 10:15:11 -0800 (Tue, 29 Jan 2002) $'
11
  *  '$Revision: 915 $'
12
  *
13
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15
  *
16
  * usage: ant [compile|jar|install|jdoc]
17
  *
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
--> 
32
<project name="metacat" default="jar" basedir=".">
33
   <target name="init">
34
      <property name="jdbc-connect" 
35
                value="jdbc:oracle:thin:@dev.nceas.ucsb.edu:1521:exp"/>
36
      <property name="installdir" value="/opt/tomcat/webapps/berkley" />
37
      <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
38
      <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
39
      <property name="name" value="metacat"/>
40
      <property name="Name" value="MetaCat"/>
41
      <property name="release" value="1.0.3"/>
42
      <property name="web-base-url" 
43
                value="http://knb.ecoinformatics.org"/>
44

    
45
      <property name="replication-path" value="/servlet/replication"/>
46
      <property name="servlet-path" value="/berkley/servlet/metacat"/>
47
      <property name="html-path" value="/berkley"/>
48
      <property name="image-path" value="/img/berkley" />
49
      <property name="style-path" value="/berkley/style"/>
50
      <property name="server" value="dev.nceas.ucsb.edu:8090"/>
51
      <property name="replication-log" value="/tmp/berkley/metacatreplication.log"/>
52
      <property name="user" value="berkley"/>
53
      <property name="password" value="UnSinn123"/>
54
      <property name="config-dir" value="${installdir}" />
55
      <property name="default-style" value="knb" />
56
      <property name="eml-module" value="mdstandards/eml" />
57
      <property name="eml-version" value="2.0.0beta6" />
58
      <property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6" />
59
      <property name="cvsroot" 
60
                value=":ext:berkley@cvs.ecoinformatics.org:/cvs" />
61

    
62

    
63
      <filter token="docrooturl" value="./" />
64
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
65
      <filter token="dbDriver" value="${dbDriver}"/>
66
      <filter token="dbAdapter" value="${dbAdapter}"/>
67
      <filter token="install-dir" value="${installdir}"/>
68
      <filter token="serverhost" value="${serverhost}"/>
69
      <filter token="server" value="${server}"/>
70
      <filter token="replication-log" value="${replication-log}"/>
71
      <filter token="release" value="${release}"/>
72
      <filter token="servlet-path" value="${servlet-path}"/>
73
      <filter token="html-path" value="${html-path}"/>
74
      <filter token="user" value="${user}"/>
75
      <filter token="password" value="${password}"/>
76
      <filter token="image-path" value="${image-path}"/>
77
      <filter token="style-path" value="${style-path}"/>
78
      <filter token="web-base-url" value="${web-base-url}"/>
79
      <filter token="replication-path" value="${replication-path}"/>
80
      <filter token="config-dir" value="${config-dir}"/>
81
      <filter token="default-style" value="${default-style}"/>
82
      <filter token="eml-version" value="${eml-version}"/>
83

    
84
      <property name="srcdir" value="./src" />
85
      <property name="build.dir" value="./build"/>
86
      <property name="build.src" value="${build.dir}/src"/>
87
      <property name="build.dest" value="${build.dir}/classes"/>
88
      <property name="build.docs" value="${build.dir}/docs"/>
89
      <property name="build.samples" value="${build.dir}/samples"/>
90
      <property name="build.tests" value="${build.dir}/tests"/>
91
      <property name="build.data" value="${build.dir}/data"/>
92
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
93
      <property name="build.img" value="${installdir}/${image-path}"/>
94

    
95
      <property name="dist.dir" value="dist"/>
96
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
97
      <property name="ver.src" value="${ver.dir}/src"/>
98

    
99
      <property name="oracle_home" 
100
                value="/oracle01/app/oracle/product/8.1.6" />
101
      <property name="toolsdir" 
102
                value="/usr/local/devtools" />
103
      <property name="xmlp2" 
104
                value="${toolsdir}/xerces-1_1_3/xerces.jar" />
105
      <property name="jdbc" 
106
                value="${oracle_home}/jdbc/lib/classes111.zip" />
107
      <property name="jserv" 
108
                value="/usr/lib/apache/ApacheJServ.jar" />
109
      <property name="jsdk" 
110
                value="${toolsdir}/jakarta-tomcat/lib/servlet.jar" />
111
      <property name="srb" 
112
                value="lib/srbrmi" />
113
      <property name="cos" 
114
                value="lib/cos.jar" />
115
      <property name="xalan"
116
                value="lib/xalan/xalan.jar" />
117
      <property name="xalanxml-apis"
118
                value="lib/xalan/xml-apis.jar" />
119
      <property name="cpath" 
120
                value="${xmlp2}:${xalan}:${xalanxml-apis}:${jdbc}:${jserv}:${jsdk}:${srb}:${cos}"/>
121
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
122

    
123
   </target>
124
   
125
   <target name="prepare" depends="init">
126
      <mkdir dir="${build.dir}"/>
127
      <mkdir dir="${build.src}"/>
128
      <mkdir dir="${build.dest}"/>
129
      <mkdir dir="${build.javadocs}"/>
130

    
131
      <copy todir="${build.src}" filtering="yes">
132
        <fileset dir="${srcdir}">
133
          <include name="edu/**"/>
134
          <include name="com/**"/>
135
          <include name="**/*.sql"/>
136
          <exclude name="**/CVS*"/>
137
          <exclude name="**/.#*"/>
138
        </fileset>
139
      </copy>
140
   </target>
141

    
142
   <target name="compile" depends="prepare">
143
       <javac srcdir="${build.src}" 
144
              destdir="${build.dest}" 
145
              classpath="${cpath}" 
146
              excludes="**/*.sql" /> 
147
       <copy file="lib/metacat.properties" 
148
             tofile="${build.dest}/${package.home}/metacat.properties" 
149
             filtering="yes" />
150
       <copy file="lib/srbProps.properties" 
151
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
152
   </target> 
153

    
154
   <target name="jar" depends="compile">
155
       <delete file="${build.dir}/${name}.jar" />
156
       <copy todir="${build.dest}">
157
         <fileset dir="lib/srbrmi"/>
158
       </copy>
159
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
160
            excludes="**/protocols/" />
161
   </target> 
162
 
163
   <target name="protocol" depends="compile">
164
       <delete file="${build.dir}/protocol.jar" />
165
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
166
            includes="**/protocols/" />
167
   </target> 
168

    
169
   <target name="getdtd" depends="prepare">
170
        <cvs cvsRoot="${cvsroot}"
171
             package="${eml-module}"
172
             tag="${eml-tag}"
173
             dest="${build.src}" />
174
       <mkdir dir="lib/dtd" />
175
       <copy todir="lib/dtd" filtering="yes">
176
         <fileset dir="${build.src}/${eml-module}">
177
           <include name="*.dtd"/>
178
         </fileset>
179
         <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
180
       </copy>
181
   </target>
182

    
183
   <target name="dtdsql" depends="prepare">
184
     <echo/>
185
     <echo>Registering the DTDs with the new Metacat instance...</echo>
186
     <sql driver="${dbDriver}"
187
          classpath="${jdbc}"
188
          url="${jdbc-connect}"
189
          userid="${user}"
190
          password="${password}"
191
          src="${build.src}/loaddtd.sql" />
192
   </target>
193

    
194
   <target name="install" depends="jar">
195
       <mkdir dir="${installdir}/WEB-INF/lib" />
196
       <copy file="${build.dir}/${name}.jar" 
197
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
198
       <copy file="${xmlp2}" 
199
             tofile="${installdir}/WEB-INF/lib/xerces.jar" />
200
       <copy file="${xmlp}" 
201
             tofile="${installdir}/WEB-INF/lib/xmlparserv2.jar" />
202
       <copy file="${jdbc}" 
203
             tofile="${installdir}/WEB-INF/lib/oracle-jdbc111.jar" />
204
       <copy file="${cos}" 
205
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
206
       <copy file="lib/web.xml" 
207
             tofile="${installdir}/WEB-INF/web.xml" />
208
       <copy todir="${build.img}" filtering="no">
209
         <fileset dir="lib">
210
           <include name="**/*.jpg"/>
211
           <include name="**/*.png"/>
212
           <include name="**/*.gif"/>
213
         </fileset>
214
       </copy>
215
       <copy todir="${installdir}" filtering="yes">
216
         <fileset dir="lib">
217
           <exclude name="*.jar"/>
218
           <exclude name="*.properties"/>
219
           <exclude name="web.xml"/>
220
           <exclude name="**/srbrmi*"/>
221
         </fileset>
222
       </copy>
223
       <echo>
224
             ***********************************************************
225
              Remember to register the default DTDs by running the
226
              "${build.src}/loaddtd.sql script". This is most easily
227
              done by using the "ant dtdsql" which will run it for you.
228
             ***********************************************************
229
       </echo>
230
   </target> 
231

    
232
   <target name="clean" depends="init">
233
       <delete dir="${build.dir}" />
234
   </target>
235

    
236
   <target name="jdoc" depends="prepare">
237
       <javadoc packagenames="edu.ucsb.nceas.*"
238
           sourcepath="${build.src}"
239
           destdir="${build.javadocs}"
240
           author="true"
241
           version="true"
242
           use="true"
243
           windowtitle="${Name} API"
244
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
245
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
246
       />
247
   </target>
248

    
249
   <target name="dist" depends="jar,protocol,jdoc,getdtd">
250
      <mkdir dir="${dist.dir}"/>
251
      <delete dir="${ver.dir}" />
252
      <mkdir dir="${ver.dir}"/>
253
      <copy todir="${ver.dir}">
254
        <fileset dir="." 
255
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
256
      </copy>
257
      <copy todir="${ver.dir}" file="build.xml"/>
258
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
259
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
260

    
261
      <copy todir="${ver.dir}/docs" filtering="yes">
262
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
263
      </copy>
264
      <copy todir="${ver.dir}/docs" filtering="no">
265
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
266
      </copy>
267
      <copy todir="${ver.dir}/docs/dev">
268
        <fileset dir="${build.dir}/docs"/>
269
      </copy>
270
       
271
      <delete file="./${name}-${release}.zip"/>
272
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}"/>
273
      <delete file="./${name}-${release}.tar.gz" />
274
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}"/>
275
      <gzip zipfile="./${name}-${release}.tar.gz" 
276
                src="./${name}-${release}.tar"/>
277
      <delete file="./${name}-${release}.tar" />
278
  </target> 
279

    
280
  <target name="distsrc" depends="dist">
281
      <mkdir dir="${ver.src}"/>
282
      <copy todir="${ver.src}">
283
        <fileset dir="./src"/>
284
      </copy>
285

    
286
      <delete file="./${name}-src-${release}.zip"/>
287
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
288
      <delete file="./${name}-src-${release}.tar.gz" />
289
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
290
      <gzip zipfile="./${name}-src-${release}.tar.gz" 
291
                src="./${name}-src-${release}.tar"/>
292
      <delete file="./${name}-src-${release}.tar" />
293
      <delete dir="${dist.dir}"/>
294
  </target> 
295

    
296
</project>
(6-6/6)