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/prebuilt_etc.go b/etc/prebuilt_etc.go
index 943ec81..b0b5da9 100644
--- a/etc/prebuilt_etc.go
+++ b/etc/prebuilt_etc.go
@@ -184,7 +184,7 @@
subdirProperties prebuiltSubdirProperties
sourceFilePaths android.Paths
- outputFilePaths android.OutputPaths
+ outputFilePaths android.WritablePaths
// The base install location, e.g. "etc" for prebuilt_etc, "usr/share" for prebuilt_usr_share.
installDirBase string
installDirBase64 string
@@ -317,7 +317,7 @@
p.additionalDependencies = &paths
}
-func (p *PrebuiltEtc) OutputFile() android.OutputPath {
+func (p *PrebuiltEtc) OutputFile() android.Path {
if p.usedSrcsProperty {
panic(fmt.Errorf("OutputFile not available on multi-source prebuilt %q", p.Name()))
}
@@ -410,7 +410,7 @@
ctx.PropertyErrorf("filename", "filename cannot contain separator '/'")
return
}
- p.outputFilePaths = android.OutputPaths{android.PathForModuleOut(ctx, filename).OutputPath}
+ p.outputFilePaths = android.WritablePaths{android.PathForModuleOut(ctx, filename)}
ip := installProperties{
filename: filename,
@@ -453,7 +453,7 @@
filename = src.Base()
installDirPath = baseInstallDirPath
}
- output := android.PathForModuleOut(ctx, filename).OutputPath
+ output := android.PathForModuleOut(ctx, filename)
ip := installProperties{
filename: filename,
sourceFilePath: src,
@@ -473,7 +473,7 @@
if filename == "" {
filename = ctx.ModuleName()
}
- p.outputFilePaths = android.OutputPaths{android.PathForModuleOut(ctx, filename).OutputPath}
+ p.outputFilePaths = android.WritablePaths{android.PathForModuleOut(ctx, filename)}
ip := installProperties{
filename: filename,
sourceFilePath: p.sourceFilePaths[0],
@@ -501,7 +501,7 @@
type installProperties struct {
filename string
sourceFilePath android.Path
- outputFilePath android.OutputPath
+ outputFilePath android.WritablePath
installDirPath android.InstallPath
symlinks []string
}