aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-05-22 23:00:33 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-05-22 23:00:33 +0000
commitd7f731f1a892cfa001a69f65d371b9dc2266ad69 (patch)
tree53cf07a94676717182ef5cbc112810ce66f71619
parent4915402f51233451d7c4a006970e21e07fd01a0c (diff)
parent778471d6c67cc91a6d152a7239f2d13f4eede704 (diff)
downloadblueprint-d7f731f1a892cfa001a69f65d371b9dc2266ad69.tar.gz
Snap for 7390449 from 778471d6c67cc91a6d152a7239f2d13f4eede704 to sc-d1-release
Change-Id: I70d922a3505fcde6500d689e73edc554eb440666
-rw-r--r--module_ctx.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/module_ctx.go b/module_ctx.go
index da07062..7e8acf6 100644
--- a/module_ctx.go
+++ b/module_ctx.go
@@ -297,13 +297,20 @@ type BaseModuleContext interface {
// OtherModuleDependencyVariantExists returns true if a module with the
// specified name and variant exists. The variant must match the given
// variations. It must also match all the non-local variations of the current
- // module. In other words, it checks for the module AddVariationDependencies
+ // module. In other words, it checks for the module that AddVariationDependencies
// would add a dependency on with the same arguments.
OtherModuleDependencyVariantExists(variations []Variation, name string) bool
+ // OtherModuleFarDependencyVariantExists returns true if a module with the
+ // specified name and variant exists. The variant must match the given
+ // variations, but not the non-local variations of the current module. In
+ // other words, it checks for the module that AddFarVariationDependencies
+ // would add a dependency on with the same arguments.
+ OtherModuleFarDependencyVariantExists(variations []Variation, name string) bool
+
// OtherModuleReverseDependencyVariantExists returns true if a module with the
// specified name exists with the same variations as the current module. In
- // other words, it checks for the module AddReverseDependency would add a
+ // other words, it checks for the module that AddReverseDependency would add a
// dependency on with the same argument.
OtherModuleReverseDependencyVariantExists(name string) bool
@@ -539,6 +546,15 @@ func (m *baseModuleContext) OtherModuleDependencyVariantExists(variations []Vari
return found != nil
}
+func (m *baseModuleContext) OtherModuleFarDependencyVariantExists(variations []Variation, name string) bool {
+ possibleDeps := m.context.moduleGroupFromName(name, m.module.namespace())
+ if possibleDeps == nil {
+ return false
+ }
+ found, _ := findVariant(m.module, possibleDeps, variations, true, false)
+ return found != nil
+}
+
func (m *baseModuleContext) OtherModuleReverseDependencyVariantExists(name string) bool {
possibleDeps := m.context.moduleGroupFromName(name, m.module.namespace())
if possibleDeps == nil {