summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2025-02-19 00:47:23 +0000
committer Jihoon Kang <jihoonkang@google.com> 2025-02-19 18:45:16 +0000
commitf50d2e6a01ac220d29a1e3ba2ac42f1465a48cc2 (patch)
tree4c02ef91e7f842c7569df2a9ec61c0c2604e5fa4
parent85cd549ecc55f7540580c5a8818ec54f02df1857 (diff)
Introduce Soong API ctx.OtherModuleSubDir(m Module)
The newly added Soong API can be used to find out the subDir (i.e. variation) of another module. Utilization of the API will be done in a follow up CL. Test: CI Bug: 395989947 Change-Id: Ie1dd8e677349a03a807684b0f6b34bb8fc0d2d13
-rw-r--r--android/base_module_context.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/android/base_module_context.go b/android/base_module_context.go
index 4b90083be..2c47e1583 100644
--- a/android/base_module_context.go
+++ b/android/base_module_context.go
@@ -53,6 +53,9 @@ type BaseModuleContext interface {
// dependencies on the module being visited, it returns the dependency tag used for the current dependency.
OtherModuleDependencyTag(m blueprint.Module) blueprint.DependencyTag
+ // OtherModuleSubDir returns the string representing the variations of a module.
+ OtherModuleSubDir(m blueprint.Module) string
+
// OtherModuleExists returns true if a module with the specified name exists, as determined by the NameInterface
// passed to Context.SetNameInterface, or SimpleNameInterface if it was not called.
OtherModuleExists(name string) bool
@@ -279,6 +282,9 @@ func (b *baseModuleContext) OtherModuleErrorf(m blueprint.Module, fmt string, ar
func (b *baseModuleContext) OtherModuleDependencyTag(m blueprint.Module) blueprint.DependencyTag {
return b.bp.OtherModuleDependencyTag(getWrappedModule(m))
}
+func (b *baseModuleContext) OtherModuleSubDir(m blueprint.Module) string {
+ return b.bp.OtherModuleSubDir(getWrappedModule(m))
+}
func (b *baseModuleContext) OtherModuleExists(name string) bool { return b.bp.OtherModuleExists(name) }
func (b *baseModuleContext) OtherModuleDependencyVariantExists(variations []blueprint.Variation, name string) bool {
return b.bp.OtherModuleDependencyVariantExists(variations, name)