Commit 178961ad authored by Dave Cramer's avatar Dave Cramer

now compiles clean with jdk 1.4

parent 2ea01da5
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
build file to allow ant (http://jakarta.apache.org/ant/) to be used build file to allow ant (http://jakarta.apache.org/ant/) to be used
to build the PostgreSQL JDBC Driver 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 $ $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.19 2002/02/22 02:07:30 davec Exp $
--> -->
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<property name="jardir" value="jars" /> <property name="jardir" value="jars" />
<property name="builddir" value="build" /> <property name="builddir" value="build" />
<property name="package" value="org/postgresql" /> <property name="package" value="org/postgresql" />
<property name="debug" value="yes" />
<!-- <!--
This is a simpler method than utils.CheckVersion This is a simpler method than utils.CheckVersion
...@@ -30,8 +30,24 @@ ...@@ -30,8 +30,24 @@
Important: This must have the following order: jdbc1, jdbc2, enterprise Important: This must have the following order: jdbc1, jdbc2, enterprise
--> -->
<target name="check_versions"> <target name="check_versions">
<available property="jdk1.2+" classname="java.lang.ThreadLocal" /> <condition property="jdbc1">
<available property="jdk1.2e+" classname="javax.sql.DataSource" /> <equals arg1="${ant.java.version}" arg2="1.1"/>
</condition>
<condition property="jdbc2">
<or>
<equals arg1="${ant.java.version}" arg2="1.2"/>
<equals arg1="${ant.java.version}" arg2="1.3"/>
</or>
</condition>
<condition property="jdbc3">
<equals arg1="${ant.java.version}" arg2="1.4"/>
</condition>
<condition property="datasource">
<and>
<equals arg1="${jdbc2}" arg2="true" />
<available classname="javax.sql.DataSource"/>
</and>
</condition>
<available property="junit" classname="junit.framework.Test" /> <available property="junit" classname="junit.framework.Test" />
</target> </target>
...@@ -69,17 +85,17 @@ ...@@ -69,17 +85,17 @@
<!-- This is the core of the driver. It is common for all three versions. --> <!-- This is the core of the driver. It is common for all three versions. -->
<target name="compile" depends="prepare,check_versions,driver"> <target name="compile" depends="prepare,check_versions,driver">
<javac srcdir="${srcdir}" destdir="${builddir}"> <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
<include name="${package}/**" /> <include name="${package}/**" />
<exclude name="${package}/jdbc1/**" if="jdk1.2+" /> <exclude name="${package}/jdbc1/**" unless="jdbc1"/>
<exclude name="${package}/jdbc2/**" unless="jdk1.2+" /> <exclude name="${package}/jdbc2/**" unless="jdbc2"/>
<exclude name="${package}/largeobject/PGblob.java" unless="jdk1.2+" /> <exclude name="${package}/largeobject/PGblob.java" unless="jdbc2" />
<exclude name="${package}/largeobject/PGclob.java" unless="jdk1.2+" /> <exclude name="${package}/largeobject/PGclob.java" unless="jdbc2" />
<exclude name="${package}/PostgresqlDataSource.java" unless="jdk1.2e+" /> <exclude name="${package}/PostgresqlDataSource.java" unless="datasource" />
<exclude name="${package}/xa/**" unless="jdk1.2e+" /> <exclude name="${package}/xa/**" unless="datasource" />
<exclude name="${package}/test/**" unless="junit" /> <exclude name="${package}/test/**" unless="junit" />
</javac> </javac>
...@@ -93,9 +109,20 @@ ...@@ -93,9 +109,20 @@
<target name="driver" depends="prepare,check_versions"> <target name="driver" depends="prepare,check_versions">
<!-- determine the edition text --> <!-- determine the edition text -->
<property name="edition" value="JDBC1" /> <property name="edition" value="JDBC1" />
<available property="edition" value="JDBC2" classname="java.lang.ThreadLocal" /> <condition property="edition" value="JDBC2">
<available property="edition" value="JDBC2" classname="java.lang.StrictMath" /> <or>
<available property="edition" value="JDBC2 Enterprise" classname="javax.sql.DataSource" /> <equals arg1="${jdbc2}" arg2="true"/>
<equals arg1="${jdbc3}" arg2="true"/> <!-- fake it for now -->
</or>
</condition>
<condition property="edition" value="JDBC2 Enterprise">
<and>
<available classname="javax.sql.DataSource" />
<equals arg1="${jdbc2}" arg2="true"/>
</and>
</condition>
<!-- determine the connection class --> <!-- determine the connection class -->
<property name="connectclass" value="org.postgresql.jdbc1.Connection" /> <property name="connectclass" value="org.postgresql.jdbc1.Connection" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment