Add a systemModules utility type
Storing system modules in a classpath is clumsy, as there should
only ever be one system modules, and it needs to store both a
directory to pass as the argument and a set of generated files
to use as dependencies. Store them in a separate systemModules
type instead.
Test: m checkbuild
Change-Id: I020556c736bd5091865bcca51dc0fb9e4db6b45b
diff --git a/java/java.go b/java/java.go
index a49aad7..f3e10be 100644
--- a/java/java.go
+++ b/java/java.go
@@ -632,8 +632,7 @@
aidlIncludeDirs android.Paths
srcs android.Paths
srcJars android.Paths
- systemModules android.Path
- systemModulesDeps android.Paths
+ systemModules *systemModules
aidlPreprocess android.OptionalPath
kotlinStdlib android.Paths
kotlinAnnotations android.Paths
@@ -844,8 +843,7 @@
if sm.outputDir == nil || len(sm.outputDeps) == 0 {
panic("Missing directory for system module dependency")
}
- deps.systemModules = sm.outputDir
- deps.systemModulesDeps = sm.outputDeps
+ deps.systemModules = &systemModules{sm.outputDir, sm.outputDeps}
}
}
})
@@ -973,10 +971,7 @@
}
// systemModules
- if deps.systemModules != nil {
- flags.systemModules = append(flags.systemModules, deps.systemModules)
- flags.systemModulesDeps = append(flags.systemModulesDeps, deps.systemModulesDeps...)
- }
+ flags.systemModules = deps.systemModules
// aidl flags.
flags.aidlFlags, flags.aidlDeps = j.aidlFlags(ctx, deps.aidlPreprocess, deps.aidlIncludeDirs)