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/etc/otacerts_zip.go b/etc/otacerts_zip.go
index d12bdac..8220cea 100644
--- a/etc/otacerts_zip.go
+++ b/etc/otacerts_zip.go
@@ -44,7 +44,7 @@
android.ModuleBase
properties otacertsZipProperties
- outputPath android.OutputPath
+ outputPath android.Path
}
// otacerts_zip collects key files defined in PRODUCT_DEFAULT_DEV_CERTIFICATE
@@ -117,11 +117,11 @@
// Read .x509.pem files listed in PRODUCT_EXTRA_OTA_KEYS or PRODUCT_EXTRA_RECOVERY_KEYS.
extras := ctx.Config().ExtraOtaKeys(ctx, m.InRecovery())
srcPaths := append([]android.SourcePath{pem}, extras...)
- m.outputPath = android.PathForModuleOut(ctx, m.outputFileName()).OutputPath
+ outputPath := android.PathForModuleOut(ctx, m.outputFileName())
rule := android.NewRuleBuilder(pctx, ctx)
cmd := rule.Command().BuiltTool("soong_zip").
- FlagWithOutput("-o ", m.outputPath).
+ FlagWithOutput("-o ", outputPath).
Flag("-j ").
Flag("-symlinks=false ")
for _, src := range srcPaths {
@@ -130,7 +130,8 @@
rule.Build(ctx.ModuleName(), "Generating the otacerts zip file")
installPath := android.PathForModuleInstall(ctx, "etc", proptools.String(m.properties.Relative_install_path))
- ctx.InstallFile(installPath, m.outputFileName(), m.outputPath)
+ ctx.InstallFile(installPath, m.outputFileName(), outputPath)
+ m.outputPath = outputPath
}
func (m *otacertsZipModule) AndroidMkEntries() []android.AndroidMkEntries {