Merge "//visibility:any_partition can be used with another visibility field" into main
This commit is contained in:
@@ -303,7 +303,10 @@ func checkRules(ctx BaseModuleContext, currentPkg, property string, visibility [
|
|||||||
|
|
||||||
if pkg == "visibility" {
|
if pkg == "visibility" {
|
||||||
switch name {
|
switch name {
|
||||||
case "private", "public", "any_partition":
|
case "private", "public":
|
||||||
|
case "any_partition":
|
||||||
|
// any_partition can be used with another visibility fields
|
||||||
|
continue
|
||||||
case "legacy_public":
|
case "legacy_public":
|
||||||
ctx.PropertyErrorf(property, "//visibility:legacy_public must not be used")
|
ctx.PropertyErrorf(property, "//visibility:legacy_public must not be used")
|
||||||
continue
|
continue
|
||||||
|
@@ -1920,6 +1920,26 @@ var visibilityTests = []struct {
|
|||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "any_partition visibility works with the other visibility",
|
||||||
|
fs: MockFS{
|
||||||
|
"top/Android.bp": []byte(`
|
||||||
|
android_filesystem {
|
||||||
|
name: "foo",
|
||||||
|
deps: ["bar"],
|
||||||
|
}`),
|
||||||
|
"top2/Android.bp": []byte(``),
|
||||||
|
"top/nested/Android.bp": []byte(`
|
||||||
|
package(default_visibility=["//visibility:private"])
|
||||||
|
mock_library {
|
||||||
|
name: "bar",
|
||||||
|
visibility: [
|
||||||
|
"//top2",
|
||||||
|
"//visibility:any_partition"
|
||||||
|
],
|
||||||
|
}`),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "any_partition visibility doesn't work for non-partitions",
|
name: "any_partition visibility doesn't work for non-partitions",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
|
Reference in New Issue
Block a user