Bug 1056128: Enable JDK source level 1.7 for Android Java code. r=nalexander
authorChris Kitching <chriskitching@linux.com>
Fri, 29 Aug 2014 03:44:27 -0700
changeset 224006 ce756025b8794f840e84533feef8ea98daf3ab4e
parent 224005 47a76cb4e20f68b967384f0622e19fe4557e595d
child 224007 fe329c0f2d42bf5e67ba877a6f8ab7743a7ccd66
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1056128
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1056128: Enable JDK source level 1.7 for Android Java code. r=nalexander
config/android-common.mk
configure.in
--- a/config/android-common.mk
+++ b/config/android-common.mk
@@ -14,19 +14,19 @@ DEBUG_JARSIGNER=$(PYTHON) $(abspath $(to
   --jarsigner=$(JARSIGNER) \
   $(NULL)
 
 # For Android, this defaults to $(ANDROID_SDK)/android.jar
 ifndef JAVA_BOOTCLASSPATH
   JAVA_BOOTCLASSPATH = $(ANDROID_SDK)/android.jar
 endif
 
-# For Android, we default to 1.5
+# For Android, we default to 1.7
 ifndef JAVA_VERSION
-  JAVA_VERSION = 1.5
+  JAVA_VERSION = 1.7
 endif
 
 JAVAC_FLAGS = \
   -target $(JAVA_VERSION) \
   -source $(JAVA_VERSION) \
   $(if $(JAVA_CLASSPATH),-classpath $(JAVA_CLASSPATH),) \
   -bootclasspath $(JAVA_BOOTCLASSPATH) \
   -encoding UTF8 \
--- a/configure.in
+++ b/configure.in
@@ -5617,16 +5617,34 @@ if test -n "${JAVA_BIN_PATH}" -o \
     AC_MSG_ERROR([The program jar was not found.  Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
   fi
   if test -z "$JARSIGNER" -o "$JARSIGNER" = ":"; then
     AC_MSG_ERROR([The program jarsigner was not found.  Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
   fi
   if test -z "$KEYTOOL" -o "$KEYTOOL" = ":"; then
     AC_MSG_ERROR([The program keytool was not found.  Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
   fi
+
+  AC_MSG_CHECKING([for minimum required javac version = 1.7])
+
+  dnl Javac spits out something like `javac 1.7.0`. This line cuts off the 'javac'
+  _javac_version=$($JAVAC -version 2>&1 | cut -d ' ' -f 2)
+
+  dnl Here, we extract the major (1) and minor (7) version numbers from the
+  dnl acquired version string.
+  _javac_major_version=$(echo $_javac_version | cut -d '.' -f 1)
+  _javac_minor_version=$(echo $_javac_version | cut -d '.' -f 2)
+
+  AC_MSG_RESULT([$_javac_version])
+
+  dnl Fail if we have a version other than 1.7.X
+  if test "$_javac_major_version" -ne "1" -o \
+      \( "$_javac_minor_version" -ne "7" \); then
+      AC_MSG_ERROR([javac 1.7 is required.])
+  fi
 fi
 
 dnl ========================================================
 dnl = ANGLE OpenGL->D3D translator for WebGL
 dnl = * only applies to win32
 dnl ========================================================
 
 MOZ_ANGLE_RENDERER=