Replace ctx.ExpandSources with android.PathsForModuleSrc
Move the logic from ctx.ExpandSources into android.PathsForModuleSrc
and ctx.ExpandSource into android.PathForModuleSrc, and deprecate
them. When combined with the pathDepsMutator this will let all
properties that take source paths also take filegroups or genrule
outputs, as long as they are tagged with `android:"path"`.
Test: All soong tests
Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
diff --git a/android/prebuilt_etc.go b/android/prebuilt_etc.go
index 0c68b0c..2a3e07e 100644
--- a/android/prebuilt_etc.go
+++ b/android/prebuilt_etc.go
@@ -88,7 +88,7 @@
}
func (p *PrebuiltEtc) SourceFilePath(ctx ModuleContext) Path {
- return ctx.ExpandSource(String(p.properties.Src), "src")
+ return PathForModuleSrc(ctx, String(p.properties.Src))
}
// This allows other derivative modules (e.g. prebuilt_etc_xml) to perform
@@ -110,7 +110,7 @@
}
func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx ModuleContext) {
- p.sourceFilePath = ctx.ExpandSource(String(p.properties.Src), "src")
+ p.sourceFilePath = PathForModuleSrc(ctx, String(p.properties.Src))
filename := String(p.properties.Filename)
filename_from_src := Bool(p.properties.Filename_from_src)
if filename == "" {