From d4a3a137eda38963583c289de074aa2249e6f417 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 17 Mar 2021 20:21:35 +0900 Subject: "current" is implicitly added to stubs.versions So far, when a library `libfoo` has `stubs.versions: ["10", "11"]`, then `shared_libs: ["libfoo"]` is linked to the version 11 of the stub. This requires the author of `libfoo` to manually update the property whenever a new version is introduced. Otherwise, clients are not able to use the newly added APIs because the latest stub is for an old version. This change eliminates the need for manual updating. "current" version is always implicitly added to `stubs.versions`. It is added even when nothing is set on the property, if `stubs.symbol_file` is set. i.e. ``` cc_library { name: "libfoo", stubs: { symbol_file: "libfoo.map.txt", // no versions: [...] needed }, } cc_library { name: "a_client", shared_libs: ["libfoo"], apex_available: ["myapex"], min_sdk_version: "29", } apex { name: "myapex", native_shared_libraries: ["a_client"], min_sdk_version: "29", } ``` `a_client` links to the "current" stub of `libfoo` that has all symbols shown in the map file. Note that, above doesn't mean that the client has unlimited access to APIs that are introduced even after the min_sdk_version of the client (29 in this example). The use of such APIs still has to be guarded with `__builtin_available` check. Bug: N/A Test: m Change-Id: I70bb1600c18e74d36c6b24c3569d2149f02aaf96 --- sdk/cc_sdk_test.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sdk/cc_sdk_test.go') diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index a2539c9a0..9db816df8 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -2397,6 +2397,7 @@ cc_prebuilt_library_shared { "1", "2", "3", + "current", ], }, arch: { @@ -2451,6 +2452,7 @@ cc_prebuilt_library_shared { "1", "2", "3", + "current", ], }, target: { @@ -2490,6 +2492,7 @@ cc_prebuilt_library_shared { "1", "2", "3", + "current", ], }, target: { -- cgit v1.2.3-59-g8ed1b