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-22 11:30:41 -0800 (Tue, 22 Jan 2002) $'
11
  *  '$Revision: 906 $'
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/metacat" />
37
      <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
38
      <property name="name" value="metacat"/>
39
      <property name="Name" value="MetaCat"/>
40
      <property name="release" value="1.0.3"/>
41
      <property name="web-base-url" 
42
                value="http://knb.ecoinformatics.org"/>
43

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

    
61

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

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

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

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

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

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

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

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

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

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

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

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

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

    
247
   <target name="dist" depends="jar,protocol,jdoc,getdtd">
248
      <mkdir dir="${dist.dir}"/>
249
      <delete dir="${ver.dir}" />
250
      <mkdir dir="${ver.dir}"/>
251
      <copy todir="${ver.dir}">
252
        <fileset dir="." 
253
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
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

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

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

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

    
294
</project>
(3-3/6)