With this change, setting the environment variable
EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN=true switches from the OpenJDK 9
toolchain to the OpenJDK 11 one (prebuilts/jdk/jdk11).
Since the version of the java.base module has to match the version of
the jlink tool which consumes it, the --module-version argument to the
jmod create call is also switched.
Test: make
Test: EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN make
Bug: 131683177
Change-Id: I606d22538165f309fe5537bd67a26390b1dd5771
This rule takes a moduleName parameter which only ever has the value
java.base. What's more, the assuption that the value will always be
java.base is baked into the rule in other ways (most significantly,
the module created with this name is passed to jlink, and jlink
requires a java.base module).
This change removes the parameter and hard-codes java.base everywhere,
on the basis that it's better to have it completely hard-coded than
partially configurable and partially hard-coded.
Test: make
Change-Id: Ib42cda92f623c5a1f929b5a99248ca8919e4700c
Adds a library dependency to each of the dummy system modules created
by testing.go so that any changes in the behavior were detected by
the existing tests which were then fixed.
Bug: 141359858
Test: m checkbuild
Change-Id: Id4442f4aa3931ac93049f3367b96a5b49cc075e1
This was preventing us from actually using system module dependencies
from Make.
Fixes: 135679136
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true m legacy-performance-test-hostdex
Change-Id: Ic51c30d09cf39e35f2fe5f534a23273f450d9138
This jlink plugin is intended to optimise startup times for Java
runtimes by embedding a pre-processed and pre-validated module graph
in the system image.
This provides no benefit on Android, since the Android runtime does
not make use of the module graph it produces. (It doesn't seem useful
on Android anyway, since the system image only contains one module,
namely java.base.)
Furthermore, the plugin causes the jlink invocation to fail when using
the jlink tool from OpenJDK 11. The issue here is the plugin uses
classes in the jdk.internal.module package to describe the module
graph; that package is not part of libcore and therefore not listed in
the module-info.java for java.base on Android; but the plugin has the
side-effect of adding the package to java.base; this causes jlink to
subsequently fail with an error "Module java.base's descriptor
indicates the set of packages is : <lots of packages>, but module
contains packages: <same packages plus jdk.internal.module>". (The
implementation of the plugin changed significantly in OpenJDK 10,
which is presumably why this issue does not occur using OpenJDK 9's
jlink.)
Therefore, it is safe and beneficial to disable the plugin.
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make core-all-system-modules, using an OpenJDK 11 toolchain via OVERRIDE_ANDROID_JAVA_HOME and changing the jmod create invocation to use --module-version 11
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make droid, flash to device & sanity check
Bug: 131683177
Change-Id: I52333f32c88aa85cd3652ad91d50d9927ff61daf
ctx.AddDependency will succeed if the named dependency only has a
single variant, even if that variant is the wrong architecture.
Use ctx.AddVariationDependency(nil, ...) instead, which requires
that all variations of the calling module match the dependency.
Bug: 112707915
Test: no change to out/soong/build.ninja
Test: using a device dependency in a host java module is an error
Change-Id: I70b661a57d4412eb63b8c9841febfb756e9e025d
The flag EXPERIMENTAL_USE_OPENJDK9 controls the *default* value
of java_version / LOCAL_JAVA_LANGUAGE_VERSION, but that default
value can be overridden by individual build targets.
One requirement for individual build targets to opt-in to
java_version 1.9 is for system modules to be generated even if
the default language version is still < 1.9. We plan to allow
this soon for libcore targets; therefore, this CL changes the
system module targets to always be defined, regardless of the
value of EXPERIMENTAL_USE_OPENJDK9.
Test: In a workspace that has http://r.android.com/646840
"make" no longer runs into the build failure from bug 76219552.
Bug: 76219552
Change-Id: I5193347452c7967f7695929619509aea0fd46844
Add a method on ModuleContext and TopDownMutatorContext to visit
direct dependencies that have a given dependency tag.
Test: m checkbuild
Change-Id: Ib875563091dcae6b7282b3e3427d0eb07d8c8af5
AConfig() now duplicates Config(). Replace the uses of AConfig()
with Config(). Leave AConfig() for now until code in other
projects is cleaned up.
Test: m checkbuild
Change-Id: Ic88be643049d21dba45dbd1a65588ed94bf43bdc
OpenJDK9 system modules are not build modules, which means they
can't be built with m core-system-modules. Add a phony target.
Test: m core-system-modules
Change-Id: If6d512ff7a009b49743fb25cbb566935ec1c0153
Also adds checks that the dependencies are android.Modules and
are not disabled.
Test: m checkbuild
Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
Now that android.ModuleContext does not include blueprint.ModuleContext
we can rename android.ModuleContext.ModuleBuild to
android.ModuleContext.Build without colliding with
blueprint.ModuleContext.Build. Leave ModuleBuild as a wrapper around
Build for now to avoid having to update all the users outside
build/soong simultaneously.
Test: m checkbuild
Change-Id: I18eb8cc04faf002049a11d9aac97e9732ff5d638
If sdk jars(android_stubs_current, etc) are compiled using soong java
modules, we have to filter them when running Java build with Turbine.
TODO: provide more unit-tests.
Test: m clean && m -j32; go test java_test
Change-Id: Iad7c241b0e8b0ca760950733f513124b56c84564
Adds a java_system_modules module type that (when
EXPERIMENTAL_USE_OPENJDK9 is set to true) converts a list of
java library modules and prebuilt jars into system modules,
and plumbs the system modules through to the javac command
line.
Also exports the location of the system modules to make
variables, as well as the name of the default system module.
Test: TestClasspath in java_test.go, runs automatically as part of the build
Bug: 63986449
Change-Id: I27bd5d2010092422a27b69c91568e49010e02f40