From 9685cf992f2c34508c21ad3be3b286fefa082fb0 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Tue, 5 Apr 2022 16:19:34 +0000 Subject: [PATCH 1/3] prerelease variables to be defined before build --- config/common.mk | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/config/common.mk b/config/common.mk index cf328b768..c8f4ad3d7 100644 --- a/config/common.mk +++ b/config/common.mk @@ -255,6 +255,21 @@ DEVICE_PACKAGE_OVERLAYS += vendor/lineage/overlay/common PRODUCT_VERSION_MAJOR = 1 PRODUCT_VERSION_MINOR = 0 PRODUCT_VERSION_MAINTENANCE := 0 +PRODUCT_PRERELEASE_STRING = "" + +ifdef PRODUCT_PRERELEASE + ifdef PRODUCT_PRERELEASE_VERSION + PRODUCT_PRERELEASE_STRING = -$(PRODUCT_PRERELEASE).$(PRODUCT_PRERELEASE_VERSION) + else + PRODUCT_PRERELEASE_STRING = -$(PRODUCT_PRERELEASE) + endif + +endif +ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true) + LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) +else + LINEAGE_VERSION_MAINTENANCE := 0 +endif ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true) LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) @@ -328,30 +343,30 @@ endif ifeq ($(LINEAGE_BUILDTYPE), RELEASE) ifndef TARGET_VENDOR_RELEASE_BUILD_ID - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_PRERELEASE_STRING)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD) else ifeq ($(TARGET_BUILD_VARIANT),user) ifeq ($(LINEAGE_VERSION_MAINTENANCE),0) - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)$(PRODUCT_PRERELEASE_STRING)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD) else - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)$(PRODUCT_PRERELEASE_STRING).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD) endif else - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_PRERELEASE_STRING)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD) endif endif else ifeq ($(LINEAGE_VERSION_MAINTENANCE),0) ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true) - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)$(PRODUCT_PRERELEASE_STRING)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) else - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)$(PRODUCT_PRERELEASE_STRING)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) endif else ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true) - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)$(PRODUCT_PRERELEASE_STRING)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) else - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)$(PRODUCT_PRERELEASE_STRING)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) endif endif endif @@ -378,9 +393,9 @@ ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),build/target/product/security/testkey) TARGET_VENDOR_RELEASE_BUILD_ID := $(TARGET_VENDOR_RELEASE_BUILD_ID) endif ifeq ($(LINEAGE_VERSION_MAINTENANCE),0) - LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID) + LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)$(PRODUCT_PRERELEASE_STRING)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID) else - LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID)-$(LINEAGE_BUILD) + LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)$(PRODUCT_PRERELEASE_STRING)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID)-$(LINEAGE_BUILD) endif endif endif -- GitLab From 2b28b594c2747794099619a67aab9df16e2ef675 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Tue, 5 Apr 2022 16:39:12 +0000 Subject: [PATCH 2/3] always set LINEAGE_VERSION_MAINTENANCE --- config/common.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config/common.mk b/config/common.mk index c8f4ad3d7..191fa65a1 100644 --- a/config/common.mk +++ b/config/common.mk @@ -265,11 +265,8 @@ ifdef PRODUCT_PRERELEASE endif endif -ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true) - LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) -else - LINEAGE_VERSION_MAINTENANCE := 0 -endif + +LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true) LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) -- GitLab From 4b30e29d2eda6bd7789e08da90337a0a4b1796f7 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Tue, 5 Apr 2022 16:42:25 +0000 Subject: [PATCH 3/3] mistake --- config/common.mk | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/common.mk b/config/common.mk index 191fa65a1..30cbfccf1 100644 --- a/config/common.mk +++ b/config/common.mk @@ -268,11 +268,6 @@ endif LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) -ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true) - LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) -else - LINEAGE_VERSION_MAINTENANCE := 0 -endif # Set LINEAGE_BUILDTYPE from the env RELEASE_TYPE, for jenkins compat -- GitLab