summaryrefslogtreecommitdiff
path: root/java/system_modules.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2019-11-19 19:44:10 +0000
committer Paul Duffin <paulduffin@google.com> 2020-02-19 14:24:15 +0000
commit83a2d967decd1b76a01571dd76c6c8ce54b9b8ea (patch)
tree7125b249bdfa8fa874bf084f9bd1891d1de32c47 /java/system_modules.go
parentae83ce656db7addf83ddafce331d2605234b3273 (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/system_modules.go')
-rw-r--r--java/system_modules.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/java/system_modules.go b/java/system_modules.go
index 731503fd0..47de6e327 100644
--- a/java/system_modules.go
+++ b/java/system_modules.go
@@ -117,6 +117,15 @@ func SystemModulesFactory() android.Module {
return module
}
+type SystemModulesProvider interface {
+ HeaderJars() android.Paths
+ OutputDirAndDeps() (android.Path, android.Paths)
+}
+
+var _ SystemModulesProvider = (*SystemModules)(nil)
+
+var _ SystemModulesProvider = (*systemModulesImport)(nil)
+
type SystemModules struct {
android.ModuleBase
android.DefaultableModuleBase
@@ -136,6 +145,17 @@ type SystemModulesProperties struct {
Libs []string
}
+func (system *SystemModules) HeaderJars() android.Paths {
+ return system.headerJars
+}
+
+func (system *SystemModules) OutputDirAndDeps() (android.Path, android.Paths) {
+ if system.outputDir == nil || len(system.outputDeps) == 0 {
+ panic("Missing directory for system module dependency")
+ }
+ return system.outputDir, system.outputDeps
+}
+
func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleContext) {
var jars android.Paths