Add sdk_version:"none" to replace no_standard_libs:true

Where possible this duplicates any tests that use no_standard_libs:true
with ones that use sdk_version:"none". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"none" to ensure that there is no regression in the
behavior of no_standard_libs:true.

Follow up changes will switch all usages of no_standard_libs:true over
to use sdk_version:"none" at which point no_standard_libs will be
removed.

Bug: 134566750
Test: m droid
Change-Id: I5f0fd3daa980f6b223abe454cba7f25a97a39d7a
This commit is contained in:
Paul Duffin
2019-06-11 12:31:14 +01:00
parent 250e6198d4
commit 52d398a841
8 changed files with 96 additions and 15 deletions

View File

@@ -178,6 +178,37 @@ var neverallowTests = []struct {
}`),
},
},
{
name: "sdk_version: \"none\" inside core libraries",
fs: map[string][]byte{
"libcore/Blueprints": []byte(`
java_library {
name: "inside_core_libraries",
sdk_version: "none",
}`),
},
},
{
name: "sdk_version: \"none\" outside core libraries",
fs: map[string][]byte{
"Blueprints": []byte(`
java_library {
name: "outside_core_libraries",
sdk_version: "none",
}`),
},
expectedError: "module \"outside_core_libraries\": violates neverallow",
},
{
name: "sdk_version: \"current\"",
fs: map[string][]byte{
"Blueprints": []byte(`
java_library {
name: "outside_core_libraries",
sdk_version: "current",
}`),
},
},
// java_library_host rule tests
{
name: "java_library_host with no_standard_libs: true",
@@ -266,6 +297,7 @@ func (p *mockCcLibraryModule) GenerateAndroidBuildActions(ModuleContext) {
type mockJavaLibraryProperties struct {
Libs []string
No_standard_libs *bool
Sdk_version *string
}
type mockJavaLibraryModule struct {