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
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
This commit is contained in:
LuK1337 2023-06-25 19:48:38 +09:00 committed by fazilsheik96
parent 3e7497f25a
commit 43d2a1b26f
2 changed files with 22 additions and 0 deletions

View File

@ -154,3 +154,23 @@ uses_miui_camera {
},
},
}
soong_config_module_type {
name: "aapt_version_code",
module_type: "java_defaults",
config_namespace: "aospaGlobalVars",
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",
],
},
},
}

View File

@ -17,6 +17,7 @@ $(foreach v,$(EXPORT_TO_SOONG),$(eval $(call addVar,$(v))))
SOONG_CONFIG_NAMESPACES += aospaGlobalVars
SOONG_CONFIG_aospaGlobalVars += \
aapt_version_code \
needs_camera_boottime \
powershare_node \
target_init_vendor_lib \
@ -32,6 +33,7 @@ TARGET_INIT_VENDOR_LIB ?= vendor_init
TARGET_SURFACEFLINGER_UDFPS_LIB ?= surfaceflinger_udfps_lib
# Soong value variables
SOONG_CONFIG_aospaGlobalVars_aapt_version_code := $(shell date -u +%Y%m%d)
SOONG_CONFIG_aospaGlobalVars_needs_camera_boottime := $(TARGET_CAMERA_BOOTTIME_TIMESTAMP)
SOONG_CONFIG_aospaGlobalVars_powershare_node := $(TARGET_POWERSHARE_NODE)
SOONG_CONFIG_aospaGlobalVars_target_init_vendor_lib := $(TARGET_INIT_VENDOR_LIB)