Merge "Introduce vintf_fragment module type" into main

This commit is contained in:
Kiyoung Kim
2024-08-16 00:26:16 +00:00
committed by Gerrit Code Review
6 changed files with 147 additions and 0 deletions

View File

@@ -111,6 +111,7 @@ type Module interface {
RequiredModuleNames(ctx ConfigAndErrorContext) []string
HostRequiredModuleNames() []string
TargetRequiredModuleNames() []string
VintfFragmentModuleNames(ctx ConfigAndErrorContext) []string
PackagingSpecs() []PackagingSpec
@@ -496,6 +497,9 @@ type commonProperties struct {
// The team (defined by the owner/vendor) who owns the property.
Team *string `android:"path"`
// vintf_fragment Modules required from this module.
Vintf_fragment_modules proptools.Configurable[[]string] `android:"path"`
}
type distProperties struct {
@@ -1034,6 +1038,7 @@ func (m *ModuleBase) baseDepsMutator(ctx BottomUpMutatorContext) {
fullManifest := pv.DeviceArch != nil && pv.DeviceName != nil
if fullManifest {
addRequiredDeps(ctx)
addVintfFragmentDeps(ctx)
}
}
@@ -1111,6 +1116,16 @@ func addRequiredDeps(ctx BottomUpMutatorContext) {
}
}
var vintfDepTag = struct {
blueprint.BaseDependencyTag
InstallAlwaysNeededDependencyTag
}{}
func addVintfFragmentDeps(ctx BottomUpMutatorContext) {
mod := ctx.Module()
ctx.AddDependency(mod, vintfDepTag, mod.VintfFragmentModuleNames(ctx)...)
}
// AddProperties "registers" the provided props
// each value in props MUST be a pointer to a struct
func (m *ModuleBase) AddProperties(props ...interface{}) {
@@ -1599,6 +1614,10 @@ func (m *ModuleBase) TargetRequiredModuleNames() []string {
return m.base().commonProperties.Target_required
}
func (m *ModuleBase) VintfFragmentModuleNames(ctx ConfigAndErrorContext) []string {
return m.base().commonProperties.Vintf_fragment_modules.GetOrDefault(m.ConfigurableEvaluator(ctx), nil)
}
func (m *ModuleBase) InitRc() Paths {
return append(Paths{}, m.initRcPaths...)
}