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
This commit is contained in:
parent
c1d9d9a85c
commit
532bde121b
3 changed files with 9 additions and 10 deletions
|
@ -64,7 +64,7 @@ type cilCompatMapProperties struct {
|
|||
// compatibility mapping file. bottom_half may reference the outputs of
|
||||
// other modules that produce source files like genrule or filegroup using
|
||||
// the syntax ":module". srcs has to be non-empty.
|
||||
Bottom_half []string
|
||||
Bottom_half []string `android:"path"`
|
||||
// name of the output
|
||||
Stem *string
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ func expandSeSources(ctx android.ModuleContext, srcFiles []string) android.Paths
|
|||
expandedSrcFiles := make(android.Paths, 0, len(srcFiles))
|
||||
for _, s := range srcFiles {
|
||||
if m := android.SrcIsModule(s); m != "" {
|
||||
module := ctx.GetDirectDepWithTag(m, android.SourceDepTag)
|
||||
module := android.GetModuleFromPathDep(ctx, m, "")
|
||||
if module == nil {
|
||||
// Error will have been handled by ExtractSourcesDeps
|
||||
continue
|
||||
|
@ -161,7 +161,6 @@ func (c *cilCompatMap) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||
}
|
||||
|
||||
func (c *cilCompatMap) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
android.ExtractSourcesDeps(ctx, c.properties.Bottom_half)
|
||||
if c.properties.Top_half != nil {
|
||||
ctx.AddDependency(c, TopHalfDepTag, String(c.properties.Top_half))
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ type compatCil struct {
|
|||
|
||||
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 @@ func (c *compatCil) expandSeSources(ctx android.ModuleContext) android.Paths {
|
|||
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 @@ func (c *compatCil) expandSeSources(ctx android.ModuleContext) android.Paths {
|
|||
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")
|
||||
|
|
|
@ -140,7 +140,11 @@ func (m *selinuxContextsModule) GenerateAndroidBuildActions(ctx android.ModuleCo
|
|||
|
||||
var inputs android.Paths
|
||||
|
||||
ctx.VisitDirectDepsWithTag(android.SourceDepTag, func(dep android.Module) {
|
||||
ctx.VisitDirectDeps(func(dep android.Module) {
|
||||
depTag := ctx.OtherModuleDependencyTag(dep)
|
||||
if !android.IsSourceDepTagWithOutputTag(depTag, "") {
|
||||
return
|
||||
}
|
||||
segroup, ok := dep.(*fileGroup)
|
||||
if !ok {
|
||||
ctx.ModuleErrorf("srcs dependency %q is not an selinux filegroup",
|
||||
|
|
Loading…
Reference in a new issue