From cc0f999806a054bdcd5e868b5fc92dab94aea5c8 Mon Sep 17 00:00:00 2001 From: Tobias Thierer Date: Fri, 15 Dec 2017 19:30:58 +0000 Subject: [PATCH] Revert "Build with OpenJDK 9 -target 1.8 by default (attempt 3)." After this revert CL topic, the default toolchain for Android goes back to being OpenJDK 8. This revert is being prepared ahead of time in case of any problems with original change topic. Bug: 69449021 Test: Treehugger Change-Id: Idbaefeb5b88ecb5d5168e6b9b4a120f80dedd5b6 --- android/config.go | 7 ++----- ui/build/config.go | 11 +---------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/android/config.go b/android/config.go index 52ff95525..887291df5 100644 --- a/android/config.go +++ b/android/config.go @@ -299,10 +299,7 @@ func NewConfig(srcDir, buildDir string) (Config, error) { func (c *config) fromEnv() error { switch c.Getenv("EXPERIMENTAL_USE_OPENJDK9") { case "": - if c.Getenv("RUN_ERROR_PRONE") != "true" { - // Use OpenJDK9, but target 1.8 - c.useOpenJDK9 = true - } + // Use OpenJDK8 case "false": // Use OpenJDK8 case "1.8": @@ -313,7 +310,7 @@ func (c *config) fromEnv() error { c.useOpenJDK9 = true c.targetOpenJDK9 = true default: - return fmt.Errorf(`Invalid value for EXPERIMENTAL_USE_OPENJDK9, should be "", "false", "1.8", or "true"`) + return fmt.Errorf(`Invalid value for EXPERIMENTAL_USE_OPENJDK9, should be "", "1.8", or "true"`) } return nil diff --git a/ui/build/config.go b/ui/build/config.go index f2511e76e..c9752432b 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -152,16 +152,7 @@ func NewConfig(ctx Context, args ...string) Config { if override, ok := ret.environ.Get("OVERRIDE_ANDROID_JAVA_HOME"); ok { return override } - v, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK9") - if !ok { - v2, ok2 := ret.environ.Get("RUN_ERROR_PRONE") - if ok2 && (v2 == "true") { - v = "false" - } else { - v = "1.8" - } - } - if v != "false" { + if v, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK9"); ok && v != "" && v != "false" { return java9Home } return java8Home