-<?xml version="1.0"?>
-<!--
-
- build file to allow ant (http://jakarta.apache.org/ant/) to be used
- to build the PostgreSQL JDBC Driver
-
- $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.18 2001/09/23 04:11:14 momjian Exp $
-
--->
-
-<!DOCTYPE project [
- <!ENTITY jarfiles "postgresql.jar,postgresql-examples.jar">
-]>
-
-<project name="postgresqlJDBC" default="all" basedir=".">
-
- <!-- set global properties for this build -->
- <property name="srcdir" value="." />
- <property name="jardir" value="jars" />
- <property name="builddir" value="build" />
- <property name="package" value="org/postgresql" />
-
-
- <!--
- This is a simpler method than utils.CheckVersion
- It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
- in the CLASSPATH (ie JDK1.2 or later), and then enterprise if the
- javax.sql.DataSource class is present.
-
- Important: This must have the following order: jdbc1, jdbc2, enterprise
- -->
- <target name="check_versions">
- <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
- <available property="jdk1.2e+" classname="javax.sql.DataSource" />
- <available property="junit" classname="junit.framework.Test" />
- </target>
-
-
- <!-- default target -->
- <target name="all">
- <antcall target="jar" />
- </target>
-
-
- <!-- create the jar file -->
- <target name="jar" depends="compile,examples">
- <jar jarfile="${jardir}/postgresql.jar" whenempty="fail">
- <fileset dir="${builddir}">
- <include name="${package}/**/*.class" />
- <exclude name="${package}/test/**" />
- </fileset>
-
- <fileset dir="${srcdir}">
- <include name="${package}/*.properties" />
- </fileset>
- </jar>
-
- <jar jarfile="${jardir}/postgresql-examples.jar" whenempty="fail">
- <fileset dir="${builddir}">
- <include name="example/**/*.class" />
- </fileset>
-
- <fileset dir="${srcdir}">
- <include name="example/*.properties" />
- </fileset>
- </jar>
- </target>
-
-
- <!-- This is the core of the driver. It is common for all three versions. -->
- <target name="compile" depends="prepare,check_versions,driver">
- <javac srcdir="${srcdir}" destdir="${builddir}">
- <include name="${package}/**" />
-
- <exclude name="${package}/jdbc1/**" if="jdk1.2+" />
- <exclude name="${package}/jdbc2/**" unless="jdk1.2+" />
-
- <exclude name="${package}/largeobject/PGblob.java" unless="jdk1.2+" />
- <exclude name="${package}/largeobject/PGclob.java" unless="jdk1.2+" />
-
- <exclude name="${package}/PostgresqlDataSource.java" unless="jdk1.2e+" />
- <exclude name="${package}/xa/**" unless="jdk1.2e+" />
-
- <exclude name="${package}/test/**" unless="junit" />
- </javac>
- </target>
-
-
- <!--
- This generates Driver.java from Driver.java.in
- It's required for importing the driver version properties
- -->
- <target name="driver" depends="prepare,check_versions">
- <!-- determine the edition text -->
- <property name="edition" value="JDBC1" />
- <available property="edition" value="JDBC2" classname="java.lang.ThreadLocal" />
- <available property="edition" value="JDBC2" classname="java.lang.StrictMath" />
- <available property="edition" value="JDBC2 Enterprise" classname="javax.sql.DataSource" />
-
- <!-- determine the connection class -->
- <property name="connectclass" value="org.postgresql.jdbc1.Connection" />
- <available property="connectclass" value="org.postgresql.jdbc2.Connection" classname="java.lang.ThreadLocal" />
-
- <!-- Some defaults -->
- <filter token="MAJORVERSION" value="${major}" />
- <filter token="MINORVERSION" value="${minor}" />
- <filter token="VERSION" value="PostgreSQL ${fullversion} ${edition}" />
- <filter token="JDBCCONNECTCLASS" value="${connectclass}" />
- <filter token="DEF_PGPORT" value="${def_pgport}" />
-
- <!-- Put a check for the current version here -->
-
- <!-- now copy and filter the file -->
- <copy file="${package}/Driver.java.in"
- tofile="${package}/Driver.java"
- filtering="yes" />
-
- <echo message="Configured build for the ${edition} edition driver" />
- </target>
-
-
- <!-- Prepares the build directory -->
- <target name="prepare">
- <mkdir dir="${builddir}" />
- <mkdir dir="${jardir}" />
- </target>
-
-
- <!-- This builds the examples -->
- <target name="examples" depends="compile">
- <javac srcdir="${srcdir}" destdir="${builddir}">
- <include name="example/**" />
- <exclude name="example/corba/**"/>
- <exclude name="example/blobtest.java" unless="jdk1.2+"/>
- </javac>
- </target>
-
-
- <!-- Builds the corba example -->
- <target name="corba" if="jdk1.2+">
- <exec dir="${srcdir}/example/corba" executable="idl2java">
- <arg value="stock.idl" />
- </exec>
-
- <javac srcdir="${srcdir}" destdir="${builddir}">
- <include name="example/corba/**" />
- </javac>
- </target>
-
-
-
- <!-- Install the jar files -->
- <target name="install" depends="all" if="install.directory">
- <copy todir="${install.directory}" overwrite="true">
- <fileset dir="${jardir}" includes="&jarfiles;" />
- </copy>
- </target>
-
-
- <!-- Uninstall the jar file -->
- <target name="uninstall" if="install.directory">
- <delete>
- <fileset dir="${install.directory}" includes="&jarfiles;" />
- </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}" />
- <delete quiet="true" file="${package}/Driver.java" />
- </target>
-
-
-
- <!-- This compiles and executes the JUnit tests -->
-
- <!-- defaults for the tests - override these if required -->
- <property name="database" value="jdbc:postgresql:test" />
- <property name="username" value="test" />
- <!-- Password must be something. Doesn't matter if trust is used! -->
- <property name="password" value="password" />
- <!-- junit.ui is one of textui, awtui, or swingui -->
- <property name="junit.ui" value="textui" />
-
-
- <target name="test" depends="jar" if="junit">
- <javac srcdir="${srcdir}" destdir="${builddir}">
- <include name="${package}/test/jdbc2/**" if="jdk1.2+" />
- <include name="${package}/test/java2ee/**" if="jdk1.2e+" />
- </javac>
-
- <java fork="yes" classname="junit.${junit.ui}.TestRunner" taskname="junit" failonerror="true">
- <arg value="org.postgresql.test.JDBC2Tests" />
- <sysproperty key="database" value="${database}" />
- <sysproperty key="username" value="${username}" />
- <sysproperty key="password" value="${password}" />
- <classpath>
- <pathelement location="${builddir}" />
- <pathelement path="${java.class.path}" />
- </classpath>
- </java>
- </target>
-
-</project>
+<?xml version="1.0"?>\r
+<!--\r
+\r
+ build file to allow ant (http://jakarta.apache.org/ant/) to be used\r
+ to build the PostgreSQL JDBC Driver\r
+\r
+ $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.19 2002/02/22 02:07:30 davec Exp $\r
+\r
+-->\r
+\r
+<!DOCTYPE project [\r
+ <!ENTITY jarfiles "postgresql.jar,postgresql-examples.jar">\r
+]>\r
+\r
+<project name="postgresqlJDBC" default="all" basedir=".">\r
+\r
+ <!-- set global properties for this build -->\r
+ <property name="srcdir" value="." />\r
+ <property name="jardir" value="jars" />\r
+ <property name="builddir" value="build" />\r
+ <property name="package" value="org/postgresql" />\r
+ <property name="debug" value="yes" />\r
+ \r
+ <!--\r
+ This is a simpler method than utils.CheckVersion\r
+ It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is\r
+ in the CLASSPATH (ie JDK1.2 or later), and then enterprise if the\r
+ javax.sql.DataSource class is present.\r
+\r
+ Important: This must have the following order: jdbc1, jdbc2, enterprise\r
+ -->\r
+ <target name="check_versions">\r
+ <condition property="jdbc1">\r
+ <equals arg1="${ant.java.version}" arg2="1.1"/>\r
+ </condition>\r
+ <condition property="jdbc2">\r
+ <or>\r
+ <equals arg1="${ant.java.version}" arg2="1.2"/>\r
+ <equals arg1="${ant.java.version}" arg2="1.3"/>\r
+ </or>\r
+ </condition> \r
+ <condition property="jdbc3">\r
+ <equals arg1="${ant.java.version}" arg2="1.4"/>\r
+ </condition>\r
+ <condition property="datasource">\r
+ <and>\r
+ <equals arg1="${jdbc2}" arg2="true" /> \r
+ <available classname="javax.sql.DataSource"/>\r
+ </and>\r
+ </condition>\r
+ <available property="junit" classname="junit.framework.Test" />\r
+ </target>\r
+\r
+\r
+ <!-- default target -->\r
+ <target name="all">\r
+ <antcall target="jar" />\r
+ </target>\r
+\r
+\r
+ <!-- create the jar file -->\r
+ <target name="jar" depends="compile,examples">\r
+ <jar jarfile="${jardir}/postgresql.jar" whenempty="fail">\r
+ <fileset dir="${builddir}">\r
+ <include name="${package}/**/*.class" />\r
+ <exclude name="${package}/test/**" />\r
+ </fileset>\r
+\r
+ <fileset dir="${srcdir}">\r
+ <include name="${package}/*.properties" />\r
+ </fileset>\r
+ </jar>\r
+\r
+ <jar jarfile="${jardir}/postgresql-examples.jar" whenempty="fail">\r
+ <fileset dir="${builddir}">\r
+ <include name="example/**/*.class" />\r
+ </fileset>\r
+\r
+ <fileset dir="${srcdir}">\r
+ <include name="example/*.properties" />\r
+ </fileset>\r
+ </jar>\r
+ </target>\r
+\r
+\r
+ <!-- This is the core of the driver. It is common for all three versions. -->\r
+ <target name="compile" depends="prepare,check_versions,driver">\r
+ <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">\r
+ <include name="${package}/**" />\r
+\r
+ <exclude name="${package}/jdbc1/**" unless="jdbc1"/>\r
+ <exclude name="${package}/jdbc2/**" unless="jdbc2"/>\r
+\r
+ <exclude name="${package}/largeobject/PGblob.java" unless="jdbc2" />\r
+ <exclude name="${package}/largeobject/PGclob.java" unless="jdbc2" />\r
+\r
+ <exclude name="${package}/PostgresqlDataSource.java" unless="datasource" />\r
+ <exclude name="${package}/xa/**" unless="datasource" />\r
+\r
+ <exclude name="${package}/test/**" unless="junit" />\r
+ </javac>\r
+ </target>\r
+\r
+\r
+ <!--\r
+ This generates Driver.java from Driver.java.in\r
+ It's required for importing the driver version properties\r
+ -->\r
+ <target name="driver" depends="prepare,check_versions">\r
+ <!-- determine the edition text -->\r
+ <property name="edition" value="JDBC1" />\r
+ <condition property="edition" value="JDBC2">\r
+ <or>\r
+ <equals arg1="${jdbc2}" arg2="true"/>\r
+ <equals arg1="${jdbc3}" arg2="true"/> <!-- fake it for now -->\r
+ \r
+ </or>\r
+ </condition>\r
+ \r
+ <condition property="edition" value="JDBC2 Enterprise">\r
+ <and>\r
+ <available classname="javax.sql.DataSource" />\r
+ <equals arg1="${jdbc2}" arg2="true"/>\r
+ </and>\r
+ </condition>\r
+\r
+ <!-- determine the connection class -->\r
+ <property name="connectclass" value="org.postgresql.jdbc1.Connection" />\r
+ <available property="connectclass" value="org.postgresql.jdbc2.Connection" classname="java.lang.ThreadLocal" />\r
+\r
+ <!-- Some defaults -->\r
+ <filter token="MAJORVERSION" value="${major}" />\r
+ <filter token="MINORVERSION" value="${minor}" />\r
+ <filter token="VERSION" value="PostgreSQL ${fullversion} ${edition}" />\r
+ <filter token="JDBCCONNECTCLASS" value="${connectclass}" />\r
+ <filter token="DEF_PGPORT" value="${def_pgport}" />\r
+\r
+ <!-- Put a check for the current version here -->\r
+\r
+ <!-- now copy and filter the file -->\r
+ <copy file="${package}/Driver.java.in"\r
+ tofile="${package}/Driver.java"\r
+ filtering="yes" />\r
+\r
+ <echo message="Configured build for the ${edition} edition driver" />\r
+ </target>\r
+\r
+\r
+ <!-- Prepares the build directory -->\r
+ <target name="prepare">\r
+ <mkdir dir="${builddir}" />\r
+ <mkdir dir="${jardir}" />\r
+ </target>\r
+\r
+\r
+ <!-- This builds the examples -->\r
+ <target name="examples" depends="compile">\r
+ <javac srcdir="${srcdir}" destdir="${builddir}">\r
+ <include name="example/**" />\r
+ <exclude name="example/corba/**"/>\r
+ <exclude name="example/blobtest.java" unless="jdk1.2+"/>\r
+ </javac>\r
+ </target>\r
+\r
+\r
+ <!-- Builds the corba example -->\r
+ <target name="corba" if="jdk1.2+">\r
+ <exec dir="${srcdir}/example/corba" executable="idl2java">\r
+ <arg value="stock.idl" />\r
+ </exec>\r
+\r
+ <javac srcdir="${srcdir}" destdir="${builddir}">\r
+ <include name="example/corba/**" />\r
+ </javac>\r
+ </target>\r
+\r
+\r
+\r
+ <!-- Install the jar files -->\r
+ <target name="install" depends="all" if="install.directory">\r
+ <copy todir="${install.directory}" overwrite="true">\r
+ <fileset dir="${jardir}" includes="&jarfiles;" />\r
+ </copy>\r
+ </target>\r
+\r
+\r
+ <!-- Uninstall the jar file -->\r
+ <target name="uninstall" if="install.directory">\r
+ <delete>\r
+ <fileset dir="${install.directory}" includes="&jarfiles;" />\r
+ </delete>\r
+ </target>\r
+\r
+\r
+\r
+ <!-- This target removes any class files from the build directory -->\r
+ <target name="clean">\r
+ <delete quiet="true" dir="${builddir}" />\r
+ <delete quiet="true" dir="${jardir}" />\r
+ <delete quiet="true" file="${package}/Driver.java" />\r
+ </target>\r
+\r
+\r
+\r
+ <!-- This compiles and executes the JUnit tests -->\r
+\r
+ <!-- defaults for the tests - override these if required -->\r
+ <property name="database" value="jdbc:postgresql:test" />\r
+ <property name="username" value="test" />\r
+ <!-- Password must be something. Doesn't matter if trust is used! -->\r
+ <property name="password" value="password" />\r
+ <!-- junit.ui is one of textui, awtui, or swingui -->\r
+ <property name="junit.ui" value="textui" />\r
+\r
+\r
+ <target name="test" depends="jar" if="junit">\r
+ <javac srcdir="${srcdir}" destdir="${builddir}">\r
+ <include name="${package}/test/jdbc2/**" if="jdk1.2+" />\r
+ <include name="${package}/test/java2ee/**" if="jdk1.2e+" />\r
+ </javac>\r
+\r
+ <java fork="yes" classname="junit.${junit.ui}.TestRunner" taskname="junit" failonerror="true">\r
+ <arg value="org.postgresql.test.JDBC2Tests" />\r
+ <sysproperty key="database" value="${database}" />\r
+ <sysproperty key="username" value="${username}" />\r
+ <sysproperty key="password" value="${password}" />\r
+ <classpath>\r
+ <pathelement location="${builddir}" />\r
+ <pathelement path="${java.class.path}" />\r
+ </classpath>\r
+ </java>\r
+ </target>\r
+\r
+</project>\r