160ba3965SDamjan Jovanovic<?xml version="1.0" encoding="UTF-8"?>
260ba3965SDamjan Jovanovic<!--***********************************************************
360ba3965SDamjan Jovanovic *
460ba3965SDamjan Jovanovic * Licensed to the Apache Software Foundation (ASF) under one
560ba3965SDamjan Jovanovic * or more contributor license agreements.  See the NOTICE file
660ba3965SDamjan Jovanovic * distributed with this work for additional information
760ba3965SDamjan Jovanovic * regarding copyright ownership.  The ASF licenses this file
860ba3965SDamjan Jovanovic * to you under the Apache License, Version 2.0 (the
960ba3965SDamjan Jovanovic * "License"); you may not use this file except in compliance
1060ba3965SDamjan Jovanovic * with the License.  You may obtain a copy of the License at
1160ba3965SDamjan Jovanovic *
1260ba3965SDamjan Jovanovic *   http://www.apache.org/licenses/LICENSE-2.0
1360ba3965SDamjan Jovanovic *
1460ba3965SDamjan Jovanovic * Unless required by applicable law or agreed to in writing,
1560ba3965SDamjan Jovanovic * software distributed under the License is distributed on an
1660ba3965SDamjan Jovanovic * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1760ba3965SDamjan Jovanovic * KIND, either express or implied.  See the License for the
1860ba3965SDamjan Jovanovic * specific language governing permissions and limitations
1960ba3965SDamjan Jovanovic * under the License.
2060ba3965SDamjan Jovanovic *
2160ba3965SDamjan Jovanovic ***********************************************************-->
2260ba3965SDamjan Jovanovic
2360ba3965SDamjan Jovanovic
2460ba3965SDamjan Jovanovic<project name="dbtools" default="main" basedir=".">
2560ba3965SDamjan Jovanovic
2660ba3965SDamjan Jovanovic    <!-- ================================================================= -->
2760ba3965SDamjan Jovanovic    <!-- settings                                                          -->
2860ba3965SDamjan Jovanovic    <!-- ================================================================= -->
2960ba3965SDamjan Jovanovic
3060ba3965SDamjan Jovanovic    <!-- global properties -->
3160ba3965SDamjan Jovanovic    <property file="../../../ant.properties"/>
3260ba3965SDamjan Jovanovic    <!-- version info -->
3360ba3965SDamjan Jovanovic    <property file="../../../solenv/inc/minor.mk"/>
3460ba3965SDamjan Jovanovic
3560ba3965SDamjan Jovanovic    <!-- name of this sub target used in recursive builds -->
3660ba3965SDamjan Jovanovic    <property name="target" value="dbtools"/>
3760ba3965SDamjan Jovanovic
3860ba3965SDamjan Jovanovic    <!-- name of jar file created, without .jar extension -->
3960ba3965SDamjan Jovanovic    <property name="jarname" value="dbtools"/>
4060ba3965SDamjan Jovanovic
4160ba3965SDamjan Jovanovic    <!-- relative path to project directory -->
4260ba3965SDamjan Jovanovic    <property name="prj" value="../.."/>
4360ba3965SDamjan Jovanovic
4460ba3965SDamjan Jovanovic    <!-- build output directory -->
4560ba3965SDamjan Jovanovic    <!-- FIXME: there are also extremely rare/obsolete dbcs/bndchk/truetime/hbtoolkit cases in main/solenv/inc/settings.mk -->
4660ba3965SDamjan Jovanovic    <condition property="out" value="${prj}/${OUTPATH}.cap">
4760ba3965SDamjan Jovanovic        <isset property="${profile}"/>
4860ba3965SDamjan Jovanovic    </condition>
4960ba3965SDamjan Jovanovic    <condition property="out" value="${prj}/${OUTPATH}.pro">
5060ba3965SDamjan Jovanovic        <isset property="${PRODUCT}"/>
5160ba3965SDamjan Jovanovic    </condition>
5260ba3965SDamjan Jovanovic    <property name="out" value="${prj}/${OUTPATH}"/>
5360ba3965SDamjan Jovanovic
5460ba3965SDamjan Jovanovic    <!-- build directories -->
5560ba3965SDamjan Jovanovic    <property name="build.dir" value="${out}"/>
5660ba3965SDamjan Jovanovic    <property name="build.class" value="${build.dir}/class/${target}"/>
5760ba3965SDamjan Jovanovic    <property name="build.misc" value="${build.dir}/misc/${target}"/>
5860ba3965SDamjan Jovanovic
5960ba3965SDamjan Jovanovic    <!-- start of java source code package structure -->
6060ba3965SDamjan Jovanovic    <property name="java.dir" value="src"/>
6160ba3965SDamjan Jovanovic
6260ba3965SDamjan Jovanovic    <!-- define how to handle CLASSPATH environment -->
6360ba3965SDamjan Jovanovic    <property name="build.sysclasspath" value="ignore"/>
6460ba3965SDamjan Jovanovic
6560ba3965SDamjan Jovanovic    <!-- classpath settings for compile and javadoc tasks -->
6660ba3965SDamjan Jovanovic    <condition property="jar-class-path" value="${COMMONS_LANG_JAR}" else="commons-lang3-3.3.jar">
6760ba3965SDamjan Jovanovic        <equals arg1="${SYSTEM_APACHE_COMMONS}" arg2="YES"/>
6860ba3965SDamjan Jovanovic    </condition>
6960ba3965SDamjan Jovanovic    <condition property="commons-lang-jar" value="${COMMONS_LANG_JAR}" else="${OUTDIR}/bin/commons-lang3-3.3.jar">
7060ba3965SDamjan Jovanovic        <equals arg1="${SYSTEM_APACHE_COMMONS}" arg2="YES"/>
7160ba3965SDamjan Jovanovic    </condition>
7260ba3965SDamjan Jovanovic    <path id="classpath">
7360ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/juh.jar"/>
7460ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/jurt.jar"/>
7560ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/ridl.jar"/>
7660ba3965SDamjan Jovanovic        <pathelement location="${OUTDIR}/bin/unoil.jar"/>
7760ba3965SDamjan Jovanovic        <!-- 3rd party libs -->
7860ba3965SDamjan Jovanovic        <pathelement location="${commons-lang-jar}"/>
7960ba3965SDamjan Jovanovic    </path>
8060ba3965SDamjan Jovanovic
8160ba3965SDamjan Jovanovic    <!-- name to display in documentation -->
8260ba3965SDamjan Jovanovic    <property name="docname" value="dbtools"/>
8360ba3965SDamjan Jovanovic
8460ba3965SDamjan Jovanovic    <!-- set "modern" java compiler -->
8560ba3965SDamjan Jovanovic    <property name="build.compiler" value="modern"/>
8660ba3965SDamjan Jovanovic
87*940681c7SMatthias Seidel    <!-- set whether we want to compile with debug information -->
8860ba3965SDamjan Jovanovic    <property name="debug" value="on"/>
8960ba3965SDamjan Jovanovic
90*940681c7SMatthias Seidel    <!-- set whether we want to compile with optimisation -->
9160ba3965SDamjan Jovanovic    <property name="optimize" value="off"/>
9260ba3965SDamjan Jovanovic
93*940681c7SMatthias Seidel    <!-- set whether we want to compile with or without deprecation -->
9460ba3965SDamjan Jovanovic    <property name="deprecation" value="on"/>
9560ba3965SDamjan Jovanovic
9660ba3965SDamjan Jovanovic    <target name="info">
9760ba3965SDamjan Jovanovic        <echo message="--------------------"/>
9860ba3965SDamjan Jovanovic        <echo message="${target}"/>
9960ba3965SDamjan Jovanovic        <echo message="--------------------"/>
10060ba3965SDamjan Jovanovic    </target>
10160ba3965SDamjan Jovanovic
10260ba3965SDamjan Jovanovic    <!-- ================================================================= -->
10360ba3965SDamjan Jovanovic    <!-- custom targets                                                    -->
10460ba3965SDamjan Jovanovic    <!-- ================================================================= -->
10560ba3965SDamjan Jovanovic
10660ba3965SDamjan Jovanovic    <!-- the main target, called in recursive builds -->
10760ba3965SDamjan Jovanovic    <target name="main" depends="info,prepare,compile,jar,javadoc,zipdoc"/>
10860ba3965SDamjan Jovanovic
10960ba3965SDamjan Jovanovic    <!-- prepare output directories -->
11060ba3965SDamjan Jovanovic    <target name="prepare">
11160ba3965SDamjan Jovanovic        <mkdir dir="${build.dir}"/>
11260ba3965SDamjan Jovanovic        <mkdir dir="${build.dir}/doc/${target}"/>
11360ba3965SDamjan Jovanovic        <mkdir dir="${build.class}"/>
11460ba3965SDamjan Jovanovic        <mkdir dir="${build.misc}"/>
11560ba3965SDamjan Jovanovic    </target>
11660ba3965SDamjan Jovanovic
11760ba3965SDamjan Jovanovic
11860ba3965SDamjan Jovanovic    <target name="res" depends="prepare">
11960ba3965SDamjan Jovanovic        <copy todir="${build.class}">
12060ba3965SDamjan Jovanovic             <fileset dir="${java.dir}">
12160ba3965SDamjan Jovanovic                 <include name="**/*.properties"/>
12260ba3965SDamjan Jovanovic                 <include name="**/*.css"/>
12360ba3965SDamjan Jovanovic                 <include name="**/*.dtd"/>
12460ba3965SDamjan Jovanovic                 <include name="**/*.form"/>
12560ba3965SDamjan Jovanovic                 <include name="**/*.gif "/>
12660ba3965SDamjan Jovanovic                 <include name="**/*.htm"/>
12760ba3965SDamjan Jovanovic                 <include name="**/*.html"/>
12860ba3965SDamjan Jovanovic                 <include name="**/*.js"/>
12960ba3965SDamjan Jovanovic                 <include name="**/*.mod"/>
13060ba3965SDamjan Jovanovic                 <include name="**/*.sql"/>
13160ba3965SDamjan Jovanovic                 <include name="**/*.xml"/>
13260ba3965SDamjan Jovanovic                 <include name="**/*.xsl"/>
13360ba3965SDamjan Jovanovic                 <include name="**/*.map"/>
13460ba3965SDamjan Jovanovic
13560ba3965SDamjan Jovanovic             </fileset>
13660ba3965SDamjan Jovanovic        </copy>
13760ba3965SDamjan Jovanovic    </target>
13860ba3965SDamjan Jovanovic
13960ba3965SDamjan Jovanovic
14060ba3965SDamjan Jovanovic    <target name="compile" depends="prepare,res">
14160ba3965SDamjan Jovanovic	<javac destdir="${build.class}"
14260ba3965SDamjan Jovanovic	       debug="${debug}"
14360ba3965SDamjan Jovanovic               debuglevel="lines,vars,source"
14460ba3965SDamjan Jovanovic               deprecation="${deprecation}"
14560ba3965SDamjan Jovanovic	       optimize="${optimize}"
14660ba3965SDamjan Jovanovic	       classpathref="classpath">
14760ba3965SDamjan Jovanovic            <src path="${java.dir}"/>
14860ba3965SDamjan Jovanovic	    <include name="**/*.java"/>
14960ba3965SDamjan Jovanovic	</javac>
15060ba3965SDamjan Jovanovic    </target>
15160ba3965SDamjan Jovanovic
15260ba3965SDamjan Jovanovic    <!-- check if javadoc is up to date -->
15360ba3965SDamjan Jovanovic    <target name="javadoc_check" depends="prepare" if="build.dir">
15460ba3965SDamjan Jovanovic	<uptodate property="javadocBuild.notRequired" value="true"
15560ba3965SDamjan Jovanovic            targetfile="${build.dir}/doc/${target}/${target}_javadoc.zip">
15660ba3965SDamjan Jovanovic		<srcfiles dir="${java.dir}" includes="**/*.java"/>
15760ba3965SDamjan Jovanovic	</uptodate>
15860ba3965SDamjan Jovanovic    </target>
15960ba3965SDamjan Jovanovic
16060ba3965SDamjan Jovanovic    <!-- generate java documentation -->
16160ba3965SDamjan Jovanovic    <target name="javadoc" depends="prepare,javadoc_check,compile"
16260ba3965SDamjan Jovanovic         unless="javadocBuild.notRequired"
16360ba3965SDamjan Jovanovic         if="build.dir">
16460ba3965SDamjan Jovanovic
16560ba3965SDamjan Jovanovic        <javadoc destdir="${build.dir}/doc/${target}/javadoc"
16660ba3965SDamjan Jovanovic                 verbose="false"
16760ba3965SDamjan Jovanovic                 author="false"
16860ba3965SDamjan Jovanovic                 nodeprecated="true"
16960ba3965SDamjan Jovanovic                 nodeprecatedlist="true"
17060ba3965SDamjan Jovanovic                 use="true"
17160ba3965SDamjan Jovanovic                 Doctitle="${docname}"
17260ba3965SDamjan Jovanovic                 windowtitle="${docname}"
17360ba3965SDamjan Jovanovic                 classpathref="classpath">
17460ba3965SDamjan Jovanovic
17560ba3965SDamjan Jovanovic            <packageset dir="${java.dir}" defaultexcludes="yes">
17660ba3965SDamjan Jovanovic                <include name="com/**"/>
17760ba3965SDamjan Jovanovic                <include name="org/**"/>
17860ba3965SDamjan Jovanovic            </packageset>
17960ba3965SDamjan Jovanovic
18060ba3965SDamjan Jovanovic            <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api"
18160ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/jdk1.4.2"/>
18260ba3965SDamjan Jovanovic            <link offline="true"
18360ba3965SDamjan Jovanovic                  href="http://java.sun.com/products/servlet/2.3/javadoc"
18460ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/servlet2.3"/>
18560ba3965SDamjan Jovanovic            <link offline="true"
18660ba3965SDamjan Jovanovic                  href="http://logging.apache.org/log4j/docs/api"
18760ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/log4j-1.2.8"/>
18860ba3965SDamjan Jovanovic            <link offline="true"
18960ba3965SDamjan Jovanovic                  href="http://java.sun.com/products/javabeans/glasgow/javadocs"
19060ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/jaf-1.0.2"/>
19160ba3965SDamjan Jovanovic            <link offline="true"
19260ba3965SDamjan Jovanovic                  href="http://java.sun.com/products/javamail/javadocs"
19360ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/javamail-1.3.1"/>
19460ba3965SDamjan Jovanovic            <link offline="true"
19560ba3965SDamjan Jovanovic                  href="http://ws.apache.org/soap/docs"
19660ba3965SDamjan Jovanovic                  packagelistLoc="${common.doc}/soap-2.3.1"/>
19760ba3965SDamjan Jovanovic
19860ba3965SDamjan 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>
19960ba3965SDamjan Jovanovic            <header>${docname}</header>
20060ba3965SDamjan Jovanovic
20160ba3965SDamjan Jovanovic       </javadoc>
20260ba3965SDamjan Jovanovic    </target>
20360ba3965SDamjan Jovanovic
20460ba3965SDamjan Jovanovic    <!-- zip documentation and store in build/doc/${target} -->
20560ba3965SDamjan Jovanovic    <target name="zipdoc" depends="javadoc" if="build.dir" unless="javadocBuild.notRequired">
20660ba3965SDamjan Jovanovic	<zip zipfile="${build.dir}/doc/${target}/${target}_javadoc.zip"
20760ba3965SDamjan Jovanovic      basedir="${build.dir}/doc/${target}/javadoc"
20860ba3965SDamjan Jovanovic      update="true"/>
20960ba3965SDamjan Jovanovic    </target>
21060ba3965SDamjan Jovanovic
21160ba3965SDamjan Jovanovic    <!-- clean up -->
21260ba3965SDamjan Jovanovic    <target name="clean" depends="prepare">
21360ba3965SDamjan Jovanovic        <delete dir="${build.class}" includeEmptyDirs="true"/>
21460ba3965SDamjan Jovanovic        <delete dir="${build.dir}/doc/${target}" includeEmptyDirs="true"/>
21560ba3965SDamjan Jovanovic    </target>
21660ba3965SDamjan Jovanovic
21760ba3965SDamjan Jovanovic    <!-- create jar file -->
21860ba3965SDamjan Jovanovic    <target name="jar" depends="prepare,compile" if="build.class">
21960ba3965SDamjan Jovanovic        <jar jarfile="${build.class}/${jarname}.jar"
22060ba3965SDamjan Jovanovic             basedir="${build.class}">
22160ba3965SDamjan Jovanovic            <manifest>
22260ba3965SDamjan Jovanovic                <attribute name="Class-Path" value="${jar-class-path} juh.jar jurt.jar ridl.jar unoil.jar"/>
22360ba3965SDamjan Jovanovic                <attribute name="Solar-Version" value="${RSCREVISION}"/>
22460ba3965SDamjan Jovanovic                <attribute name="RegistrationClassName" value="com.sun.star.sdbcx.comp.postgresql.PostgresqlDriver"/>
22560ba3965SDamjan Jovanovic                <attribute name="Sealed" value="true"/>
22660ba3965SDamjan Jovanovic                <attribute name="UNO-Type-Path" value=""/>
22760ba3965SDamjan Jovanovic            </manifest>
22860ba3965SDamjan Jovanovic            <include name="**/*.class"/>
22960ba3965SDamjan Jovanovic            <include name="**/*.properties"/>
23060ba3965SDamjan Jovanovic            <include name="**/*.css"/>
23160ba3965SDamjan Jovanovic            <include name="**/*.dtd"/>
23260ba3965SDamjan Jovanovic            <include name="**/*.form"/>
23360ba3965SDamjan Jovanovic            <include name="**/*.gif "/>
23460ba3965SDamjan Jovanovic            <include name="**/*.htm"/>
23560ba3965SDamjan Jovanovic            <include name="**/*.html"/>
23660ba3965SDamjan Jovanovic            <include name="**/*.js"/>
23760ba3965SDamjan Jovanovic            <include name="**/*.mod"/>
23860ba3965SDamjan Jovanovic            <include name="**/*.sql"/>
23960ba3965SDamjan Jovanovic            <include name="**/*.xml"/>
24060ba3965SDamjan Jovanovic            <include name="**/*.xsl"/>
24160ba3965SDamjan Jovanovic            <include name="**/*.map"/>
24260ba3965SDamjan Jovanovic        </jar>
24360ba3965SDamjan Jovanovic    </target>
24460ba3965SDamjan Jovanovic
24560ba3965SDamjan Jovanovic    <target name="test" depends="prepare">
24660ba3965SDamjan Jovanovic    </target>
24760ba3965SDamjan Jovanovic
24860ba3965SDamjan Jovanovic</project>
24960ba3965SDamjan Jovanovic
250