From 0b81f4020eb14ff88060debfa6f9ea906916c9a2 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 14 Jun 2023 21:52:43 +0200 Subject: [PATCH] soong: Add `aapt_version_code` default This appends `--version_code=$(date -u +%Y%m%d)` to aapt flags, which is useful for flushing some caches upon system updates. Change-Id: I6575b878f09c1c3138e12abc34d39405f51245e7 --- build/soong/Android.bp | 20 ++++++++++++++++++++ config/BoardConfigSoong.mk | 2 ++ 2 files changed, 22 insertions(+) diff --git a/build/soong/Android.bp b/build/soong/Android.bp index 72f7b8b6..01e9cc3a 100644 --- a/build/soong/Android.bp +++ b/build/soong/Android.bp @@ -51,6 +51,26 @@ cc_library_headers { } // Target platform agnostic config modules +soong_config_module_type { + name: "aapt_version_code", + module_type: "java_defaults", + config_namespace: "lineageGlobalVars", + value_variables: ["aapt_version_code"], + properties: ["aaptflags"], +} + +aapt_version_code { + name: "aapt_version_code_defaults", + soong_config_variables: { + aapt_version_code: { + aaptflags: [ + "--version-code", + "%s", + ], + }, + }, +} + soong_config_module_type { name: "gralloc_10_usage_bits", module_type: "cc_defaults", diff --git a/config/BoardConfigSoong.mk b/config/BoardConfigSoong.mk index c849c979..8061220b 100644 --- a/config/BoardConfigSoong.mk +++ b/config/BoardConfigSoong.mk @@ -28,6 +28,7 @@ $(foreach v,$(EXPORT_TO_SOONG),$(eval $(call addVar,$(v)))) SOONG_CONFIG_NAMESPACES += lineageGlobalVars SOONG_CONFIG_lineageGlobalVars += \ + aapt_version_code \ additional_gralloc_10_usage_bits \ bootloader_message_offset \ gralloc_handle_has_reserved_size \ @@ -84,6 +85,7 @@ TARGET_TRUST_USB_CONTROL_ENABLE ?= 1 TARGET_TRUST_USB_CONTROL_DISABLE ?= 0 # Soong value variables +SOONG_CONFIG_lineageGlobalVars_aapt_version_code := $(shell date -u +%Y%m%d) SOONG_CONFIG_lineageGlobalVars_additional_gralloc_10_usage_bits := $(TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS) SOONG_CONFIG_lineageGlobalVars_bootloader_message_offset := $(BOOTLOADER_MESSAGE_OFFSET) SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_charging_path := $(TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH)