db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r583824 - in /db/derby/code/trunk: BUILDING.txt build.xml
Date Thu, 11 Oct 2007 13:50:42 GMT
Author: rhillegas
Date: Thu Oct 11 06:50:37 2007
New Revision: 583824

URL: http://svn.apache.org/viewvc?rev=583824&view=rev
Log:
DERBY-3117: Require a Java 5 (or higher) compiler to build Derby.

Modified:
    db/derby/code/trunk/BUILDING.txt
    db/derby/code/trunk/build.xml

Modified: db/derby/code/trunk/BUILDING.txt
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/BUILDING.txt?rev=583824&r1=583823&r2=583824&view=diff
==============================================================================
--- db/derby/code/trunk/BUILDING.txt (original)
+++ db/derby/code/trunk/BUILDING.txt Thu Oct 11 06:50:37 2007
@@ -114,18 +114,23 @@
 
 Notes:
 ----- 
-(1) Derby build environment requires you to install one level of 
-    Java Development Kit (JDK) - 1.4.x as Derby is designed 
+(1) The Derby build environment requires you to install two levels of 
+    the Java Development Kit (JDK) - Java 5 and JDK 1.4.x.
+    Java 5 is needed to compile language features introduced by Java 5.
+    JDK 1.4.x  is needed because Derby is designed 
     to work in JDK 1.4.x (JDBC 3.0) environments (or higher).
-    The Derby build is set up such that that most of 
-    the code is compiled against JDK 1.4.x libraries so that no 
-    dependencies on higher levels of JDKs exist, except for
-    that code designed to run on Java SE 6.
-
-(2) The Derby build environment is tested with 
-    JDK 142(Sun) and Ant 161. The Derby build environment should
-    work with other versions and other sources of 
-    JDK 14 (1.4.x), and other versions of Ant 1.6 (1.6.x).
+    The Derby build is set up such that most of 
+    the code is compiled against JDK 1.4.x libraries. This ensures that
+    no run-time dependencies on higher levels of the JDK exist. Optional
+    run-time code can take advantage of Java 5 language features.
+    If the Java 6 JDK is present, the build will also compile optional
+    support for JDBC 4.
+
+(2) The Derby build environment is tested with Sun's Java 5 compiler,
+    with Sun's JDK 1.4.2 libraries, and with Ant 1.6.1.
+    The Derby build environment
+    should work with other versions and other sources of 
+    Java 5 and  JDK 1.4 (1.4.x) and with other versions of Ant 1.6 (1.6.x).
 
 
 
@@ -139,7 +144,7 @@
     directory in the rest of this document. 
 
 
-2.2.2 Download and install Java Development Kit (JDK) release 1.4.x
+2.2.2 Download and install Java Development Kits
 
 Skip steps 1-2 of this section if you already have JDK 1.4.x 
 installed on your system.  
@@ -157,7 +162,23 @@
 (3) The directory where you have installed JDK 1.4.x will be 
     referred to as ${jdk14.dir} in the rest of this document.
 
+You must also install the Java 5 (or later) JDK and this must be the version of
+Java used by the ant process in which you run the Derby build. You
+may skip steps 4-5 of this section if you have already installed
+Java 5 or a later version of the JDK.
 
+(4) Download the Java 5 or later JDK.
+    The reference implementation is available at:
+       http://java.sun.com/javase
+
+    For MacOS X, get the latest download from:
+       http://developer.apple.com/java/download
+
+(5) Install the Java 5 JDK according to the instructions included 
+    with the release in any directory. 
+
+(6) The directory where you have installed the Java 5 JDK will be 
+    referred to as ${java5.dir} in the rest of this document.
 
 2.2.3 section removed - no longer applies
 
@@ -269,11 +290,12 @@
     actually perform the build. 
 
 (3) Create environment variable JAVA_HOME  to point to the 
-    directory where you have installed JDK 1.4.x. For example:
+    directory where you have installed the Java 5 (or later)
+    JDK. For example:
 
-     setenv JAVA_HOME ${jdk14.dir} -- On unix(csh).
-     export JAVA_HOME=${jdk14.dir} -- On unix(ksh)
-     set JAVA_HOME=${jdk14.dir}    -- On Windows
+     setenv JAVA_HOME ${java5.dir} -- On unix(csh).
+     export JAVA_HOME=${java5.dir} -- On unix(ksh)
+     set JAVA_HOME=${java5.dir}    -- On Windows
 
 
 3.2   Create property file

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/build.xml?rev=583824&r1=583823&r2=583824&view=diff
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Thu Oct 11 06:50:37 2007
@@ -46,6 +46,8 @@
 
   <target name="init" unless="init.done">
 
+    <antcall target="checkCompilerLevel"/>
+
     <tstamp/>
     <mkdir dir="${out.dir}"/>
     <!-- generate sanity state.properties if one does not exist -->
@@ -96,6 +98,26 @@
     <echo level="info" message=""/>
     <property name="showenv.done" value="true"/>
   </target>
+
+  <target name="checkCompilerLevel" description="Make sure compiler level is Java 5 level
or higher.">
+
+    <property name="dummy.src" value="z.java"/>
+    <property name="dummy.class" value="z.class"/>
+    <echo file="${dummy.src}" message="public class z {}"/>
+    <delete file="${dummy.class}"/>
+
+    <javac source="1.5" srcdir="${basedir}" failonerror="false">
+      <include name="${dummy.src}"/>
+    </javac>
+
+    <available property="compilerAtCorrectLevel" file="${dummy.class}"/>
+
+    <delete file="${dummy.src}"/>
+    <delete file="${dummy.class}"/>
+
+    <fail unless="compilerAtCorrectLevel" message="Compiler level must be Java 5 or later."/>
+  </target>
+
 
 <!-- ==================================================================== -->
 <!--                     Build version info files                         -->



Mime
View raw message