From 6a8cf5fab4d04c3989ef8925798567896bd76b89 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 30 Dec 2019 16:31:09 +0900 Subject: [PATCH] *RequiredModuleNames functions are available via Module interface ...so that the required module names can be known to other modules Bug: N/A Test: m Change-Id: Ib032b51c4ea4fd77bdebcf09b2d1c2aec1c8eb27 --- android/module.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/android/module.go b/android/module.go index a14e57556..49e034411 100644 --- a/android/module.go +++ b/android/module.go @@ -221,6 +221,10 @@ type Module interface { // Get the visibility rules that control the visibility of this module. visibility() []string + + RequiredModuleNames() []string + HostRequiredModuleNames() []string + TargetRequiredModuleNames() []string } // Qualified id for a module @@ -887,6 +891,18 @@ func (m *ModuleBase) InRecovery() bool { return m.base().commonProperties.ImageVariation == RecoveryVariation } +func (m *ModuleBase) RequiredModuleNames() []string { + return m.base().commonProperties.Required +} + +func (m *ModuleBase) HostRequiredModuleNames() []string { + return m.base().commonProperties.Host_required +} + +func (m *ModuleBase) TargetRequiredModuleNames() []string { + return m.base().commonProperties.Target_required +} + func (m *ModuleBase) generateModuleTarget(ctx ModuleContext) { allInstalledFiles := Paths{} allCheckbuildFiles := Paths{} @@ -1877,15 +1893,15 @@ func (m *moduleContext) ExpandOptionalSource(srcFile *string, prop string) Optio } func (m *moduleContext) RequiredModuleNames() []string { - return m.module.base().commonProperties.Required + return m.module.RequiredModuleNames() } func (m *moduleContext) HostRequiredModuleNames() []string { - return m.module.base().commonProperties.Host_required + return m.module.HostRequiredModuleNames() } func (m *moduleContext) TargetRequiredModuleNames() []string { - return m.module.base().commonProperties.Target_required + return m.module.TargetRequiredModuleNames() } func (b *baseModuleContext) Glob(globPattern string, excludes []string) Paths {