Re: patch: fix 'compile' target to do correct dependency checking

From: Barry Lind <blind(at)xythos(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: patch: fix 'compile' target to do correct dependency checking
Date: 2003-08-24 22:11:06
Message-ID: 3F4937FA.9040507@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Patch applied and tested against jdk1.2 and 1.3.

thanks,
--Barry

Oliver Jowett wrote:
> This patch ensures that the 'compile' target includes all the source files
> needed for the build so that Ant's dependency checking works correctly.
> I've only tested against JDK1.4 / JDBC3 but it should work for other builds
> (all going well).
>
> Without this patch, only the jdbcN subpackage corresponding to the exact
> JDBC version the driver is configured for is included in the source file
> set. Changes to abstract classes in other subpackages (for example,
> jdbc1.AbstractJdbc1Statement with a JDBC2 or JDBC3 build) will be missed by
> ant's dependency check and the classes may not be rebuilt.
>
> This only bites dependency checking, not clean builds, as the "missing"
> source files are automatically located and built by the compiler when
> referenced by other, included, classes.
>
> -O
>
>
> ------------------------------------------------------------------------
>
> Index: src/interfaces/jdbc/build.xml
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/build.xml,v
> retrieving revision 1.35
> diff -u -c -r1.35 build.xml
> *** src/interfaces/jdbc/build.xml 11 Aug 2003 23:42:04 -0000 1.35
> --- src/interfaces/jdbc/build.xml 17 Aug 2003 01:27:39 -0000
> ***************
> *** 108,126 ****
> </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}" debug="${debug}">
> ! <include name="${package}/**" />
>
> ! <exclude name="${package}/jdbc1/**" unless="jdbc1"/>
> ! <exclude name="${package}/jdbc2/**" unless="jdbc2"/>
> ! <exclude name="${package}/jdbc3/**" unless="jdbc3"/>
>
> ! <exclude name="${package}/jdbc2/optional/**" unless="jdbc2" />
> ! <exclude name="${package}/jdbc2/optional/**" unless="datasource" />
>
> ! <exclude name="${package}/test/**"/>
> </javac>
> </target>
>
> --- 108,147 ----
> </target>
>
>
> <target name="compile" depends="prepare,check_versions,driver">
> <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
> ! <!-- This is the core of the driver. It is common for all versions. -->
> ! <include name="${package}/*.java" />
> ! <include name="${package}/core/**" />
> ! <include name="${package}/fastpath/**" />
> ! <include name="${package}/geometric/**" />
> ! <include name="${package}/largeobject/**" />
> ! <include name="${package}/util/**" />
>
> ! <!--
> ! Each jdbcN subpackage is used only if the driver supports *at least* that
> ! revision of JDBC. That is, a JDBC1 build uses only jdbc1, a JDBC2 build
> ! uses both jdbc1 and jdbc2, etc.
>
> ! Within those subpackages, classes beginning with "JdbcN" are assumed to be
> ! the concrete implementations for JDBC version N and are built only if the
> ! driver supports *exactly* that version. For example, jdbc1/Jdbc1Statement.java
> ! is built only if the driver build is a JDBC1 build.
> ! -->
>
> ! <!-- jdbc1 subpackage -->
> ! <include name="${package}/jdbc1/**"/>
> ! <exclude name="${package}/jdbc1/Jdbc1*.java" unless="jdbc1"/>
> !
> ! <!-- jdbc2 subpackage -->
> ! <include name="${package}/jdbc2/**" if="jdbc2"/>
> ! <include name="${package}/jdbc2/**" if="jdbc3"/>
> ! <exclude name="${package}/jdbc2/Jdbc2*.java" unless="jdbc2"/>
> ! <exclude name="${package}/jdbc2/optional/**" unless="datasource"/>
> !
> ! <!-- jdbc3 subpackage -->
> ! <include name="${package}/jdbc3/*.java" if="jdbc3"/>
> ! <exclude name="${package}/jdbc3/Jdbc3*.java" unless="jdbc3"/>
> </javac>
> </target>
>
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-08-24 22:11:34 Re: patch: fix a couple of server-prepared-statement bugs
Previous Message Barry Lind 2003-08-24 22:10:17 Re: patch: add a finalizer to AbstractJdbc1Statement