summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2019-09-23 10:31:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-09-23 10:31:40 +0000
commit2b6f04ca42adbd0ae653fe03649c39e0300d3a6b (patch)
treeff590aa5944326d1a48739706533b182ada249ba /java/java.go
parentb1102ba82847928276fc7a8edcba21396c2cb541 (diff)
parent68289b0efdfbef579085b668754dbc93fc84c05e (diff)
Merge "Add custom SystemModules to bootclasspath to reduce duplication"
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 7ececd498..898c4dd05 100644
--- a/java/java.go
+++ b/java/java.go
@@ -536,7 +536,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" ||
@@ -849,6 +851,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")