diff options
author | 2024-08-12 11:15:19 +0900 | |
---|---|---|
committer | 2024-08-14 10:34:41 +0900 | |
commit | faf6af31cdee65cfe4dbc26eafff4e9321c67b93 (patch) | |
tree | 7de70239d8c69111f8ea71b8491fcc055a0f39c0 /android/module.go | |
parent | d0338d3565cf1efcf27d7932e4ed62faa09a6076 (diff) |
Introduce vintf_fragment module type
Introduce a new vintf_fragment module type which handles vintf_fragment
files within Soong. This will help process to move vintf_fragment
handling logic from KATI to Soong. This change also introduces
vintf_fragment_modules property to mark dependency with vintf_fragment
modules.
Bug: 322089980
Test: m nothing --no-skip-soong-tests passed
Change-Id: I49607f42aeee3ded0ba7b078b903dc35f5d61637
Diffstat (limited to 'android/module.go')
-rw-r--r-- | android/module.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/android/module.go b/android/module.go index f9fab96a9..e161959ab 100644 --- a/android/module.go +++ b/android/module.go @@ -111,6 +111,7 @@ type Module interface { RequiredModuleNames(ctx ConfigAndErrorContext) []string HostRequiredModuleNames() []string TargetRequiredModuleNames() []string + VintfFragmentModuleNames(ctx ConfigAndErrorContext) []string FilesToInstall() InstallPaths PackagingSpecs() []PackagingSpec @@ -497,6 +498,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 { @@ -1028,6 +1032,7 @@ func (m *ModuleBase) baseDepsMutator(ctx BottomUpMutatorContext) { fullManifest := pv.DeviceArch != nil && pv.DeviceName != nil if fullManifest { addRequiredDeps(ctx) + addVintfFragmentDeps(ctx) } } @@ -1105,6 +1110,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{}) { @@ -1597,6 +1612,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...) } |