db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r726092 - in /db/derby/code/trunk: build.xml java/build/org/apache/derbyPreBuild/PropertySetter.java java/testing/org/apache/derbyTesting/junit/JDBC.java tools/ant/properties/extrapath.properties tools/java/serializer.jar tools/java/xalan.jar
Date Fri, 12 Dec 2008 18:43:30 GMT
Author: rhillegas
Date: Fri Dec 12 10:43:29 2008
New Revision: 726092

URL: http://svn.apache.org/viewvc?rev=726092&view=rev
Log:
DERBY-3966: Make 1.4 JDK optional when building Derby.

Added:
    db/derby/code/trunk/tools/java/serializer.jar   (with props)
    db/derby/code/trunk/tools/java/xalan.jar   (with props)
Modified:
    db/derby/code/trunk/build.xml
    db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
    db/derby/code/trunk/tools/ant/properties/extrapath.properties

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/build.xml?rev=726092&r1=726091&r2=726092&view=diff
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Fri Dec 12 10:43:29 2008
@@ -188,7 +188,7 @@
           description="Set the ant variables which identify the compiler classpaths. Remove
the autosetProps logic when this target becomes mandatory."
           depends="prebuild">
 
-<!--     <antcall target="printCompilerProperties"> <param name="checkEvent"
value="Before"/> </antcall> -->
+    <antcall target="printCompilerProperties"> <param name="checkEvent" value="Before
setting properties: "/> </antcall>
 
     <taskdef
       name="setJdkProperties"
@@ -198,12 +198,16 @@
 
     <setJdkProperties/>
 
