Use PlatformVndkVersion to find ABI dump by default
This commit changes "current" to ctx.DeviceConfig.PlatformVndkVersion().
This change make it possible to place ABI dumps in
prebuilts/abi-dumps/vndk/${version} instead of
prebuilts/abi-dumps/vndk/current.
If BOARD_VNDK_VERSION is not specified or is equal to "current",
PLATFORM_VNDK_VERSION (either PLATFORM_SDK_VERSION or
PLATFORM_VERSION_CODENAME) will be chosen. Currently,
BOARD_VNDK_VERSION is always equal to "current" because both system and
vendor images are built in a single source tree.
In the future, if the system image and vendor images are separately
built in different source trees, BOARD_VNDK_VERSION will be set to other
values and we should respect that value.
Test: Create an ABI dump under
prebuilts/abi-dumps/vndk/${PLATFORM_VNDK_VERSION}, make some ABI
breakages, and see whether the checks are working.
Bug: 76036094
Change-Id: I6242e0c71ebd9acd5c4a3497c67539cb3e6663f3
diff --git a/cc/library.go b/cc/library.go
index 6fe9ca4..bac566f 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -642,8 +642,8 @@
func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objects, fileName string, soFile android.Path) {
//Also take into account object re-use.
if len(objs.sAbiDumpFiles) > 0 && ctx.createVndkSourceAbiDump() {
- vndkVersion := "current"
- if ver := ctx.DeviceConfig().VndkVersion(); ver != "" {
+ vndkVersion := ctx.DeviceConfig().PlatformVndkVersion()
+ if ver := ctx.DeviceConfig().VndkVersion(); ver != "" && ver != "current" {
vndkVersion = ver
}