Merge "Enforce hidden apis usage in product(soong)"
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user