Merge "Enforce hidden apis usage in product(soong)"

This commit is contained in:
Treehugger Robot
2019-11-11 02:05:16 +00:00
committed by Gerrit Code Review
8 changed files with 98 additions and 31 deletions

View File

@@ -666,6 +666,44 @@ func TestJNIABI(t *testing.T) {
}
}
func TestAppSdkVersionByPartition(t *testing.T) {
testJavaError(t, "sdk_version must have a value when the module is located at vendor or product", `
android_app {
name: "foo",
srcs: ["a.java"],
vendor: true,
platform_apis: true,
}
`)
testJava(t, `
android_app {
name: "bar",
srcs: ["b.java"],
platform_apis: true,
}
`)
for _, enforce := range []bool{true, false} {
config := testConfig(nil)
config.TestProductVariables.EnforceProductPartitionInterface = proptools.BoolPtr(enforce)
bp := `
android_app {
name: "foo",
srcs: ["a.java"],
product_specific: true,
platform_apis: true,
}
`
if enforce {
testJavaErrorWithConfig(t, "sdk_version must have a value when the module is located at vendor or product", bp, config)
} else {
testJavaWithConfig(t, bp, config)
}
}
}
func TestJNIPackaging(t *testing.T) {
ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
cc_library {