summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2023-02-24 18:38:56 +0000
committer Spandan Das <spandandas@google.com> 2023-02-27 20:03:25 +0000
commit7fa982c0ecd1af67b1d83e8bc932e398efc22d21 (patch)
treea797fb79e2e154c3af39383824486b0b9b10aae9 /apex/apex_test.go
parent50885c052497ad4ef1691bfe21895455107a3336 (diff)
Update usages of min_sdk_version that relies on (kind+level)
The type of min_sdk_version is being migrated from android.SdkSpec(kind+level) to android.ApiLevel(level). This affects `ShouldSupportSdkVersion` for java modules. This function skips the check for modules compiling against `core`, and that requires access to SdkVersion and not MinSdkVersion after the migration. Skip the check explicitly using SdkVersion. Test: go test ./java Test: No change in ninja file Bug: 208456999 Change-Id: I14eca4f8e8c5d7477ded00c4fe54097323fab4a2
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index faf82b32c..f66c5f8c1 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -2128,6 +2128,34 @@ func TestApexMinSdkVersion_ErrorIfIncompatibleVersion(t *testing.T) {
min_sdk_version: "30",
}
`)
+
+ // Skip check for modules compiling against core API surface
+ testApex(t, `
+ 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_library {
+ name: "libfoo",
+ srcs: ["Foo.java"],
+ apex_available: [
+ "myapex",
+ ],
+ // Compile against core API surface
+ sdk_version: "core_current",
+ min_sdk_version: "30",
+ }
+ `)
+
}
func TestApexMinSdkVersion_Okay(t *testing.T) {