Merge "Add min_sdk_version to java_import."

This commit is contained in:
Jaewoong Jung
2021-04-01 19:45:53 +00:00
committed by Gerrit Code Review
3 changed files with 122 additions and 56 deletions

View File

@@ -1836,6 +1836,30 @@ func TestApexMinSdkVersion_ErrorIfIncompatibleVersion(t *testing.T) {
min_sdk_version: "30",
}
`)
testApexError(t, `module "libfoo".*: should support min_sdk_version\(29\)`, `
apex {
name: "myapex",
key: "myapex.key",
java_libs: ["libfoo"],
min_sdk_version: "29",
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
java_import {
name: "libfoo",
jars: ["libfoo.jar"],
apex_available: [
"myapex",
],
min_sdk_version: "30",
}
`)
}
func TestApexMinSdkVersion_Okay(t *testing.T) {
@@ -1873,7 +1897,10 @@ func TestApexMinSdkVersion_Okay(t *testing.T) {
name: "libbar",
sdk_version: "current",
srcs: ["a.java"],
static_libs: ["libbar_dep"],
static_libs: [
"libbar_dep",
"libbar_import_dep",
],
apex_available: ["myapex"],
min_sdk_version: "29",
}
@@ -1885,6 +1912,13 @@ func TestApexMinSdkVersion_Okay(t *testing.T) {
apex_available: ["myapex"],
min_sdk_version: "29",
}
java_import {
name: "libbar_import_dep",
jars: ["libbar.jar"],
apex_available: ["myapex"],
min_sdk_version: "29",
}
`)
}