-<!--     <antcall target="printCompilerProperties"> <param name="checkEvent"
value="After"/> </antcall> -->
-
     <property file="${properties.dir}/defaultcompiler.properties"/>
     <property file="${properties.dir}/${build.compiler}.properties"/>
     <!-- Compile-time classpath`< properties files -->
     <property file="${properties.dir}/extrapath.properties"/>
+
+    <!-- 
+            If a 1.4 JDK is not present, then use the Java 5 environment to build the 1.4
support
+    -->
+    <property name="java14compile.classpath" value="${java15compile.classpath}:${xalan}:${serializer}"/>
+
     <property file="${properties.dir}/compilepath.properties"/>
     <!-- Release and version info -->
     <property file="${properties.dir}/release.properties"/>
@@ -214,6 +218,8 @@
     -->
     <property name="jsr169compile.classpath" value="${out.jsr169.dir}:${java14compile.classpath}"/>
 
+    <antcall target="printCompilerProperties"> <param name="checkEvent" value="After
setting properties: "/> </antcall>
+
   </target>
 
   <target name="setInitialProperties" if="dontAutosetProps"
@@ -230,12 +236,15 @@
 
   </target>
 
-  <target name="printCompilerProperties">
+  <target name="printCompilerProperties" if="printCompilerProperties">
 
+    <echo message="${checkEvent} jsr169compile.classpath = ${jsr169compile.classpath}"/>
     <echo message="${checkEvent} j14lib = ${j14lib}"/>
     <echo message="${checkEvent} java14compile.classpath = ${java14compile.classpath}"/>
     <echo message="${checkEvent} j15lib = ${j15lib}"/>
     <echo message="${checkEvent} java15compile.classpath = ${java15compile.classpath}"/>
+    <echo message="${checkEvent} jdk16 = ${jdk16}"/>
+    <echo message="${checkEvent} java16compile.classpath = ${java16compile.classpath}"/>
 
   </target>
 

Modified: db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java?rev=726092&r1=726091&r2=726092&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java Fri Dec 12
10:43:29 2008
@@ -204,8 +204,8 @@
             String  j14lib = getProperty( J14LIB );
             String  j15lib = getProperty( J15LIB );
 
-            if ( j14lib != null ) { setClasspathFromLib(J14CLASSPATH, j14lib ); }
-            if ( j15lib != null ) { setClasspathFromLib(J15CLASSPATH, j15lib ); }
+            if ( j14lib != null ) { setClasspathFromLib(J14CLASSPATH, j14lib, true ); }
+            if ( j15lib != null ) { setClasspathFromLib(J15CLASSPATH, j15lib, true ); }
 
             //
             // If the library properties were not set, the following
@@ -236,8 +236,12 @@
         //
         refreshProperties();
 
+        //
+        // We now allow J14CLASSPATH to not be set. If a 1.4 JDK can't be found,
+        // then the calling script will set J14CLASSPATH, based on J15CLASSPATH.
+        //
+
         // Require that these be set now.
-        requireProperty( J14CLASSPATH );
         requireProperty( J15CLASSPATH );
     }
 
@@ -313,10 +317,10 @@
         String  default_j15lib = getProperty( J15LIB );
         
         if ( default_j14lib == null )
-        { default_j14lib = searchForJreLib(jdkParents, seed14); }
+        { default_j14lib = searchForJreLib(jdkParents, seed14, false ); }
 
         if ( default_j15lib == null )
-        { default_j15lib = searchForJreLib(jdkParents, seed15); }
+        { default_j15lib = searchForJreLib(jdkParents, seed15, true ); }
 
         defaultSetter( default_j14lib, default_j15lib );
     }
@@ -328,9 +332,9 @@
      * @param seed search string which identifies a given JDK version
      * @return a library directory, or <code>null</code> if not found
      */
-    private String searchForJreLib(List<File> parents, String seed) {
+    private String searchForJreLib(List<File> parents, String seed, boolean squawkIfEmpty)
{
         for (File parent : parents) {
-            String jreLib = getJreLib(parent, seed);
+            String jreLib = getJreLib(parent, seed, squawkIfEmpty);
             if (jreLib != null) {
                 return jreLib;
             }
@@ -407,7 +411,7 @@
      * Get the path name of the library directory in the latest version of this jre
      * </p>
      */
-    private String    getJreLib( File jdkParentDirectory, String jdkName )
+    private String    getJreLib( File jdkParentDirectory, String jdkName, boolean squawkIfEmpty
)
         throws BuildException
     {
         if ( jdkParentDirectory == null ) { return null; }
@@ -417,7 +421,9 @@
 
         if ( count <= 0 )
         {
-            echo( "Directory '" + jdkParentDirectory.getAbsolutePath() + "' does not have
any child directories containing the string '" + jdkName + "'." );
+            if ( squawkIfEmpty )
+            { echo( "Directory '" + jdkParentDirectory.getAbsolutePath() + "' does not have
any child directories containing the string '" + jdkName + "'." ); }
+            
             return null;
         }
 
@@ -458,8 +464,8 @@
         String  j14lib = getProperty( J14LIB, default_j14lib );
         String  j15lib = getProperty( J15LIB, default_j15lib );
 
-        setClasspathFromLib( J14CLASSPATH, j14lib );
-        setClasspathFromLib( J15CLASSPATH, j15lib );
+        setClasspathFromLib( J14CLASSPATH, j14lib, false );
+        setClasspathFromLib( J15CLASSPATH, j15lib, true );
     }
     
     /**
@@ -469,7 +475,7 @@
      * Throws a BuildException if there's a problem.
      * </p>
      */
-    private void    setClasspathFromLib( String classpathProperty, String libraryDirectory
)
+    private void    setClasspathFromLib( String classpathProperty, String libraryDirectory,
boolean squawkIfEmpty )
         throws BuildException
     {
         String      classpath = getProperty( classpathProperty );
@@ -477,14 +483,14 @@
         // nothing to do if the property is already set. we can't override it.
         if ( classpath != null ) { return; }
 
-        String      jars = listJars( libraryDirectory );
+        String      jars = listJars( libraryDirectory, squawkIfEmpty );
 
-        if ( jars == null )
+        if ( squawkIfEmpty && (jars == null) )
         {
             throw couldntSetProperty( classpathProperty );
         }
 
-        setProperty( classpathProperty, jars );
+        if ( jars != null ) { setProperty( classpathProperty, jars ); }
     }
 
     /**
@@ -495,7 +501,7 @@
      * a valid directory.
      * </p>
      */
-    private String    listJars( String dirName )
+    private String    listJars( String dirName, boolean squawkIfEmpty )
     {
         if ( dirName == null ) { return null; }
 
@@ -503,12 +509,12 @@
 
         if ( !dir.exists() )
         {
-            echo( "Directory " + dirName + " does not exist." );
+            if ( squawkIfEmpty) { echo( "Directory " + dirName + " does not exist." ); }
             return null;
         }
         if ( !dir.isDirectory() )
         {
-            echo( dirName + " is not a directory." );
+            if ( squawkIfEmpty) { echo( dirName + " is not a directory." ); }
             return null;
         }
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java?rev=726092&r1=726091&r2=726092&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java Fri Dec 12 10:43:29
2008
@@ -130,7 +130,7 @@
         try {
             Class.forName(className);
             return true;
-        } catch (Exception e) {
+        } catch (Throwable e) {
         	return false;
         }    	
     }

Modified: db/derby/code/trunk/tools/ant/properties/extrapath.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/ant/properties/extrapath.properties?rev=726092&r1=726091&r2=726092&view=diff
==============================================================================
--- db/derby/code/trunk/tools/ant/properties/extrapath.properties (original)
+++ db/derby/code/trunk/tools/ant/properties/extrapath.properties Fri Dec 12 10:43:29 2008
@@ -22,7 +22,8 @@
 jcc_l=${javatools.dir}/db2jcc_license_c.jar
 osgi=${javatools.dir}/felix.jar
 xercesImpl=${javatools.dir}/xercesImpl.jar
-xalan=${javatools.dir}/xslt4j-2_5_0/xalan.jar
+xalan=${javatools.dir}/xalan.jar
+serializer=${javatools.dir}/serializer.jar
 javacc=${javatools.dir}/javacc.jar
 junit=${javatools.dir}/junit.jar
 emma=${javatools.dir}/emma.jar

Added: db/derby/code/trunk/tools/java/serializer.jar
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/java/serializer.jar?rev=726092&view=auto
==============================================================================
Binary file - no diff available.

Propchange: db/derby/code/trunk/tools/java/serializer.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: db/derby/code/trunk/tools/java/xalan.jar
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/java/xalan.jar?rev=726092&view=auto
==============================================================================
Binary file - no diff available.

Propchange: db/derby/code/trunk/tools/java/xalan.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message