diff options
| author | 2019-11-19 19:44:10 +0000 | |
|---|---|---|
| committer | 2020-02-19 14:24:15 +0000 | |
| commit | 83a2d967decd1b76a01571dd76c6c8ce54b9b8ea (patch) | |
| tree | 7125b249bdfa8fa874bf084f9bd1891d1de32c47 /java/java.go | |
| parent | ae83ce656db7addf83ddafce331d2605234b3273 (diff) | |
Allow java_system_modules_import to replace java_system_modules
Previously, there were some places where a java_system_module_import
could not be used in place of a java_system_module. That was because
the code assumed a *SystemModules type not a *systemModulesImport type.
This change introduces a SystemModulesProvider interface that is used
instead and is implemented on both types.
Bug: 142940300
Test: m nothing
ran new tests before changes to make sure they detected the issue
and after to make sure the changes fixed the issue.
Change-Id: I7b16ac5708880bdf61e6f5b1e6616c986f0ed763
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/java/java.go b/java/java.go index c3e2c9656..462dba809 100644 --- a/java/java.go +++ b/java/java.go @@ -1031,18 +1031,16 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { 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...) + sm := module.(SystemModulesProvider) + deps.bootClasspath = append(deps.bootClasspath, sm.HeaderJars()...) case systemModulesTag: if deps.systemModules != nil { panic("Found two system module dependencies") } - sm := module.(*SystemModules) - if sm.outputDir == nil || len(sm.outputDeps) == 0 { - panic("Missing directory for system module dependency") - } - deps.systemModules = &systemModules{sm.outputDir, sm.outputDeps} + sm := module.(SystemModulesProvider) + outputDir, outputDeps := sm.OutputDirAndDeps() + deps.systemModules = &systemModules{outputDir, outputDeps} } } }) |