1*60ba3965SDamjan Jovanovic<?xml version="1.0" encoding="UTF-8"?>
2*60ba3965SDamjan Jovanovic<!--***********************************************************
3*60ba3965SDamjan Jovanovic *
4*60ba3965SDamjan Jovanovic * Licensed to the Apache Software Foundation (ASF) under one
5*60ba3965SDamjan Jovanovic * or more contributor license agreements.  See the NOTICE file
6*60ba3965SDamjan Jovanovic * distributed with this work for additional information
7*60ba3965SDamjan Jovanovic * regarding copyright ownership.  The ASF licenses this file
8*60ba3965SDamjan Jovanovic * to you under the Apache License, Version 2.0 (the
9*60ba3965SDamjan Jovanovic * "License"); you may not use this file except in compliance
10*60ba3965SDamjan Jovanovic * with the License.  You may obtain a copy of the License at
11*60ba3965SDamjan Jovanovic *
12*60ba3965SDamjan Jovanovic *   http://www.apache.org/licenses/LICENSE-2.0
13*60ba3965SDamjan Jovanovic *
14*60ba3965SDamjan Jovanovic * Unless required by applicable law or agreed to in writing,
15*60ba3965SDamjan Jovanovic * software distributed under the License is distributed on an
16*60ba3965SDamjan Jovanovic * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17*60ba3965SDamjan Jovanovic * KIND, either express or implied.  See the License for the
18*60ba3965SDamjan Jovanovic * specific language governing permissions and limitations
19*60ba3965SDamjan Jovanovic * under the License.
20*60ba3965SDamjan Jovanovic *
21*60ba3965SDamjan Jovanovic ***********************************************************-->
22*60ba3965SDamjan Jovanovic
23*60ba3965SDamjan Jovanovic
24*60ba3965SDamjan Jovanovic<project name="dbtools" default="main" basedir=".">
25*60ba3965SDamjan Jovanovic
26*60ba3965SDamjan Jovanovic    <!-- ================================================================= -->
27*60ba3965SDamjan Jovanovic    <!-- settings                                                          -->
28*60ba3965SDamjan Jovanovic    <!-- ================================================================= -->
29*60ba3965SDamjan Jovanovic
30*60ba3965SDamjan Jovanovic    <!-- global properties -->
31*60ba3965SDamjan Jovanovic    <property file="../../../ant.properties"/>
32*60ba3965SDamjan Jovanovic    <!-- version info -->
33*60ba3965SDamjan Jovanovic    <property file="../../../solenv/inc/minor.mk"/>
34*60ba3965SDamjan Jovanovic
35*60ba3965SDamjan Jovanovic    <!-- name of this sub target used in recursive builds -->
36*60ba3965SDamjan Jovanovic    <property name="target" value="dbtools"/>
37*60ba3965SDamjan Jovanovic
38*60ba3965SDamjan Jovanovic    <!-- name of jar file created, without .jar extension -->
39*60ba3965SDamjan Jovanovic    <property name="jarname" value="dbtools"/>
40*60ba3965SDamjan Jovanovic
41*60ba3965SDamjan Jovanovic    <!-- relative path to project directory -->
42*60ba3965SDamjan Jovanovic    <property name="prj" value="../.."/>
43*60ba3965SDamjan Jovanovic
44*60ba3965SDamjan Jovanovic    <!-- build output directory -->
45*60ba3965SDamjan Jovanovic    <!-- FIXME: there are also extremely rare/obsolete dbcs/bndchk/truetime/hbtoolkit cases in main/solenv/inc/settings.mk -->
46*60ba3965SDamjan Jovanovic    <condition property="out" value="${prj}/${OUTPATH}.cap">
47*60ba3965SDamjan Jovanovic        <isset property="${profile}"/>
48*60ba3965SDamjan Jovanovic    </condition>
49*60ba3965SDamjan Jovanovic    <condition property="out" value="${prj}/${OUTPATH}.pro">
50*60ba3965SDamjan Jovanovic        <isset property="${PRODUCT}"/>
51*60ba3965SDamjan Jovanovic    </condition>
52*60ba3965SDamjan Jovanovic    <property name="out" value="${prj}/${OUTPATH}"/>
53*60ba3965SDamjan Jovanovic
54*60ba3965SDamjan Jovanovic    <!-- build directories -->
55*60ba3965SDamjan Jovanovic    <property name="build.dir" value="${out}"/>
56*60ba3965SDamjan Jovanovic    <property name="build.class" value="${build.dir}/class/${target}"/>
57*60ba3965SDamjan Jovanovic    <property name="build.misc" value="${build.dir}/misc/${target}"/>
58*60ba3965SDamjan Jovanovic
59*60ba3965SDamjan Jovanovic    <!-- start of java source code package structure -->
60*60ba3965SDamjan Jovanovic    <property name="java.dir" value="src"/>
61*60ba3965SDamjan Jovanovic
62*60ba3965SDamjan Jovanovic    <!-- define how to handle CLASSPATH environment -->
63*60ba3965SDamjan Jovanovic    <property name="build.sysclasspath" value="ignore"/>
64*60ba3965SDamjan Jovanovic
65*60ba3965SDamjan Jovanovic    <!-- classpath settings for compile and javadoc tasks -->
66*60ba3965SDamjan Jovanovic    <condition property="jar-class-path" value="${COMMONS_LANG_JAR}" else="commons-lang3-3.3.jar">
67*60ba3965SDamjan Jovanovic        <equals arg1="${SYSTEM_APACHE_COMMONS}" arg2="YES"/>
68*60ba3965SDamjan Jovanovic    </condition>
69*60ba3965SDamjan Jovanovic    <condition property="commons-lang-jar" value="${COMMONS_LANG_JAR}" else="${OUTDIR}/bin/commons-lang3-3.3.jar">
70*60ba3965SDamjan Jovanovic        <equals arg1="${SYSTEM_APACHE_COMMONS}" arg2="YES"/>
71*60ba3965SDamjan Jovanovic    </condition>
72*60ba3965SDamjan Jovanovic    <path id="classpath">
73*60ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/juh.jar"/>
74*60ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/jurt.jar"/>
75*60ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/ridl.jar"/>
76*60ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/unoil.jar"/>
77*60ba3965SDamjan Jovanovic        <!-- 3rd party libs -->
78*60ba3965SDamjan Jovanovic        <pathelement location="${commons-lang-jar}"/>
79*60ba3965SDamjan Jovanovic    </path>
80*60ba3965SDamjan Jovanovic
81*60ba3965SDamjan Jovanovic    <!-- name to display in documentation -->
82*60ba3965SDamjan Jovanovic    <property name="docname" value="dbtools"/>
83*60ba3965SDamjan Jovanovic
84*60ba3965SDamjan Jovanovic    <!-- set "modern" java compiler -->
85*60ba3965SDamjan Jovanovic    <property name="build.compiler" value="modern"/>
86*60ba3965SDamjan Jovanovic
87*60ba3965SDamjan Jovanovic    <!-- set wether we want to compile with debug information -->
88*60ba3965SDamjan Jovanovic    <property name="debug" value="on"/>
89*60ba3965SDamjan Jovanovic
90*60ba3965SDamjan Jovanovic    <!-- set wether we want to compile with optimisation -->
91*60ba3965SDamjan Jovanovic    <property name="optimize" value="off"/>
92*60ba3965SDamjan Jovanovic
93*60ba3965SDamjan Jovanovic    <!-- set wether we want to compile with or without deprecation -->
94*60ba3965SDamjan Jovanovic    <property name="deprecation" value="on"/>
95*60ba3965SDamjan Jovanovic
96*60ba3965SDamjan Jovanovic    <target name="info">
97*60ba3965SDamjan Jovanovic        <echo message="--------------------"/>
98*60ba3965SDamjan Jovanovic        <echo message="${target}"/>
99*60ba3965SDamjan Jovanovic        <echo message="--------------------"/>
100*60ba3965SDamjan Jovanovic    </target>
101*60ba3965SDamjan Jovanovic
102*60ba3965SDamjan Jovanovic    <!-- ================================================================= -->
103*60ba3965SDamjan Jovanovic    <!-- custom targets                                                    -->
104*60ba3965SDamjan Jovanovic    <!-- ================================================================= -->
105*60ba3965SDamjan Jovanovic
106*60ba3965SDamjan Jovanovic    <!-- the main target, called in recursive builds -->
107*60ba3965SDamjan Jovanovic    <target name="main" depends="info,prepare,compile,jar,javadoc,zipdoc"/>
108*60ba3965SDamjan Jovanovic
109*60ba3965SDamjan Jovanovic    <!-- prepare output directories -->
110*60ba3965SDamjan Jovanovic    <target name="prepare">
111*60ba3965SDamjan Jovanovic        <mkdir dir="${build.dir}"/>
112*60ba3965SDamjan Jovanovic        <mkdir dir="${build.dir}/doc/${target}"/>
113*60ba3965SDamjan Jovanovic        <mkdir dir="${build.class}"/>
114*60ba3965SDamjan Jovanovic        <mkdir dir="${build.misc}"/>
115*60ba3965SDamjan Jovanovic    </target>
116*60ba3965SDamjan Jovanovic
117*60ba3965SDamjan Jovanovic
118*60ba3965SDamjan Jovanovic    <target name="res" depends="prepare">
119*60ba3965SDamjan Jovanovic        <copy todir="${build.class}">
120*60ba3965SDamjan Jovanovic             <fileset dir="${java.dir}">
121*60ba3965SDamjan Jovanovic                 <include name="**/*.properties"/>
122*60ba3965SDamjan Jovanovic                 <include name="**/*.css"/>
123*60ba3965SDamjan Jovanovic                 <include name="**/*.dtd"/>
124*60ba3965SDamjan Jovanovic                 <include name="**/*.form"/>
125*60ba3965SDamjan Jovanovic                 <include name="**/*.gif "/>
126*60ba3965SDamjan Jovanovic                 <include name="**/*.htm"/>
127*60ba3965SDamjan Jovanovic                 <include name="**/*.html"/>
128*60ba3965SDamjan Jovanovic                 <include name="**/*.js"/>
129*60ba3965SDamjan Jovanovic                 <include name="**/*.mod"/>
130*60ba3965SDamjan Jovanovic                 <include name="**/*.sql"/>
131*60ba3965SDamjan Jovanovic                 <include name="**/*.xml"/>
132*60ba3965SDamjan Jovanovic                 <include name="**/*.xsl"/>
133*60ba3965SDamjan Jovanovic                 <include name="**/*.map"/>
134*60ba3965SDamjan Jovanovic
135*60ba3965SDamjan Jovanovic             </fileset>
136*60ba3965SDamjan Jovanovic        </copy>
137*60ba3965SDamjan Jovanovic    </target>
138*60ba3965SDamjan Jovanovic
139*60ba3965SDamjan Jovanovic
140*60ba3965SDamjan Jovanovic    <target name="compile" depends="prepare,res">
141*60ba3965SDamjan Jovanovic	<javac destdir="${build.class}"
142*60ba3965SDamjan Jovanovic	       debug="${debug}"
143*60ba3965SDamjan Jovanovic               debuglevel="lines,vars,source"
144*60ba3965SDamjan Jovanovic               deprecation="${deprecation}"
145*60ba3965SDamjan Jovanovic	       optimize="${optimize}"
146*60ba3965SDamjan Jovanovic	       classpathref="classpath">
147*60ba3965SDamjan Jovanovic            <src path="${java.dir}"/>
148*60ba3965SDamjan Jovanovic	    <include name="**/*.java"/>
149*60ba3965SDamjan Jovanovic	</javac>
150*60ba3965SDamjan Jovanovic    </target>
151*60ba3965SDamjan Jovanovic
152*60ba3965SDamjan Jovanovic    <!-- check if javadoc is up to date -->
153*60ba3965SDamjan Jovanovic    <target name="javadoc_check" depends="prepare" if="build.dir">
154*60ba3965SDamjan Jovanovic	<uptodate property="javadocBuild.notRequired" value="true"
155*60ba3965SDamjan Jovanovic            targetfile="${build.dir}/doc/${target}/${target}_javadoc.zip">
156*60ba3965SDamjan Jovanovic		<srcfiles dir="${java.dir}" includes="**/*.java"/>
157*60ba3965SDamjan Jovanovic	</uptodate>
158*60ba3965SDamjan Jovanovic    </target>
159*60ba3965SDamjan Jovanovic
160*60ba3965SDamjan Jovanovic    <!-- generate java documentation -->
161*60ba3965SDamjan Jovanovic    <target name="javadoc" depends="prepare,javadoc_check,compile"
162*60ba3965SDamjan Jovanovic         unless="javadocBuild.notRequired"
163*60ba3965SDamjan Jovanovic         if="build.dir">
164*60ba3965SDamjan Jovanovic
165*60ba3965SDamjan Jovanovic        <javadoc destdir="${build.dir}/doc/${target}/javadoc"
166*60ba3965SDamjan Jovanovic                 verbose="false"
167*60ba3965SDamjan Jovanovic                 author="false"
168*60ba3965SDamjan Jovanovic                 nodeprecated="true"
169*60ba3965SDamjan Jovanovic                 nodeprecatedlist="true"
170*60ba3965SDamjan Jovanovic                 use="true"
171*60ba3965SDamjan Jovanovic                 Doctitle="${docname}"
172*60ba3965SDamjan Jovanovic                 windowtitle="${docname}"
173*60ba3965SDamjan Jovanovic                 classpathref="classpath">
174*60ba3965SDamjan Jovanovic
175*60ba3965SDamjan Jovanovic            <packageset dir="${java.dir}" defaultexcludes="yes">
176*60ba3965SDamjan Jovanovic                <include name="com/**"/>
177*60ba3965SDamjan Jovanovic                <include name="org/**"/>
178*60ba3965SDamjan Jovanovic            </packageset>
179*60ba3965SDamjan Jovanovic
180*60ba3965SDamjan Jovanovic            <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api"
181*60ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/jdk1.4.2"/>
182*60ba3965SDamjan Jovanovic            <link offline="true"
183*60ba3965SDamjan Jovanovic                  href="http://java.sun.com/products/servlet/2.3/javadoc"
184*60ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/servlet2.3"/>
185*60ba3965SDamjan Jovanovic            <link offline="true"
186*60ba3965SDamjan Jovanovic                  href="http://logging.apache.org/log4j/docs/api"
187*60ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/log4j-1.2.8"/>
188*60ba3965SDamjan Jovanovic            <link offline="true"
189*60ba3965SDamjan Jovanovic                  href="http://java.sun.com/products/javabeans/glasgow/javadocs"
190*60ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/jaf-1.0.2"/>
191*60ba3965SDamjan Jovanovic            <link offline="true"
192*60ba3965SDamjan Jovanovic                  href="http://java.sun.com/products/javamail/javadocs"
193*60ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/javamail-1.3.1"/>
194*60ba3965SDamjan Jovanovic            <link offline="true"
195*60ba3965SDamjan Jovanovic                  href="http://ws.apache.org/soap/docs"
196*60ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/soap-2.3.1"/>
197*60ba3965SDamjan Jovanovic
198*60ba3965SDamjan Jovanovic            <bottom>&lt;i&gt;Copyright &amp;#169; 2004 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA&lt;/i&gt;</bottom>
199*60ba3965SDamjan Jovanovic            <header>${docname}</header>
200*60ba3965SDamjan Jovanovic
201*60ba3965SDamjan Jovanovic       </javadoc>
202*60ba3965SDamjan Jovanovic    </target>
203*60ba3965SDamjan Jovanovic
204*60ba3965SDamjan Jovanovic    <!-- zip documentation and store in build/doc/${target} -->
205*60ba3965SDamjan Jovanovic    <target name="zipdoc" depends="javadoc" if="build.dir" unless="javadocBuild.notRequired">
206*60ba3965SDamjan Jovanovic	<zip zipfile="${build.dir}/doc/${target}/${target}_javadoc.zip"
207*60ba3965SDamjan Jovanovic      basedir="${build.dir}/doc/${target}/javadoc"
208*60ba3965SDamjan Jovanovic      update="true"/>
209*60ba3965SDamjan Jovanovic    </target>
210*60ba3965SDamjan Jovanovic
211*60ba3965SDamjan Jovanovic    <!-- clean up -->
212*60ba3965SDamjan Jovanovic    <target name="clean" depends="prepare">
213*60ba3965SDamjan Jovanovic        <delete dir="${build.class}" includeEmptyDirs="true"/>
214*60ba3965SDamjan Jovanovic        <delete dir="${build.dir}/doc/${target}" includeEmptyDirs="true"/>
215*60ba3965SDamjan Jovanovic    </target>
216*60ba3965SDamjan Jovanovic
217*60ba3965SDamjan Jovanovic    <!-- create jar file -->
218*60ba3965SDamjan Jovanovic    <target name="jar" depends="prepare,compile" if="build.class">
219*60ba3965SDamjan Jovanovic        <jar jarfile="${build.class}/${jarname}.jar"
220*60ba3965SDamjan Jovanovic             basedir="${build.class}">
221*60ba3965SDamjan Jovanovic            <manifest>
222*60ba3965SDamjan Jovanovic                <attribute name="Class-Path" value="${jar-class-path} juh.jar jurt.jar ridl.jar unoil.jar"/>
223*60ba3965SDamjan Jovanovic                <attribute name="Solar-Version" value="${RSCREVISION}"/>
224*60ba3965SDamjan Jovanovic                <attribute name="RegistrationClassName" value="com.sun.star.sdbcx.comp.postgresql.PostgresqlDriver"/>
225*60ba3965SDamjan Jovanovic                <attribute name="Sealed" value="true"/>
226*60ba3965SDamjan Jovanovic                <attribute name="UNO-Type-Path" value=""/>
227*60ba3965SDamjan Jovanovic            </manifest>
228*60ba3965SDamjan Jovanovic            <include name="**/*.class"/>
229*60ba3965SDamjan Jovanovic            <include name="**/*.properties"/>
230*60ba3965SDamjan Jovanovic            <include name="**/*.css"/>
231*60ba3965SDamjan Jovanovic            <include name="**/*.dtd"/>
232*60ba3965SDamjan Jovanovic            <include name="**/*.form"/>
233*60ba3965SDamjan Jovanovic            <include name="**/*.gif "/>
234*60ba3965SDamjan Jovanovic            <include name="**/*.htm"/>
235*60ba3965SDamjan Jovanovic            <include name="**/*.html"/>
236*60ba3965SDamjan Jovanovic            <include name="**/*.js"/>
237*60ba3965SDamjan Jovanovic            <include name="**/*.mod"/>
238*60ba3965SDamjan Jovanovic            <include name="**/*.sql"/>
239*60ba3965SDamjan Jovanovic            <include name="**/*.xml"/>
240*60ba3965SDamjan Jovanovic            <include name="**/*.xsl"/>
241*60ba3965SDamjan Jovanovic            <include name="**/*.map"/>
242*60ba3965SDamjan Jovanovic        </jar>
243*60ba3965SDamjan Jovanovic    </target>
244*60ba3965SDamjan Jovanovic
245*60ba3965SDamjan Jovanovic    <target name="test" depends="prepare">
246*60ba3965SDamjan Jovanovic    </target>
247*60ba3965SDamjan Jovanovic
248*60ba3965SDamjan Jovanovic</project>
249*60ba3965SDamjan Jovanovic
250