Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 873f4b61 authored by Liz Kammer's avatar Liz Kammer
Browse files

Error if visibility specifies a module

Clarify that only __pkg__ and __subpackages__ are valid package
visibility specifications.

Test: go test soong tests
Test: m nothing
Bug: 168926331
Change-Id: I810e9ef92d081d85cd762e7f8c0b0716f0222883
parent faf30e19
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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 "+
					" //<package>:<scope>, //<package> or :<scope> "+
					"where <scope> 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"+
				" //<package>:<module>, //<package> or :<module>",
				" //<package>:<scope>, //<package> or :<scope> "+
				"where <scope> is one of \"__pkg__\", \"__subpackages__\"",
			ruleExpression)
		return false, "", ""
	}