Finished build.xml and updated Driver.java.in and buildDriver to match how Makefile and ANT operate.
This commit is contained in:
parent
1d46fb8035
commit
751959436c
4 changed files with 61 additions and 18 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Dec 20 16:19:00 GMT 2000 peter@retep.org.uk
|
||||||
|
- Finished build.xml and updated Driver.java.in and buildDriver to
|
||||||
|
match how Makefile and ANT operate.
|
||||||
|
|
||||||
Tue Dec 19 17:30:00 GMT 2000 peter@retep.org.uk
|
Tue Dec 19 17:30:00 GMT 2000 peter@retep.org.uk
|
||||||
- Finally created ant build.xml file
|
- Finally created ant build.xml file
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,18 @@
|
||||||
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.
|
||||||
|
|
||||||
$Id: build.xml,v 1.1 2000/12/19 17:33:39 peter Exp $
|
$Id: build.xml,v 1.2 2000/12/20 16:22:48 peter Exp $
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<project name="postgresqlJDBC" default="jar" basedir=".">
|
<project name="postgresqlJDBC" default="jar" basedir=".">
|
||||||
|
|
||||||
|
|
||||||
<!-- set global properties for this build -->
|
<!-- set global properties for this build -->
|
||||||
<property name="src" value="." />
|
<property name="src" value="." />
|
||||||
<property name="dest" value="build" />
|
<property name="dest" value="build" />
|
||||||
<property name="package" value="org/postgresql" />
|
<property name="package" value="org/postgresql" />
|
||||||
|
<property name="major" value="7" />
|
||||||
|
<property name="minor" value="1" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
This is a simpler method than utils.CheckVersion
|
This is a simpler method than utils.CheckVersion
|
||||||
|
@ -27,25 +28,63 @@
|
||||||
<available property="jdk1.2+" classname="java.lang.ThreadLocal" />
|
<available property="jdk1.2+" classname="java.lang.ThreadLocal" />
|
||||||
<available property="jdk1.3+" classname="java.lang.StrictMath" />
|
<available property="jdk1.3+" classname="java.lang.StrictMath" />
|
||||||
<available property="jdk1.2e+" classname="javax.sql.DataSource" />
|
<available property="jdk1.2e+" classname="javax.sql.DataSource" />
|
||||||
|
</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 ${major}.${minor} ${edition}" />
|
||||||
|
<filter token="JDBCCONNECTCLASS" value="${connectclass}" />
|
||||||
|
|
||||||
|
<!-- 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>
|
||||||
|
|
||||||
|
<!-- This target removes any class files from the build directory -->
|
||||||
|
<target name="clean">
|
||||||
|
<delete dir="${dest}" />
|
||||||
|
<delete file="${package}/Driver.java" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- Prepares the build directory -->
|
||||||
|
<target name="prepare">
|
||||||
<mkdir dir="${dest}" />
|
<mkdir dir="${dest}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean">
|
|
||||||
<delete dir="${dest}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- 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="check_versions">
|
<target name="compile" depends="prepare,check_versions,driver">
|
||||||
<javac srcdir="${src}" destdir="${dest}">
|
<javac srcdir="${src}" destdir="${dest}">
|
||||||
<include name="${package}/**" />
|
<include name="${package}/**" />
|
||||||
<exclude name="${package}/jdbc1/**" if="jdk1.2+" />
|
<exclude name="${package}/jdbc1/**" if="jdk1.2+" />
|
||||||
<exclude name="${package}/jdbc2/**" unless="jdk1.2+" />
|
<exclude name="${package}/jdbc2/**" unless="jdk1.2+" />
|
||||||
<exclude name="${package}/largeobject/PGBlob.java" unless="jdk1.2+" />
|
<exclude name="${package}/largeobject/PGblob.java" unless="jdk1.2+" />
|
||||||
<exclude name="${package}/PostgresqlDataSource.java" unless="jdk1.2e+" />
|
<exclude name="${package}/PostgresqlDataSource.java" unless="jdk1.2e+" />
|
||||||
<exclude name="${package}/xa/**" unless="jdk1.2e+" />
|
<exclude name="${package}/xa/**" unless="jdk1.2e+" />
|
||||||
</javac>
|
</javac>
|
||||||
<copy todir="${dest}">
|
<copy todir="${dest}" overwrite="true" filtering="on">
|
||||||
<fileset dir="${src}">
|
<fileset dir="${src}">
|
||||||
<include name="**/*.properties" />
|
<include name="**/*.properties" />
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class Driver implements java.sql.Driver
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
org.postgresql.Connection con = (org.postgresql.Connection)(Class.forName("%JDBCCONNECTCLASS%").newInstance());
|
org.postgresql.Connection con = (org.postgresql.Connection)(Class.forName("@JDBCCONNECTCLASS@").newInstance());
|
||||||
con.openConnection (host(), port(), props, database(), url, this);
|
con.openConnection (host(), port(), props, database(), url, this);
|
||||||
return (java.sql.Connection)con;
|
return (java.sql.Connection)con;
|
||||||
} catch(ClassNotFoundException ex) {
|
} catch(ClassNotFoundException ex) {
|
||||||
|
@ -192,7 +192,7 @@ public class Driver implements java.sql.Driver
|
||||||
*/
|
*/
|
||||||
public int getMajorVersion()
|
public int getMajorVersion()
|
||||||
{
|
{
|
||||||
return %MAJORVERSION%;
|
return @MAJORVERSION@;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -202,7 +202,7 @@ public class Driver implements java.sql.Driver
|
||||||
*/
|
*/
|
||||||
public int getMinorVersion()
|
public int getMinorVersion()
|
||||||
{
|
{
|
||||||
return %MINORVERSION%;
|
return @MINORVERSION@;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -210,7 +210,7 @@ public class Driver implements java.sql.Driver
|
||||||
*/
|
*/
|
||||||
public static String getVersion()
|
public static String getVersion()
|
||||||
{
|
{
|
||||||
return "%VERSION%";
|
return "@VERSION@";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# $Id: buildDriver,v 1.1 2000/10/12 08:55:28 peter Exp $
|
# $Id: buildDriver,v 1.2 2000/12/20 16:22:49 peter Exp $
|
||||||
#
|
#
|
||||||
# This script generates the org/postgresql/Driver.java file from the template
|
# This script generates the org/postgresql/Driver.java file from the template
|
||||||
# org/postgresql/Driver.java.in
|
# org/postgresql/Driver.java.in
|
||||||
|
@ -38,10 +38,10 @@ MINORVERSION=`echo $VERSION | cut -f2 -d'.' | cut -c1`
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Now finally build the driver
|
# Now finally build the driver
|
||||||
sed \
|
sed \
|
||||||
-e "s/%JDBCCONNECTCLASS%/$CLASS/g" \
|
-e "s/@JDBCCONNECTCLASS@/$CLASS/g" \
|
||||||
-e "s/%VERSION%/$VERSION $EDITION/g" \
|
-e "s/@VERSION@/$VERSION $EDITION/g" \
|
||||||
-e "s/%MAJORVERSION%/$MAJORVERSION/g" \
|
-e "s/@MAJORVERSION@/$MAJORVERSION/g" \
|
||||||
-e "s/%MINORVERSION%/$MINORVERSION/g" \
|
-e "s/@MINORVERSION@/$MINORVERSION/g" \
|
||||||
<${SOURCE}.in \
|
<${SOURCE}.in \
|
||||||
>$SOURCE
|
>$SOURCE
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue