Enable Java 9 language support through java_version: "1.9" alone.
Some logic in java.go was conditional on TargetOpenJDK9(), which in turn relies on a global build flag (EXPERIMENTAL_USE_OPENJDK9=true). This CL changes the logic in collectBuilderFlags() to check for javaVersion greater or equal "1.9" instead, which is true when either EXPERIMENTAL_USE_OPENJDK9=true (global) or javaVersion "1.9" (a per-build target attribute). Because the value of flags.javaVersion isn't available there, TargetOpenJDK9()-dependent logic in Module.deps() was changed to be unconditional; as far as I understand, this means that system modules deps will be built regardless of whether they're needed later in the build. This will probably slow down the build unnecessarily until the first user of these system modules appears (expected soon), but probably not by much. There is some TargetOpenJDK9() related logic remaining in droiddoc.go, but this doesn't seem to break the build of Java 9 language sources and is probably no longer needed now that metalava is used for generating the stubs (thanks to Nan!), and those do not contain any Java 9 language features. Bug: 112443425 Test: Checked that Java 9 language support works on AOSP after this CL without a need for EXPERIMENTAL_USE_OPENJDK9=true, ie. after also patching CL http://r.android.com/646840 , "make docs droid cts" completes, the device boots and Java9LanguageFeaturesTest passes. Change-Id: I393b97a7b3bb4c1c3d06580c639e94ff6cf916ff
Loading
Please register or sign in to comment