summaryrefslogtreecommitdiff
path: root/java/system_modules.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2019-06-18 22:48:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-06-18 22:48:22 +0000
commitf8a698a0c6d76fb6717095742d907a83d03140f1 (patch)
tree654a7625128fd6a37dac800c5f298bd31d6c059c /java/system_modules.go
parent4b1f4fe1389bd974ded1ce7a3366d96ed5dff7db (diff)
parent0f41678d008f433b5d88c2d3e211e8cdde08502c (diff)
Merge changes from topics "rbe-deps-dexpreopt-images", "rbe-deps-system-modules"
* changes: Expand the dexpreopt image dependencies to entire image Depend on all the files from system modules
Diffstat (limited to 'java/system_modules.go')
-rw-r--r--java/system_modules.go27
1 files changed, 17 insertions, 10 deletions
diff --git a/java/system_modules.go b/java/system_modules.go
index 5a86f3c82..f71f4523f 100644
--- a/java/system_modules.go
+++ b/java/system_modules.go
@@ -61,7 +61,7 @@ var (
"moduleName", "classpath", "outDir", "workDir")
)
-func TransformJarsToSystemModules(ctx android.ModuleContext, moduleName string, jars android.Paths) android.WritablePath {
+func TransformJarsToSystemModules(ctx android.ModuleContext, moduleName string, jars android.Paths) (android.Path, android.Paths) {
outDir := android.PathForModuleOut(ctx, "system")
workDir := android.PathForModuleOut(ctx, "modules")
outputFile := android.PathForModuleOut(ctx, "system/lib/modules")
@@ -84,7 +84,7 @@ func TransformJarsToSystemModules(ctx android.ModuleContext, moduleName string,
},
})
- return outputFile
+ return outDir, outputs.Paths()
}
func SystemModulesFactory() android.Module {
@@ -101,7 +101,8 @@ type SystemModules struct {
properties SystemModulesProperties
- outputFile android.Path
+ outputDir android.Path
+ outputDeps android.Paths
}
type SystemModulesProperties struct {
@@ -117,7 +118,7 @@ func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleConte
jars = append(jars, dep.HeaderJars()...)
})
- system.outputFile = TransformJarsToSystemModules(ctx, "java.base", jars)
+ system.outputDir, system.outputDeps = TransformJarsToSystemModules(ctx, "java.base", jars)
}
func (system *SystemModules) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -127,16 +128,22 @@ func (system *SystemModules) DepsMutator(ctx android.BottomUpMutatorContext) {
func (system *SystemModules) AndroidMk() android.AndroidMkData {
return android.AndroidMkData{
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
+ fmt.Fprintln(w)
+
makevar := "SOONG_SYSTEM_MODULES_" + name
+ fmt.Fprintln(w, makevar, ":=$=", system.outputDir.String())
+ fmt.Fprintln(w)
+
+ makevar = "SOONG_SYSTEM_MODULES_LIBS_" + name
+ fmt.Fprintln(w, makevar, ":=$=", strings.Join(system.properties.Libs, " "))
fmt.Fprintln(w)
- fmt.Fprintln(w, makevar, ":=", system.outputFile.String())
- fmt.Fprintln(w, ".KATI_READONLY", ":=", makevar)
+
+ makevar = "SOONG_SYSTEM_MODULE_DEPS_" + name
+ fmt.Fprintln(w, makevar, ":=$=", strings.Join(system.outputDeps.Strings(), " "))
+ fmt.Fprintln(w)
+
fmt.Fprintln(w, name+":", "$("+makevar+")")
fmt.Fprintln(w, ".PHONY:", name)
- fmt.Fprintln(w)
- makevar = "SOONG_SYSTEM_MODULES_LIBS_" + name
- fmt.Fprintln(w, makevar, ":=", strings.Join(system.properties.Libs, " "))
- fmt.Fprintln(w, ".KATI_READONLY :=", makevar)
},
}
}