summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2019-09-20 13:50:52 +0100
committerPaul Duffin <paulduffin@google.com>2019-09-20 14:52:56 +0100
commit68289b0efdfbef579085b668754dbc93fc84c05e (patch)
tree386c3172e6056794a998c3949eadd06778a50682 /java/java.go
parent9f6cbaca2163d0ce5cd680ac68cdb45807e66614 (diff)
Add custom SystemModules to bootclasspath to reduce duplication
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
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index b0fc9db6c..aa9532d25 100644
--- a/java/java.go
+++ b/java/java.go
@@ -535,7 +535,9 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
ctx.PropertyErrorf("sdk_version",
`system_modules is required to be set when sdk_version is "none", did you mean "core_platform"`)
} else if *j.deviceProperties.System_modules != "none" {
+ // Add the system modules to both the system modules and bootclasspath.
ctx.AddVariationDependencies(nil, systemModulesTag, *j.deviceProperties.System_modules)
+ ctx.AddVariationDependencies(nil, bootClasspathTag, *j.deviceProperties.System_modules)
}
if ctx.ModuleName() == "android_stubs_current" ||
ctx.ModuleName() == "android_system_stubs_current" ||
@@ -848,6 +850,12 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
}
default:
switch tag {
+ case bootClasspathTag:
+ // If a system modules dependency has been added to the bootclasspath
+ // then add its libs to the bootclasspath.
+ sm := module.(*SystemModules)
+ deps.bootClasspath = append(deps.bootClasspath, sm.headerJars...)
+
case systemModulesTag:
if deps.systemModules != nil {
panic("Found two system module dependencies")