aboutsummaryrefslogtreecommitdiffstats
path: root/context.go
diff options
context:
space:
mode:
authorNan Zhang <nanzhang@google.com>2017-03-10 16:39:27 -0800
committerNan Zhang <nanzhang@google.com>2017-03-10 16:39:27 -0800
commit346b2d0d8038fffde5f9098afefaee885ef15778 (patch)
treec70d8ca1beceae39b861f5d3446673aa5bac0e02 /context.go
parent2831e690f070d26b69f321a4ba6e0b3da5c43702 (diff)
downloadandroid_build_blueprint-346b2d0d8038fffde5f9098afefaee885ef15778.tar.gz
android_build_blueprint-346b2d0d8038fffde5f9098afefaee885ef15778.tar.bz2
android_build_blueprint-346b2d0d8038fffde5f9098afefaee885ef15778.zip
Added a check in BP level for BaseDependencyTag
It is not allowed to directly use BaseDependencyTag as customized user dependency tag passed down to BP since it might cause issues that different type of modules will be mixed when fetched based on Tag.
Diffstat (limited to 'context.go')
-rw-r--r--context.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/context.go b/context.go
index f63b1af..97a3462 100644
--- a/context.go
+++ b/context.go
@@ -1191,6 +1191,10 @@ func (c *Context) findMatchingVariant(module *moduleInfo, possible []*moduleInfo
}
func (c *Context) addDependency(module *moduleInfo, tag DependencyTag, depName string) []error {
+ if _, ok := tag.(BaseDependencyTag); ok {
+ panic("BaseDependencyTag is not allowed to be used directly!")
+ }
+
if depName == module.Name() {
return []error{&BlueprintError{
Err: fmt.Errorf("%q depends on itself", depName),
@@ -1262,6 +1266,9 @@ func (c *Context) findReverseDependency(module *moduleInfo, destName string) (*m
func (c *Context) addVariationDependency(module *moduleInfo, variations []Variation,
tag DependencyTag, depName string, far bool) []error {
+ if _, ok := tag.(BaseDependencyTag); ok {
+ panic("BaseDependencyTag is not allowed to be used directly!")
+ }
possibleDeps := c.modulesFromName(depName)
if possibleDeps == nil {
@@ -1328,6 +1335,9 @@ func (c *Context) addVariationDependency(module *moduleInfo, variations []Variat
func (c *Context) addInterVariantDependency(origModule *moduleInfo, tag DependencyTag,
from, to Module) {
+ if _, ok := tag.(BaseDependencyTag); ok {
+ panic("BaseDependencyTag is not allowed to be used directly!")
+ }
var fromInfo, toInfo *moduleInfo
for _, m := range origModule.splitModules {