Use fewer OutputPaths
A lot of the time, you really mean android.Path or android.WriteablePath
instead of OutputPath.
Also, many modules were holding onto OutputPaths/WriteablePaths
after the files had already been generated, meaning they should no
longer be treated as writable paths and are instead inputs into other
actions. Change the type of those paths to just android.Path.
Test: verified ninja files were unchanged on aosp_arm64-trunk_staging-userdebug
Change-Id: Id773171bef59d855ba33c4b85cef268031cbec39
diff --git a/android/apex.go b/android/apex.go
index d140833..9277ff3 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -896,8 +896,8 @@
type DepNameToDepInfoMap map[string]ApexModuleDepInfo
type ApexBundleDepsInfo struct {
- flatListPath OutputPath
- fullListPath OutputPath
+ flatListPath Path
+ fullListPath Path
}
type ApexBundleDepsInfoIntf interface {
@@ -934,13 +934,15 @@
fmt.Fprintf(&flatContent, "%s\n", toName)
}
- d.fullListPath = PathForModuleOut(ctx, "depsinfo", "fulllist.txt").OutputPath
- WriteFileRule(ctx, d.fullListPath, fullContent.String())
+ fullListPath := PathForModuleOut(ctx, "depsinfo", "fulllist.txt")
+ WriteFileRule(ctx, fullListPath, fullContent.String())
+ d.fullListPath = fullListPath
- d.flatListPath = PathForModuleOut(ctx, "depsinfo", "flatlist.txt").OutputPath
- WriteFileRule(ctx, d.flatListPath, flatContent.String())
+ flatListPath := PathForModuleOut(ctx, "depsinfo", "flatlist.txt")
+ WriteFileRule(ctx, flatListPath, flatContent.String())
+ d.flatListPath = flatListPath
- ctx.Phony(fmt.Sprintf("%s-depsinfo", ctx.ModuleName()), d.fullListPath, d.flatListPath)
+ ctx.Phony(fmt.Sprintf("%s-depsinfo", ctx.ModuleName()), fullListPath, flatListPath)
}
// Function called while walking an APEX's payload dependencies.