diff --git a/android/visibility.go b/android/visibility.go index 503a02174..7eac47166 100644 --- a/android/visibility.go +++ b/android/visibility.go @@ -351,7 +351,10 @@ func parseRules(ctx BaseModuleContext, currentPkg, property string, visibility [ case "__subpackages__": r = subpackagesRule{pkg} default: - continue + ctx.PropertyErrorf(property, "invalid visibility pattern %q. Must match "+ + " //:, // or : "+ + "where is one of \"__pkg__\", \"__subpackages__\"", + v) } } @@ -397,7 +400,8 @@ func splitRule(ctx BaseModuleContext, ruleExpression string, currentPkg, propert // ensure all the rules on this module are checked. ctx.PropertyErrorf(property, "invalid visibility pattern %q must match"+ - " //:, // or :", + " //:, // or : "+ + "where is one of \"__pkg__\", \"__subpackages__\"", ruleExpression) return false, "", "" }