Stop using deprecated functionality for managing path deps
This change stops using deprecated functionality and migrates this
repository's custom Soong code to support current practices to manage
path property related dependencies. i.e. when a property includes
something that looks like ":module".
ExtractSourcesDeps has been deprecated in favor of tagging properties
with `android:"path"` which will cause the pathDepsMutator to add the
dependencies automatically.
android.SourceDepTag has been deprecated as the underlying type needs
to be changed and this will no longer work for its current uses.
* ctx.GetDirectDepWithTag(moduleName, android.SourceDepTag) will not
work to retrieve a reference to the module dependency added for
path properties. GetModuleFromPathDep(ctx, moduleName, "") must be
used instead.
* depTag == android.SourceDepTag can no longer be used to check to
see if depTag was used to add a module dependency for a module
reference in a path property without any output tag.
IsSourceDepTagWithOutputTag(depTag, "") must be used instead.
Bug: 193228441
Test: m nothing
Change-Id: I307039612f0f2a541ac7dbfddd052ef78c290f60
diff --git a/build/soong/compat_cil.go b/build/soong/compat_cil.go
index 230fdc3..46b0f71 100644
--- a/build/soong/compat_cil.go
+++ b/build/soong/compat_cil.go
@@ -41,7 +41,7 @@
type compatCilProperties struct {
// List of source files. Can reference se_filegroup type modules with the ":module" syntax.
- Srcs []string
+ Srcs []string `android:"path"`
// Output file name. Defaults to module name if unspecified.
Stem *string
@@ -55,7 +55,7 @@
srcPaths := make(android.Paths, 0, len(c.properties.Srcs))
for _, src := range c.properties.Srcs {
if m := android.SrcIsModule(src); m != "" {
- module := ctx.GetDirectDepWithTag(m, android.SourceDepTag)
+ module := android.GetModuleFromPathDep(ctx, m, "")
if module == nil {
// Error would have been handled by ExtractSourcesDeps
continue
@@ -76,10 +76,6 @@
return srcPaths
}
-func (c *compatCil) DepsMutator(ctx android.BottomUpMutatorContext) {
- android.ExtractSourcesDeps(ctx, c.properties.Srcs)
-}
-
func (c *compatCil) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if c.ProductSpecific() || c.SocSpecific() || c.DeviceSpecific() {
ctx.ModuleErrorf("Compat cil files only support system and system_ext partitions")