Do not modules in files called "Blueprints".
The only case for this was Blueprint itself at build/blueprint, but with that being a part of Soong, this special case is not necessary anymore. Test: Presubmits. Change-Id: Icc51cd80bd43f936a97018061cfbf76fc385e4c3
This commit is contained in:
parent
7686708a43
commit
b838b0a147
9 changed files with 171 additions and 174 deletions
|
@ -525,7 +525,7 @@ func (c *config) mockFileSystem(bp string, fs map[string][]byte) {
|
||||||
pathsToParse := []string{}
|
pathsToParse := []string{}
|
||||||
for candidate := range mockFS {
|
for candidate := range mockFS {
|
||||||
base := filepath.Base(candidate)
|
base := filepath.Base(candidate)
|
||||||
if base == "Blueprints" || base == "Android.bp" {
|
if base == "Android.bp" {
|
||||||
pathsToParse = append(pathsToParse, candidate)
|
pathsToParse = append(pathsToParse, candidate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,38 +14,38 @@ var licenseKindTests = []struct {
|
||||||
{
|
{
|
||||||
name: "license_kind must not accept licenses property",
|
name: "license_kind must not accept licenses property",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "top_license",
|
name: "top_license",
|
||||||
licenses: ["other_license"],
|
licenses: ["other_license"],
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
expectedErrors: []string{
|
expectedErrors: []string{
|
||||||
`top/Blueprints:4:14: unrecognized property "licenses"`,
|
`top/Android.bp:4:14: unrecognized property "licenses"`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "bad license_kind",
|
name: "bad license_kind",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "top_notice",
|
name: "top_notice",
|
||||||
conditions: ["notice"],
|
conditions: ["notice"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_license {
|
mock_license {
|
||||||
name: "other_notice",
|
name: "other_notice",
|
||||||
license_kinds: ["notice"],
|
license_kinds: ["notice"],
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
expectedErrors: []string{
|
expectedErrors: []string{
|
||||||
`other/Blueprints:2:5: "other_notice" depends on undefined module "notice"`,
|
`other/Android.bp:2:5: "other_notice" depends on undefined module "notice"`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "good license kind",
|
name: "good license kind",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "top_by_exception_only",
|
name: "top_by_exception_only",
|
||||||
conditions: ["by_exception_only"],
|
conditions: ["by_exception_only"],
|
||||||
|
@ -55,7 +55,7 @@ var licenseKindTests = []struct {
|
||||||
name: "top_proprietary",
|
name: "top_proprietary",
|
||||||
license_kinds: ["top_by_exception_only"],
|
license_kinds: ["top_by_exception_only"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_license {
|
mock_license {
|
||||||
name: "other_proprietary",
|
name: "other_proprietary",
|
||||||
license_kinds: ["top_proprietary"],
|
license_kinds: ["top_proprietary"],
|
||||||
|
@ -65,7 +65,7 @@ var licenseKindTests = []struct {
|
||||||
{
|
{
|
||||||
name: "multiple license kinds",
|
name: "multiple license kinds",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "top_notice",
|
name: "top_notice",
|
||||||
conditions: ["notice"],
|
conditions: ["notice"],
|
||||||
|
@ -85,7 +85,7 @@ var licenseKindTests = []struct {
|
||||||
name: "top_proprietary",
|
name: "top_proprietary",
|
||||||
license_kinds: ["top_by_exception_only"],
|
license_kinds: ["top_by_exception_only"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_license {
|
mock_license {
|
||||||
name: "other_rule",
|
name: "other_rule",
|
||||||
license_kinds: ["top_by_exception_only"],
|
license_kinds: ["top_by_exception_only"],
|
||||||
|
|
|
@ -27,7 +27,7 @@ var licenseTests = []struct {
|
||||||
{
|
{
|
||||||
name: "license must not accept licenses property",
|
name: "license must not accept licenses property",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "top_license",
|
name: "top_license",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -35,13 +35,13 @@ var licenseTests = []struct {
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
expectedErrors: []string{
|
expectedErrors: []string{
|
||||||
`top/Blueprints:5:14: unrecognized property "licenses"`,
|
`top/Android.bp:5:14: unrecognized property "licenses"`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "private license",
|
name: "private license",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "top_notice",
|
name: "top_notice",
|
||||||
conditions: ["notice"],
|
conditions: ["notice"],
|
||||||
|
@ -53,27 +53,27 @@ var licenseTests = []struct {
|
||||||
license_kinds: ["top_notice"],
|
license_kinds: ["top_notice"],
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
rule {
|
rule {
|
||||||
name: "arule",
|
name: "arule",
|
||||||
licenses: ["top_allowed_as_notice"],
|
licenses: ["top_allowed_as_notice"],
|
||||||
}`),
|
}`),
|
||||||
"yetmore/Blueprints": []byte(`
|
"yetmore/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["top_allowed_as_notice"],
|
default_applicable_licenses: ["top_allowed_as_notice"],
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
expectedErrors: []string{
|
expectedErrors: []string{
|
||||||
`other/Blueprints:2:5: module "arule": depends on //top:top_allowed_as_notice ` +
|
`other/Android.bp:2:5: module "arule": depends on //top:top_allowed_as_notice ` +
|
||||||
`which is not visible to this module`,
|
`which is not visible to this module`,
|
||||||
`yetmore/Blueprints:2:5: module "//yetmore": depends on //top:top_allowed_as_notice ` +
|
`yetmore/Android.bp:2:5: module "//yetmore": depends on //top:top_allowed_as_notice ` +
|
||||||
`which is not visible to this module`,
|
`which is not visible to this module`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "must reference license_kind module",
|
name: "must reference license_kind module",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
rule {
|
rule {
|
||||||
name: "top_by_exception_only",
|
name: "top_by_exception_only",
|
||||||
}
|
}
|
||||||
|
@ -85,14 +85,14 @@ var licenseTests = []struct {
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
expectedErrors: []string{
|
expectedErrors: []string{
|
||||||
`top/Blueprints:6:5: module "top_proprietary": license_kinds property ` +
|
`top/Android.bp:6:5: module "top_proprietary": license_kinds property ` +
|
||||||
`"top_by_exception_only" is not a license_kind module`,
|
`"top_by_exception_only" is not a license_kind module`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "license_kind module must exist",
|
name: "license_kind module must exist",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "top_notice_allowed",
|
name: "top_notice_allowed",
|
||||||
license_kinds: ["top_notice"],
|
license_kinds: ["top_notice"],
|
||||||
|
@ -100,13 +100,13 @@ var licenseTests = []struct {
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
expectedErrors: []string{
|
expectedErrors: []string{
|
||||||
`top/Blueprints:2:5: "top_notice_allowed" depends on undefined module "top_notice"`,
|
`top/Android.bp:2:5: "top_notice_allowed" depends on undefined module "top_notice"`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "public license",
|
name: "public license",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "top_by_exception_only",
|
name: "top_by_exception_only",
|
||||||
conditions: ["by_exception_only"],
|
conditions: ["by_exception_only"],
|
||||||
|
@ -118,12 +118,12 @@ var licenseTests = []struct {
|
||||||
license_kinds: ["top_by_exception_only"],
|
license_kinds: ["top_by_exception_only"],
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
rule {
|
rule {
|
||||||
name: "arule",
|
name: "arule",
|
||||||
licenses: ["top_proprietary"],
|
licenses: ["top_proprietary"],
|
||||||
}`),
|
}`),
|
||||||
"yetmore/Blueprints": []byte(`
|
"yetmore/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["top_proprietary"],
|
default_applicable_licenses: ["top_proprietary"],
|
||||||
}`),
|
}`),
|
||||||
|
@ -132,7 +132,7 @@ var licenseTests = []struct {
|
||||||
{
|
{
|
||||||
name: "multiple licenses",
|
name: "multiple licenses",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["top_proprietary"],
|
default_applicable_licenses: ["top_proprietary"],
|
||||||
}
|
}
|
||||||
|
@ -162,12 +162,12 @@ var licenseTests = []struct {
|
||||||
name: "myrule",
|
name: "myrule",
|
||||||
licenses: ["top_allowed_as_notice", "top_proprietary"]
|
licenses: ["top_allowed_as_notice", "top_proprietary"]
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
rule {
|
rule {
|
||||||
name: "arule",
|
name: "arule",
|
||||||
licenses: ["top_proprietary"],
|
licenses: ["top_proprietary"],
|
||||||
}`),
|
}`),
|
||||||
"yetmore/Blueprints": []byte(`
|
"yetmore/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["top_proprietary"],
|
default_applicable_licenses: ["top_proprietary"],
|
||||||
}`),
|
}`),
|
||||||
|
|
|
@ -20,7 +20,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid module type without licenses property",
|
name: "invalid module type without licenses property",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_bad_module {
|
mock_bad_module {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
}`),
|
}`),
|
||||||
|
@ -30,7 +30,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "license must exist",
|
name: "license must exist",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
licenses: ["notice"],
|
licenses: ["notice"],
|
||||||
|
@ -41,7 +41,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "all good",
|
name: "all good",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "notice",
|
name: "notice",
|
||||||
conditions: ["shownotice"],
|
conditions: ["shownotice"],
|
||||||
|
@ -58,12 +58,12 @@ var licensesTests = []struct {
|
||||||
name: "libexample1",
|
name: "libexample1",
|
||||||
licenses: ["top_Apache2"],
|
licenses: ["top_Apache2"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
licenses: ["top_Apache2"],
|
licenses: ["top_Apache2"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
licenses: ["top_Apache2"],
|
licenses: ["top_Apache2"],
|
||||||
|
@ -101,7 +101,7 @@ var licensesTests = []struct {
|
||||||
// Check that licenses is the union of the defaults modules.
|
// Check that licenses is the union of the defaults modules.
|
||||||
name: "defaults union, basic",
|
name: "defaults union, basic",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "top_notice",
|
name: "top_notice",
|
||||||
conditions: ["notice"],
|
conditions: ["notice"],
|
||||||
|
@ -125,7 +125,7 @@ var licensesTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
license_kind {
|
license_kind {
|
||||||
name: "nested_notice",
|
name: "nested_notice",
|
||||||
conditions: ["notice"],
|
conditions: ["notice"],
|
||||||
|
@ -140,7 +140,7 @@ var licensesTests = []struct {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -174,7 +174,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "defaults union, multiple defaults",
|
name: "defaults union, multiple defaults",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "top",
|
name: "top",
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ var licensesTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "top_nested",
|
name: "top_nested",
|
||||||
license_text: ["LICENSE.txt"],
|
license_text: ["LICENSE.txt"],
|
||||||
|
@ -203,7 +203,7 @@ var licensesTests = []struct {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "other",
|
name: "other",
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ var licensesTests = []struct {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -251,7 +251,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "defaults_licenses invalid",
|
name: "defaults_licenses invalid",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "top_defaults",
|
name: "top_defaults",
|
||||||
licenses: ["notice"],
|
licenses: ["notice"],
|
||||||
|
@ -262,7 +262,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "defaults_licenses overrides package default",
|
name: "defaults_licenses overrides package default",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["by_exception_only"],
|
default_applicable_licenses: ["by_exception_only"],
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_applicable_licenses must exist",
|
name: "package default_applicable_licenses must exist",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["notice"],
|
default_applicable_licenses: ["notice"],
|
||||||
}`),
|
}`),
|
||||||
|
@ -309,7 +309,7 @@ var licensesTests = []struct {
|
||||||
// This test relies on the default licenses being legacy_public.
|
// This test relies on the default licenses being legacy_public.
|
||||||
name: "package default_applicable_licenses property used when no licenses specified",
|
name: "package default_applicable_licenses property used when no licenses specified",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["top_notice"],
|
default_applicable_licenses: ["top_notice"],
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ var licensesTests = []struct {
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -338,7 +338,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_applicable_licenses not inherited to subpackages",
|
name: "package default_applicable_licenses not inherited to subpackages",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["top_notice"],
|
default_applicable_licenses: ["top_notice"],
|
||||||
}
|
}
|
||||||
|
@ -348,7 +348,7 @@ var licensesTests = []struct {
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_applicable_licenses: ["outsider"],
|
default_applicable_licenses: ["outsider"],
|
||||||
}
|
}
|
||||||
|
@ -356,11 +356,11 @@ var licensesTests = []struct {
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
}`),
|
}`),
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "outsider",
|
name: "outsider",
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "verify that prebuilt dependencies are included",
|
name: "verify that prebuilt dependencies are included",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"prebuilts/Blueprints": []byte(`
|
"prebuilts/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "prebuilt"
|
name: "prebuilt"
|
||||||
}
|
}
|
||||||
|
@ -394,7 +394,7 @@ var licensesTests = []struct {
|
||||||
licenses: ["prebuilt"],
|
licenses: ["prebuilt"],
|
||||||
}`),
|
}`),
|
||||||
"top/sources/source_file": nil,
|
"top/sources/source_file": nil,
|
||||||
"top/sources/Blueprints": []byte(`
|
"top/sources/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "top_sources"
|
name: "top_sources"
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ var licensesTests = []struct {
|
||||||
licenses: ["top_sources"],
|
licenses: ["top_sources"],
|
||||||
}`),
|
}`),
|
||||||
"top/other/source_file": nil,
|
"top/other/source_file": nil,
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
source {
|
source {
|
||||||
name: "other",
|
name: "other",
|
||||||
deps: [":module"],
|
deps: [":module"],
|
||||||
|
@ -419,7 +419,7 @@ var licensesTests = []struct {
|
||||||
{
|
{
|
||||||
name: "verify that prebuilt dependencies are ignored for licenses reasons (preferred)",
|
name: "verify that prebuilt dependencies are ignored for licenses reasons (preferred)",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"prebuilts/Blueprints": []byte(`
|
"prebuilts/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "prebuilt"
|
name: "prebuilt"
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ var licensesTests = []struct {
|
||||||
prefer: true,
|
prefer: true,
|
||||||
}`),
|
}`),
|
||||||
"top/sources/source_file": nil,
|
"top/sources/source_file": nil,
|
||||||
"top/sources/Blueprints": []byte(`
|
"top/sources/Android.bp": []byte(`
|
||||||
license {
|
license {
|
||||||
name: "top_sources"
|
name: "top_sources"
|
||||||
}
|
}
|
||||||
|
@ -438,7 +438,7 @@ var licensesTests = []struct {
|
||||||
licenses: ["top_sources"],
|
licenses: ["top_sources"],
|
||||||
}`),
|
}`),
|
||||||
"top/other/source_file": nil,
|
"top/other/source_file": nil,
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
source {
|
source {
|
||||||
name: "other",
|
name: "other",
|
||||||
deps: [":module"],
|
deps: [":module"],
|
||||||
|
|
|
@ -13,7 +13,7 @@ var packageTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package must not accept visibility and name properties",
|
name: "package must not accept visibility and name properties",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
name: "package",
|
name: "package",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -21,21 +21,21 @@ var packageTests = []struct {
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
expectedErrors: []string{
|
expectedErrors: []string{
|
||||||
`top/Blueprints:5:14: unrecognized property "licenses"`,
|
`top/Android.bp:5:14: unrecognized property "licenses"`,
|
||||||
`top/Blueprints:3:10: unrecognized property "name"`,
|
`top/Android.bp:3:10: unrecognized property "name"`,
|
||||||
`top/Blueprints:4:16: unrecognized property "visibility"`,
|
`top/Android.bp:4:16: unrecognized property "visibility"`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "multiple packages in separate directories",
|
name: "multiple packages in separate directories",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
}`),
|
}`),
|
||||||
"other/nested/Blueprints": []byte(`
|
"other/nested/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
}`),
|
}`),
|
||||||
},
|
},
|
||||||
|
@ -43,7 +43,7 @@ var packageTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package must not be specified more than once per package",
|
name: "package must not be specified more than once per package",
|
||||||
fs: map[string][]byte{
|
fs: map[string][]byte{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//visibility:private"],
|
default_visibility: ["//visibility:private"],
|
||||||
default_applicable_licenses: ["license"],
|
default_applicable_licenses: ["license"],
|
||||||
|
|
|
@ -16,7 +16,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid visibility: empty list",
|
name: "invalid visibility: empty list",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: [],
|
visibility: [],
|
||||||
|
@ -27,7 +27,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid visibility: empty rule",
|
name: "invalid visibility: empty rule",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: [""],
|
visibility: [""],
|
||||||
|
@ -38,7 +38,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid visibility: unqualified",
|
name: "invalid visibility: unqualified",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["target"],
|
visibility: ["target"],
|
||||||
|
@ -49,7 +49,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid visibility: empty namespace",
|
name: "invalid visibility: empty namespace",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//"],
|
visibility: ["//"],
|
||||||
|
@ -60,7 +60,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid visibility: empty module",
|
name: "invalid visibility: empty module",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: [":"],
|
visibility: [":"],
|
||||||
|
@ -71,7 +71,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid visibility: empty namespace and module",
|
name: "invalid visibility: empty namespace and module",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//:"],
|
visibility: ["//:"],
|
||||||
|
@ -82,7 +82,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:unknown",
|
name: "//visibility:unknown",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//visibility:unknown"],
|
visibility: ["//visibility:unknown"],
|
||||||
|
@ -93,7 +93,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:xxx mixed",
|
name: "//visibility:xxx mixed",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//visibility:public", "//namespace"],
|
visibility: ["//visibility:public", "//namespace"],
|
||||||
|
@ -114,7 +114,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:legacy_public",
|
name: "//visibility:legacy_public",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//visibility:legacy_public"],
|
visibility: ["//visibility:legacy_public"],
|
||||||
|
@ -130,7 +130,7 @@ var visibilityTests = []struct {
|
||||||
// the current directory, a nested directory and a directory in a separate tree.
|
// the current directory, a nested directory and a directory in a separate tree.
|
||||||
name: "//visibility:public",
|
name: "//visibility:public",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
|
@ -140,12 +140,12 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -157,7 +157,7 @@ var visibilityTests = []struct {
|
||||||
// directory only.
|
// directory only.
|
||||||
name: "//visibility:private",
|
name: "//visibility:private",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -167,12 +167,12 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -189,7 +189,7 @@ var visibilityTests = []struct {
|
||||||
// Verify that :__pkg__ allows the module to be referenced from the current directory only.
|
// Verify that :__pkg__ allows the module to be referenced from the current directory only.
|
||||||
name: ":__pkg__",
|
name: ":__pkg__",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: [":__pkg__"],
|
visibility: [":__pkg__"],
|
||||||
|
@ -199,12 +199,12 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -222,7 +222,7 @@ var visibilityTests = []struct {
|
||||||
// the top/nested directory only, not a subdirectory of top/nested and not peak directory.
|
// the top/nested directory only, not a subdirectory of top/nested and not peak directory.
|
||||||
name: "//top/nested",
|
name: "//top/nested",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//top/nested"],
|
visibility: ["//top/nested"],
|
||||||
|
@ -232,17 +232,17 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/again/Blueprints": []byte(`
|
"top/nested/again/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnestedagain",
|
name: "libnestedagain",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"peak/Blueprints": []byte(`
|
"peak/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -260,7 +260,7 @@ var visibilityTests = []struct {
|
||||||
// and sub directories but nowhere else.
|
// and sub directories but nowhere else.
|
||||||
name: ":__subpackages__",
|
name: ":__subpackages__",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: [":__subpackages__"],
|
visibility: [":__subpackages__"],
|
||||||
|
@ -270,12 +270,12 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"peak/other/Blueprints": []byte(`
|
"peak/other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -291,7 +291,7 @@ var visibilityTests = []struct {
|
||||||
// directory and sub directories but nowhere else.
|
// directory and sub directories but nowhere else.
|
||||||
name: "//top/nested:__subpackages__",
|
name: "//top/nested:__subpackages__",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//top/nested:__subpackages__", "//other"],
|
visibility: ["//top/nested:__subpackages__", "//other"],
|
||||||
|
@ -301,12 +301,12 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -322,7 +322,7 @@ var visibilityTests = []struct {
|
||||||
// the current directory, top/nested and peak and all its subpackages.
|
// the current directory, top/nested and peak and all its subpackages.
|
||||||
name: `["//top/nested", "//peak:__subpackages__"]`,
|
name: `["//top/nested", "//peak:__subpackages__"]`,
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//top/nested", "//peak:__subpackages__"],
|
visibility: ["//top/nested", "//peak:__subpackages__"],
|
||||||
|
@ -332,12 +332,12 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"peak/other/Blueprints": []byte(`
|
"peak/other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -348,7 +348,7 @@ var visibilityTests = []struct {
|
||||||
// Verify that //vendor... cannot be used outside vendor apart from //vendor:__subpackages__
|
// Verify that //vendor... cannot be used outside vendor apart from //vendor:__subpackages__
|
||||||
name: `//vendor`,
|
name: `//vendor`,
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//vendor:__subpackages__"],
|
visibility: ["//vendor:__subpackages__"],
|
||||||
|
@ -358,13 +358,13 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
visibility: ["//vendor/apps/AcmeSettings"],
|
visibility: ["//vendor/apps/AcmeSettings"],
|
||||||
}`),
|
}`),
|
||||||
"vendor/Blueprints": []byte(`
|
"vendor/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libvendorexample",
|
name: "libvendorexample",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
visibility: ["//vendor/nested"],
|
visibility: ["//vendor/nested"],
|
||||||
}`),
|
}`),
|
||||||
"vendor/nested/Blueprints": []byte(`
|
"vendor/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libvendornested",
|
name: "libvendornested",
|
||||||
deps: ["libexample", "libvendorexample"],
|
deps: ["libexample", "libvendorexample"],
|
||||||
|
@ -382,7 +382,7 @@ var visibilityTests = []struct {
|
||||||
// Check that visibility is the union of the defaults modules.
|
// Check that visibility is the union of the defaults modules.
|
||||||
name: "defaults union, basic",
|
name: "defaults union, basic",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//other"],
|
visibility: ["//other"],
|
||||||
|
@ -396,17 +396,17 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -420,7 +420,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "defaults union, multiple defaults",
|
name: "defaults union, multiple defaults",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults_1",
|
name: "libexample_defaults_1",
|
||||||
visibility: ["//other"],
|
visibility: ["//other"],
|
||||||
|
@ -437,17 +437,17 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -461,7 +461,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:public mixed with other in defaults",
|
name: "//visibility:public mixed with other in defaults",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:public", "//namespace"],
|
visibility: ["//visibility:public", "//namespace"],
|
||||||
|
@ -479,7 +479,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:public overriding defaults",
|
name: "//visibility:public overriding defaults",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//namespace"],
|
visibility: ["//namespace"],
|
||||||
|
@ -489,7 +489,7 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
defaults: ["libexample_defaults"],
|
defaults: ["libexample_defaults"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -502,7 +502,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:public mixed with other from different defaults 1",
|
name: "//visibility:public mixed with other from different defaults 1",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults_1",
|
name: "libexample_defaults_1",
|
||||||
visibility: ["//namespace"],
|
visibility: ["//namespace"],
|
||||||
|
@ -515,7 +515,7 @@ var visibilityTests = []struct {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
defaults: ["libexample_defaults_1", "libexample_defaults_2"],
|
defaults: ["libexample_defaults_1", "libexample_defaults_2"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -525,7 +525,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:public mixed with other from different defaults 2",
|
name: "//visibility:public mixed with other from different defaults 2",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults_1",
|
name: "libexample_defaults_1",
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
|
@ -538,7 +538,7 @@ var visibilityTests = []struct {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
defaults: ["libexample_defaults_1", "libexample_defaults_2"],
|
defaults: ["libexample_defaults_1", "libexample_defaults_2"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -548,7 +548,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:private in defaults",
|
name: "//visibility:private in defaults",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -561,12 +561,12 @@ var visibilityTests = []struct {
|
||||||
name: "libsamepackage",
|
name: "libsamepackage",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -582,7 +582,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:private mixed with other in defaults",
|
name: "//visibility:private mixed with other in defaults",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:private", "//namespace"],
|
visibility: ["//visibility:private", "//namespace"],
|
||||||
|
@ -600,7 +600,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:private overriding defaults",
|
name: "//visibility:private overriding defaults",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//namespace"],
|
visibility: ["//namespace"],
|
||||||
|
@ -619,7 +619,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:private in defaults overridden",
|
name: "//visibility:private in defaults overridden",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -638,7 +638,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:private override //visibility:public",
|
name: "//visibility:private override //visibility:public",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
|
@ -656,7 +656,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:public override //visibility:private",
|
name: "//visibility:public override //visibility:private",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -674,7 +674,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:override must be first in the list",
|
name: "//visibility:override must be first in the list",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//other", "//visibility:override", "//namespace"],
|
visibility: ["//other", "//visibility:override", "//namespace"],
|
||||||
|
@ -687,7 +687,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:override discards //visibility:private",
|
name: "//visibility:override discards //visibility:private",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -698,7 +698,7 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//visibility:override", "//other"],
|
visibility: ["//visibility:override", "//other"],
|
||||||
defaults: ["libexample_defaults"],
|
defaults: ["libexample_defaults"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -708,7 +708,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:override discards //visibility:public",
|
name: "//visibility:override discards //visibility:public",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
|
@ -719,12 +719,12 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//visibility:override", "//other"],
|
visibility: ["//visibility:override", "//other"],
|
||||||
defaults: ["libexample_defaults"],
|
defaults: ["libexample_defaults"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"namespace/Blueprints": []byte(`
|
"namespace/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnamespace",
|
name: "libnamespace",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -737,7 +737,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:override discards defaults supplied rules",
|
name: "//visibility:override discards defaults supplied rules",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//namespace"],
|
visibility: ["//namespace"],
|
||||||
|
@ -748,12 +748,12 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//visibility:override", "//other"],
|
visibility: ["//visibility:override", "//other"],
|
||||||
defaults: ["libexample_defaults"],
|
defaults: ["libexample_defaults"],
|
||||||
}`),
|
}`),
|
||||||
"other/Blueprints": []byte(`
|
"other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"namespace/Blueprints": []byte(`
|
"namespace/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnamespace",
|
name: "libnamespace",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -766,7 +766,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:override can override //visibility:public with //visibility:private",
|
name: "//visibility:override can override //visibility:public with //visibility:private",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
|
@ -776,7 +776,7 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//visibility:override", "//visibility:private"],
|
visibility: ["//visibility:override", "//visibility:private"],
|
||||||
defaults: ["libexample_defaults"],
|
defaults: ["libexample_defaults"],
|
||||||
}`),
|
}`),
|
||||||
"namespace/Blueprints": []byte(`
|
"namespace/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnamespace",
|
name: "libnamespace",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -789,7 +789,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:override can override //visibility:private with //visibility:public",
|
name: "//visibility:override can override //visibility:private with //visibility:public",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults",
|
name: "libexample_defaults",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -799,7 +799,7 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//visibility:override", "//visibility:public"],
|
visibility: ["//visibility:override", "//visibility:public"],
|
||||||
defaults: ["libexample_defaults"],
|
defaults: ["libexample_defaults"],
|
||||||
}`),
|
}`),
|
||||||
"namespace/Blueprints": []byte(`
|
"namespace/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnamespace",
|
name: "libnamespace",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -809,7 +809,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "//visibility:private mixed with itself",
|
name: "//visibility:private mixed with itself",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "libexample_defaults_1",
|
name: "libexample_defaults_1",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
|
@ -823,7 +823,7 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
defaults: ["libexample_defaults_1", "libexample_defaults_2"],
|
defaults: ["libexample_defaults_1", "libexample_defaults_2"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -839,7 +839,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "defaults_visibility invalid",
|
name: "defaults_visibility invalid",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_defaults {
|
mock_defaults {
|
||||||
name: "top_defaults",
|
name: "top_defaults",
|
||||||
defaults_visibility: ["//visibility:invalid"],
|
defaults_visibility: ["//visibility:invalid"],
|
||||||
|
@ -852,7 +852,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "defaults_visibility overrides package default",
|
name: "defaults_visibility overrides package default",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//visibility:private"],
|
default_visibility: ["//visibility:private"],
|
||||||
}
|
}
|
||||||
|
@ -860,7 +860,7 @@ var visibilityTests = []struct {
|
||||||
name: "top_defaults",
|
name: "top_defaults",
|
||||||
defaults_visibility: ["//visibility:public"],
|
defaults_visibility: ["//visibility:public"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
defaults: ["top_defaults"],
|
defaults: ["top_defaults"],
|
||||||
|
@ -872,7 +872,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_visibility property is checked",
|
name: "package default_visibility property is checked",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//visibility:invalid"],
|
default_visibility: ["//visibility:invalid"],
|
||||||
}`),
|
}`),
|
||||||
|
@ -883,7 +883,7 @@ var visibilityTests = []struct {
|
||||||
// This test relies on the default visibility being legacy_public.
|
// This test relies on the default visibility being legacy_public.
|
||||||
name: "package default_visibility property used when no visibility specified",
|
name: "package default_visibility property used when no visibility specified",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//visibility:private"],
|
default_visibility: ["//visibility:private"],
|
||||||
}
|
}
|
||||||
|
@ -891,7 +891,7 @@ var visibilityTests = []struct {
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -905,7 +905,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_visibility public does not override visibility private",
|
name: "package default_visibility public does not override visibility private",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//visibility:public"],
|
default_visibility: ["//visibility:public"],
|
||||||
}
|
}
|
||||||
|
@ -914,7 +914,7 @@ var visibilityTests = []struct {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -928,7 +928,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_visibility private does not override visibility public",
|
name: "package default_visibility private does not override visibility public",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//visibility:private"],
|
default_visibility: ["//visibility:private"],
|
||||||
}
|
}
|
||||||
|
@ -937,7 +937,7 @@ var visibilityTests = []struct {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -947,7 +947,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_visibility :__subpackages__",
|
name: "package default_visibility :__subpackages__",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: [":__subpackages__"],
|
default_visibility: [":__subpackages__"],
|
||||||
}
|
}
|
||||||
|
@ -955,12 +955,12 @@ var visibilityTests = []struct {
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
|
@ -974,7 +974,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_visibility inherited to subpackages",
|
name: "package default_visibility inherited to subpackages",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//outsider"],
|
default_visibility: ["//outsider"],
|
||||||
}
|
}
|
||||||
|
@ -983,12 +983,12 @@ var visibilityTests = []struct {
|
||||||
name: "libexample",
|
name: "libexample",
|
||||||
visibility: [":__subpackages__"],
|
visibility: [":__subpackages__"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libexample"],
|
deps: ["libexample"],
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libexample", "libnested"],
|
deps: ["libexample", "libnested"],
|
||||||
|
@ -1002,11 +1002,11 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "package default_visibility inherited to subpackages",
|
name: "package default_visibility inherited to subpackages",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//visibility:private"],
|
default_visibility: ["//visibility:private"],
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
package {
|
package {
|
||||||
default_visibility: ["//outsider"],
|
default_visibility: ["//outsider"],
|
||||||
}
|
}
|
||||||
|
@ -1014,11 +1014,11 @@ var visibilityTests = []struct {
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
}`),
|
}`),
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
}`),
|
}`),
|
||||||
"outsider/Blueprints": []byte(`
|
"outsider/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "liboutsider",
|
name: "liboutsider",
|
||||||
deps: ["libother", "libnested"],
|
deps: ["libother", "libnested"],
|
||||||
|
@ -1032,19 +1032,19 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "verify that prebuilt dependencies are ignored for visibility reasons (not preferred)",
|
name: "verify that prebuilt dependencies are ignored for visibility reasons (not preferred)",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"prebuilts/Blueprints": []byte(`
|
"prebuilts/Android.bp": []byte(`
|
||||||
prebuilt {
|
prebuilt {
|
||||||
name: "module",
|
name: "module",
|
||||||
visibility: ["//top/other"],
|
visibility: ["//top/other"],
|
||||||
}`),
|
}`),
|
||||||
"top/sources/source_file": nil,
|
"top/sources/source_file": nil,
|
||||||
"top/sources/Blueprints": []byte(`
|
"top/sources/Android.bp": []byte(`
|
||||||
source {
|
source {
|
||||||
name: "module",
|
name: "module",
|
||||||
visibility: ["//top/other"],
|
visibility: ["//top/other"],
|
||||||
}`),
|
}`),
|
||||||
"top/other/source_file": nil,
|
"top/other/source_file": nil,
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
source {
|
source {
|
||||||
name: "other",
|
name: "other",
|
||||||
deps: [":module"],
|
deps: [":module"],
|
||||||
|
@ -1054,20 +1054,20 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "verify that prebuilt dependencies are ignored for visibility reasons (preferred)",
|
name: "verify that prebuilt dependencies are ignored for visibility reasons (preferred)",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"prebuilts/Blueprints": []byte(`
|
"prebuilts/Android.bp": []byte(`
|
||||||
prebuilt {
|
prebuilt {
|
||||||
name: "module",
|
name: "module",
|
||||||
visibility: ["//top/other"],
|
visibility: ["//top/other"],
|
||||||
prefer: true,
|
prefer: true,
|
||||||
}`),
|
}`),
|
||||||
"top/sources/source_file": nil,
|
"top/sources/source_file": nil,
|
||||||
"top/sources/Blueprints": []byte(`
|
"top/sources/Android.bp": []byte(`
|
||||||
source {
|
source {
|
||||||
name: "module",
|
name: "module",
|
||||||
visibility: ["//top/other"],
|
visibility: ["//top/other"],
|
||||||
}`),
|
}`),
|
||||||
"top/other/source_file": nil,
|
"top/other/source_file": nil,
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
source {
|
source {
|
||||||
name: "other",
|
name: "other",
|
||||||
deps: [":module"],
|
deps: [":module"],
|
||||||
|
@ -1077,7 +1077,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "ensure visibility properties are checked for correctness",
|
name: "ensure visibility properties are checked for correctness",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_parent {
|
mock_parent {
|
||||||
name: "parent",
|
name: "parent",
|
||||||
visibility: ["//top/nested"],
|
visibility: ["//top/nested"],
|
||||||
|
@ -1094,7 +1094,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "invalid visibility added to child detected during gather phase",
|
name: "invalid visibility added to child detected during gather phase",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_parent {
|
mock_parent {
|
||||||
name: "parent",
|
name: "parent",
|
||||||
visibility: ["//top/nested"],
|
visibility: ["//top/nested"],
|
||||||
|
@ -1116,7 +1116,7 @@ var visibilityTests = []struct {
|
||||||
{
|
{
|
||||||
name: "automatic visibility inheritance enabled",
|
name: "automatic visibility inheritance enabled",
|
||||||
fs: MockFS{
|
fs: MockFS{
|
||||||
"top/Blueprints": []byte(`
|
"top/Android.bp": []byte(`
|
||||||
mock_parent {
|
mock_parent {
|
||||||
name: "parent",
|
name: "parent",
|
||||||
visibility: ["//top/nested"],
|
visibility: ["//top/nested"],
|
||||||
|
@ -1125,12 +1125,12 @@ var visibilityTests = []struct {
|
||||||
visibility: ["//top/other"],
|
visibility: ["//top/other"],
|
||||||
},
|
},
|
||||||
}`),
|
}`),
|
||||||
"top/nested/Blueprints": []byte(`
|
"top/nested/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libnested",
|
name: "libnested",
|
||||||
deps: ["libchild"],
|
deps: ["libchild"],
|
||||||
}`),
|
}`),
|
||||||
"top/other/Blueprints": []byte(`
|
"top/other/Android.bp": []byte(`
|
||||||
mock_library {
|
mock_library {
|
||||||
name: "libother",
|
name: "libother",
|
||||||
deps: ["libchild"],
|
deps: ["libchild"],
|
||||||
|
|
|
@ -114,7 +114,7 @@ func processFile(filename string, in io.Reader, out io.Writer, fixRequest bpfix.
|
||||||
|
|
||||||
func makeFileVisitor(fixRequest bpfix.FixRequest) func(string, os.FileInfo, error) error {
|
func makeFileVisitor(fixRequest bpfix.FixRequest) func(string, os.FileInfo, error) error {
|
||||||
return func(path string, f os.FileInfo, err error) error {
|
return func(path string, f os.FileInfo, err error) error {
|
||||||
if err == nil && (f.Name() == "Blueprints" || f.Name() == "Android.bp") {
|
if err == nil && f.Name() == "Android.bp" {
|
||||||
err = openAndProcess(path, os.Stdout, fixRequest)
|
err = openAndProcess(path, os.Stdout, fixRequest)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -127,7 +127,7 @@ func TestDataTests(t *testing.T) {
|
||||||
ctx.RegisterModuleType("test", newTest)
|
ctx.RegisterModuleType("test", newTest)
|
||||||
ctx.Register()
|
ctx.Register()
|
||||||
|
|
||||||
_, errs := ctx.ParseBlueprintsFiles("Blueprints")
|
_, errs := ctx.ParseBlueprintsFiles("Android.bp")
|
||||||
android.FailIfErrored(t, errs)
|
android.FailIfErrored(t, errs)
|
||||||
_, errs = ctx.PrepareBuildActions(config)
|
_, errs = ctx.PrepareBuildActions(config)
|
||||||
android.FailIfErrored(t, errs)
|
android.FailIfErrored(t, errs)
|
||||||
|
|
|
@ -15,15 +15,16 @@
|
||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"android/soong/finder"
|
|
||||||
"android/soong/finder/fs"
|
|
||||||
"android/soong/ui/logger"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"android/soong/finder"
|
||||||
|
"android/soong/finder/fs"
|
||||||
|
"android/soong/ui/logger"
|
||||||
|
|
||||||
"android/soong/ui/metrics"
|
"android/soong/ui/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -72,8 +73,6 @@ func NewSourceFinder(ctx Context, config Config) (f *finder.Finder) {
|
||||||
"AndroidProducts.mk",
|
"AndroidProducts.mk",
|
||||||
// General Soong build definitions, using the Blueprint syntax.
|
// General Soong build definitions, using the Blueprint syntax.
|
||||||
"Android.bp",
|
"Android.bp",
|
||||||
// build/blueprint build definitions, using the Blueprint syntax.
|
|
||||||
"Blueprints",
|
|
||||||
// Bazel build definitions.
|
// Bazel build definitions.
|
||||||
"BUILD.bazel",
|
"BUILD.bazel",
|
||||||
// Bazel build definitions.
|
// Bazel build definitions.
|
||||||
|
@ -165,8 +164,6 @@ func FindSources(ctx Context, config Config, f *finder.Finder) {
|
||||||
|
|
||||||
// Recursively look for all Android.bp files
|
// Recursively look for all Android.bp files
|
||||||
androidBps := f.FindNamedAt(".", "Android.bp")
|
androidBps := f.FindNamedAt(".", "Android.bp")
|
||||||
// The files are named "Blueprints" only in the build/blueprint directory.
|
|
||||||
androidBps = append(androidBps, f.FindNamedAt("build/blueprint", "Blueprints")...)
|
|
||||||
if len(androidBps) == 0 {
|
if len(androidBps) == 0 {
|
||||||
ctx.Fatalf("No Android.bp found")
|
ctx.Fatalf("No Android.bp found")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue