aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYing Wang <wangying@android.com>2014-04-05 01:46:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-04-05 01:46:21 +0000
commit260942fa826052f24455dbaf74e54189efb44e8b (patch)
treebd6c2d2d142f15acbaf186a7b221a6b9108e4a1c
parentb5956468e4cbfbd3a97fa6775b81406c4c949e22 (diff)
parentc84889b80ae40dec85ac4810fc500db70cbc82b2 (diff)
downloadbuild-260942fa826052f24455dbaf74e54189efb44e8b.tar.gz
Merge "Build with java7 by default."
-rw-r--r--core/combo/javac.mk2
-rw-r--r--core/config.mk2
-rw-r--r--core/main.mk84
-rw-r--r--envsetup.sh5
4 files changed, 38 insertions, 55 deletions
diff --git a/core/combo/javac.mk b/core/combo/javac.mk
index 8c24e4bdc3..528e5560cf 100644
--- a/core/combo/javac.mk
+++ b/core/combo/javac.mk
@@ -9,7 +9,7 @@
# COMMON_JAVAC -- Java compiler command with common arguments
#
-ifeq ($(EXPERIMENTAL_USE_JAVA7),)
+ifneq ($(LEGACY_USE_JAVA6),)
common_flags := -target 1.5 -Xmaxerrs 9999999
else
common_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
diff --git a/core/config.mk b/core/config.mk
index 6311e68938..4b91e36653 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -359,7 +359,7 @@ endif
OLD_FLEX := prebuilts/misc/$(HOST_PREBUILT_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX)
ifeq ($(HOST_OS),darwin)
-ifneq ($(EXPERIMENTAL_USE_JAVA7),)
+ifeq ($(LEGACY_USE_JAVA6),)
HOST_JDK_TOOLS_JAR:= $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh)
else
# Deliberately set to blank for Java 6 installations on MacOS. These
diff --git a/core/main.mk b/core/main.mk
index 0ef05f152d..5175bef8c7 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -103,7 +103,7 @@ include $(BUILD_SYSTEM)/cleanbuild.mk
# Include the google-specific config
-include vendor/google/build/config.mk
-VERSION_CHECK_SEQUENCE_NUMBER := 4
+VERSION_CHECK_SEQUENCE_NUMBER := 5
-include $(OUT_DIR)/versions_checked.mk
ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED))
@@ -140,19 +140,48 @@ $(warning ************************************************************)
$(error Directory names containing spaces not supported)
endif
+java_version_str := $(shell unset _JAVA_OPTIONS && java -version 2>&1)
+javac_version_str := $(shell unset _JAVA_OPTIONS && javac -version 2>&1)
+
+# Check for the correct version of java, should be 1.7 by
+# default, and 1.6 if LEGACY_USE_JAVA6 is set.
+ifeq ($(LEGACY_USE_JAVA6),)
+required_version := "1.7.x"
+required_javac_version := "1.7"
+java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]')
+javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]')
+else # if LEGACY_USE_JAVA6
+required_version := "1.6.x"
+required_javac_version := "1.6"
+java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.6[\. "$$]')
+javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.6[\. "$$]')
+endif # if LEGACY_USE_JAVA6
+
+ifeq ($(strip $(java_version)),)
+$(info ************************************************************)
+$(info You are attempting to build with the incorrect version)
+$(info of java.)
+$(info $(space))
+$(info Your version is: $(java_version_str).)
+$(info The required version is: $(required_version))
+$(info $(space))
+$(info Please follow the machine setup instructions at)
+$(info $(space)$(space)$(space)$(space)https://source.android.com/source/initializing.html)
+$(info ************************************************************)
+$(error stop)
+endif
+
# Check for the current JDK.
#
# For Java 1.7, we require OpenJDK on linux and Oracle JDK on Mac OS.
# For Java 1.6, we require Oracle for all host OSes.
requires_openjdk := false
-ifneq ($(EXPERIMENTAL_USE_JAVA7),)
+ifeq ($(LEGACY_USE_JAVA6),)
ifeq ($(HOST_OS), linux)
requires_openjdk := true
endif
endif
-java_version_str := $(shell unset _JAVA_OPTIONS && java -version 2>&1)
-javac_version_str := $(shell unset _JAVA_OPTIONS && javac -version 2>&1)
# Check for the current jdk
ifeq ($(requires_openjdk), true)
@@ -182,53 +211,6 @@ $(error stop)
endif # java version is not Sun Oracle JDK
endif # if requires_openjdk
-# Check for the correct version of java, should be 1.7 if
-# EXPERIMENTAL_USE_JAVA7 is set, 1.6 otherwise.
-ifneq ($(EXPERIMENTAL_USE_JAVA7),)
-required_version := "1.7.x"
-required_javac_version := "1.7"
-java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]')
-javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]')
-else # if EXPERIMENTAL_USE_JAVA7
-required_version := "1.6.x"
-required_javac_version := "1.6"
-java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.6[\. "$$]')
-javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.6[\. "$$]')
-endif # if EXPERIMENTAL_USE_JAVA7
-
-ifeq ($(required_javac_version), "1.6")
-$(info ************************************************************)
-$(info You are attempting to build with java 1.6.)
-$(info Java6 support for master builds will be dropped shortly,)
-$(info please upgrade to Java7 as soon as possible.)
-$(info $(space))
-$(info Visit http://source.android.com/source/initializing.html#installing-the-jdk for details. )
-$(info $(space))
-$(info To build using java-7:)
-$(info $(space))
-$(info $$ export EXPERIMENTAL_USE_JAVA7=true)
-$(info $$ . build/envsetup.sh)
-$(info $$ lunch <target>)
-$(info $$ make clobber)
-$(info $$ make -j8)
-$(info $(space))
-$(info ************************************************************)
-endif
-
-ifeq ($(strip $(java_version)),)
-$(info ************************************************************)
-$(info You are attempting to build with the incorrect version)
-$(info of java.)
-$(info $(space))
-$(info Your version is: $(java_version_str).)
-$(info The required version is: $(required_version))
-$(info $(space))
-$(info Please follow the machine setup instructions at)
-$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
-$(info ************************************************************)
-$(error stop)
-endif
-
# Check for the correct version of javac
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
diff --git a/envsetup.sh b/envsetup.sh
index ba4f68357f..5ed3dc1530 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1380,7 +1380,8 @@ function godir () {
# JavaVM.framework/Versions/1.7/ folder.
function set_java_home() {
# Clear the existing JAVA_HOME value if we set it ourselves, so that
- # we can reset it later, depending on the value of EXPERIMENTAL_USE_JAVA7.
+ # we can reset it later, depending on the version of java the build
+ # system needs.
#
# If we don't do this, the JAVA_HOME value set by the first call to
# build/envsetup.sh will persist forever.
@@ -1389,7 +1390,7 @@ function set_java_home() {
fi
if [ ! "$JAVA_HOME" ]; then
- if [ ! "$EXPERIMENTAL_USE_JAVA7" ]; then
+ if [ -n "$LEGACY_USE_JAVA6" ]; then
case `uname -s` in
Darwin)
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home