aboutsummaryrefslogtreecommitdiffstats
path: root/ui/build/config.go
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2017-11-17 14:14:29 +0000
committerTobias Thierer <tobiast@google.com>2017-12-11 14:53:52 +0000
commit13f23a2753f7093a2344db91a04973a3b24b6789 (patch)
tree0bd89681f60f3946f838b8b2892054f14d18cdbf /ui/build/config.go
parent06ae582000b0556d53f7dbb2f9720f2fb141418f (diff)
downloadbuild_soong-13f23a2753f7093a2344db91a04973a3b24b6789.tar.gz
build_soong-13f23a2753f7093a2344db91a04973a3b24b6789.tar.bz2
build_soong-13f23a2753f7093a2344db91a04973a3b24b6789.zip
Build with OpenJDK 9 -target 1.8 by default except for errorprone.
(This is cherry-picked from the first attempt to submit this CL topic, which was reverted after 3 hours because of bug 70286093; robolectric 3.{1.1,4.2} now stick with OpenJDK 8 to avoid that bug). Before this CL topic, the build toolchain for .java source files used OpenJDK 8, targeting 1.8 (v52 class files) by default. This CL topic switches the default to OpenJDK 9, but still targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE is set to true, then the default remains OpenJDK 8. Code in the Android platform should generally be unaffected, but if host tools that are now compiled and run using OpenJDK 9 are causing problems for your team, then let me know. To manually switch back to the old behavior for now (continue using OpenJDK 8), run this command in your shell: export EXPERIMENTAL_USE_OPENJDK9=false Bug: 69449021 Test: Treehugger Test: Running robolectric tests succeeds on internal-master after cherry-picking this CL topic, using the command line from http://b/70286093#comment1 (cherry picked from commit 0ae8b548af38c8b8fccea7cdef11d54740d3bb6a) Change-Id: Ide6a7e55126d919a44f89ef8e0bd14fb12ff470e
Diffstat (limited to 'ui/build/config.go')
-rw-r--r--ui/build/config.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/build/config.go b/ui/build/config.go
index df97d803..b608d386 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -150,7 +150,16 @@ func NewConfig(ctx Context, args ...string) Config {
if override, ok := ret.environ.Get("OVERRIDE_ANDROID_JAVA_HOME"); ok {
return override
}
- if v, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK9"); ok && v != "" && v != "false" {
+ 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" {
return filepath.Join("prebuilts/jdk/jdk9", ret.HostPrebuiltTag())
}
return filepath.Join("prebuilts/jdk/jdk8", ret.HostPrebuiltTag())