6827026: Change javac source and target default to 7
authorjjg
Wed, 20 May 2009 13:36:23 -0700
changeset 2982 090c71af18f6
parent 2981 76ea6ddc4f72
child 2983 1d164c36212a
6827026: Change javac source and target default to 7 Reviewed-by: darcy, ohair
langtools/make/Makefile
langtools/make/build.properties
langtools/make/build.xml
langtools/src/share/classes/com/sun/tools/javac/code/Source.java
langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java
--- a/langtools/make/Makefile	Tue May 19 15:07:15 2009 -0700
+++ b/langtools/make/Makefile	Wed May 20 13:36:23 2009 -0700
@@ -115,6 +115,14 @@
   endif
 endif 
 
+ifdef SOURCE_LANGUAGE_VERSION
+  ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
+else
+  ifdef JAVAC_SOURCE_ARG 
+    ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
+  endif
+endif 
+
 ifdef ALT_BOOTDIR
   ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
   ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
--- a/langtools/make/build.properties	Tue May 19 15:07:15 2009 -0700
+++ b/langtools/make/build.properties	Wed May 20 13:36:23 2009 -0700
@@ -32,7 +32,8 @@
 # boot.java.home = /opt/jdk/1.5.0 
 boot.java = ${boot.java.home}/bin/java
 boot.javac = ${boot.java.home}/bin/javac
-boot.javac.target = 5
+boot.javac.source = 6
+boot.javac.target = 6
 
 # This is the JDK used to run the product version of the tools,
 # for example, for testing. If you're building a complete JDK, specify that.
@@ -59,7 +60,8 @@
 bootstrap.full.version = ${bootstrap.release}-${build.number}
 
 # options for the <javac> tasks used to compile the tools
-javac.target = 6
+javac.source = 5
+javac.target = 5
 javac.debug = true
 javac.debuglevel = source,lines
 javac.no.jdk.warnings = -XDignore.symbol.file=true
--- a/langtools/make/build.xml	Tue May 19 15:07:15 2009 -0700
+++ b/langtools/make/build.xml	Wed May 20 13:36:23 2009 -0700
@@ -393,6 +393,7 @@
             <attribute name="java" default="java"/>
             <attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
             <attribute name="javac.java.home" default="${boot.java.home}"/>
+            <attribute name="javac.source" default="${javac.source}"/>
             <attribute name="javac.target" default="${javac.target}"/>
             <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
             <attribute name="jarclasspath" default=""/>
@@ -411,6 +412,7 @@
                     release="@{release}"
                     full.version="@{full.version}"
                     javac.bootclasspath="@{javac.bootclasspath}"
+                    javac.source="@{javac.source}"
                     javac.target="@{javac.target}"
                 />
                 <mkdir dir="@{bin.dir}"/>
@@ -435,6 +437,7 @@
             <attribute name="lib.dir" default="${dist.lib.dir}"/>
             <attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
             <attribute name="javac.java.home" default="${boot.java.home}"/>
+            <attribute name="javac.source" default="${javac.source}"/>
             <attribute name="javac.target" default="${javac.target}"/>
             <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
             <attribute name="jarclasspath" default=""/>
@@ -450,6 +453,7 @@
                     release="@{release}"
                     full.version="@{full.version}"
                     javac.bootclasspath="@{javac.bootclasspath}"
+                    javac.source="@{javac.source}"
                     javac.target="@{javac.target}"
                 />
                 <mkdir dir="@{lib.dir}"/>
@@ -474,6 +478,7 @@
             <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
             <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
             <attribute name="javac.java.home" default="${boot.java.home}"/>
+            <attribute name="javac.source" default="${javac.source}"/>
             <attribute name="javac.target" default="${javac.target}"/>
             <attribute name="release" default="${release}"/>
             <attribute name="full.version" default="${full.version}"/>
@@ -502,6 +507,7 @@
                        includes="@{includes}"
                        sourcepath=""
                        includeAntRuntime="no"
+                       source="@{javac.source}"
                        target="@{javac.target}">
                     <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
                     <compilerarg line="${javac.version.opt}"/>
@@ -515,6 +521,7 @@
                        excludes="@{excludes}"
                        sourcepath=""
                        includeAntRuntime="no"
+                       source="@{javac.source}"
                        target="@{javac.target}"
                        debug="${javac.debug}" 
                        debuglevel="${javac.debuglevel}">
@@ -540,6 +547,7 @@
     <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
         <presetdef name="build-bootstrap-tool">
             <build-tool
+                javac.source="${boot.javac.source}"
                 javac.target="${boot.javac.target}"
                 gensrc.dir="${build.bootstrap.dir}/gensrc"
                 classes.dir="${build.bootstrap.dir}/classes"
@@ -555,6 +563,7 @@
     <target name="-def-build-bootstrap-jar" depends="-def-build-jar">
         <presetdef name="build-bootstrap-jar">
             <build-jar
+                javac.source="${boot.javac.source}"
                 javac.target="${boot.javac.target}"
                 gensrc.dir="${build.bootstrap.dir}/gensrc"
                 classes.dir="${build.bootstrap.dir}/classes"
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Tue May 19 15:07:15 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Wed May 20 13:36:23 2009 -0700
@@ -95,7 +95,7 @@
         this.name = name;
     }
 
-    public static final Source DEFAULT = JDK1_5;
+    public static final Source DEFAULT = JDK1_7;
 
     public static Source lookup(String name) {
         return tab.get(name);
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Tue May 19 15:07:15 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Wed May 20 13:36:23 2009 -0700
@@ -108,7 +108,7 @@
         this.minorVersion = minorVersion;
     }
 
-    public static final Target DEFAULT = JDK1_6;
+    public static final Target DEFAULT = JDK1_7;
 
     public static Target lookup(String name) {
         return tab.get(name);