summaryrefslogtreecommitdiff
path: root/contrib/retep/build.xml
blob: 04a8db5c2f01186452a6f51c8ba5e1cee39d218f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0"?>
<!--

  build file to build the donated retep tools packages

  $Header: /cvsroot/pgsql/contrib/retep/Attic/build.xml,v 1.8 2001/07/06 23:07:20 petere Exp $

-->

<!DOCTYPE project [
  <!ENTITY jarname "retepTools.jar">
]>

<project name="retep" default="all" basedir=".">

  <!-- set global properties for this build -->
  <property name="srcdir"  value="." />
  <property name="builddir" value="build" />
  <property name="package" value="uk/org/retep" />
  <property name="jardir"  value="jars" />

  <!-- Some checks used to build dependent on the environment -->
  <target name="checks">
    <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
    <available property="jdk1.3+" classname="java.lang.StrictMath" />
    <available property="jdk1.2e+" classname="javax.sql.DataSource" />
    <available property="xml" classname="org.xml.sax.Parser" />
  </target>

  <target name="warning" depends="checks" unless="jdk1.2+">
    <echo>
*** WARNING: Contributed retep tools need jdk1.2 or later.
***          Compilation NOT done
    </echo>
  </target>


  <!-- default target -->
  <target name="all">
    <antcall target="jar" />
  </target>


  <!-- Builds the various jar files -->
  <target name="jar" depends="compile">
    <jar jarfile="${jardir}/&jarname;" whenempty="fail">
       <fileset dir="${builddir}">
         <include name="**/*.class" />
       </fileset>

       <fileset dir="${srcdir}">
         <include name="**/*.properties" />
       </fileset>
    </jar>
  </target> 


  <!-- Builds the XML Tools -->
  <target name="compile" depends="checks,prepare,warning" if="jdk1.2+">
    <javac srcdir="${srcdir}" destdir="${builddir}">
      <include name="${package}/**" />
      <exclude name="${package}/**" unless="jdk1.2+" />
    </javac>
  </target>


  <!-- Prepares the build by creating a directory to place the class files -->
  <target name="prepare">
    <mkdir dir="${builddir}" />
    <mkdir dir="${jardir}" />
  </target>


  <target name="install" depends="all" if="install.directory">
    <copy todir="${install.directory}" overwrite="true" filtering="off">
      <fileset dir="${jardir}">
        <include name="&jarname;" />
      </fileset>
    </copy>
  </target>


  <target name="uninstall" if="install.directory">
    <delete>
      <fileset dir="${install.directory}">
        <include name="&jarname;" />
      </fileset>
    </delete>
  </target>


  <!-- This target removes any class files from the build directory -->
  <target name="clean">
    <delete quiet="true" dir="${builddir}" />
    <delete quiet="true" dir="${jardir}" />
  </target>

</project>