version: Keep the maintenance version defined and use it if needed

* The maintenance version should not be set optionally
    to its official value status, but only be used when needed

 * Use the TARGET_VENDOR_SHOW_MAINTENANCE_VERSION := true
    introduced in I77c924a13122c8e1d9af14501e46bc532f7aefbd
    to show the value of the maintenance version in releases,
    with an intermediary CM_VERSION_MAINTENANCE variable

Change-Id: I22b944a1d2d8586e5f3c75e19ca1c53aa3b22b59
This commit is contained in:
Adrian DC 2016-08-06 21:47:23 +02:00
parent ec6c945852
commit 3e85bf7907
No known key found for this signature in database
GPG Key ID: BA556FC0A244809E

View File

@ -244,11 +244,12 @@ DEVICE_PACKAGE_OVERLAYS += vendor/cm/overlay/common
PRODUCT_VERSION_MAJOR = 13 PRODUCT_VERSION_MAJOR = 13
PRODUCT_VERSION_MINOR = 0 PRODUCT_VERSION_MINOR = 0
PRODUCT_VERSION_MAINTENANCE := 1
ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true) ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true)
PRODUCT_VERSION_MAINTENANCE := 1 CM_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE)
else else
# 0 is ignored CM_VERSION_MAINTENANCE := 0
PRODUCT_VERSION_MAINTENANCE := 0
endif endif
# Set CM_BUILDTYPE from the env RELEASE_TYPE, for jenkins compat # Set CM_BUILDTYPE from the env RELEASE_TYPE, for jenkins compat
@ -304,20 +305,20 @@ ifeq ($(CM_BUILDTYPE), RELEASE)
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD) CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
else else
ifeq ($(TARGET_BUILD_VARIANT),user) ifeq ($(TARGET_BUILD_VARIANT),user)
ifeq ($(PRODUCT_VERSION_MAINTENANCE),0) ifeq ($(CM_VERSION_MAINTENANCE),0)
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD) CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD)
else else
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD) CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(CM_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD)
endif endif
else else
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD) CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
endif endif
endif endif
else else
ifeq ($(PRODUCT_VERSION_MAINTENANCE),0) ifeq ($(CM_VERSION_MAINTENANCE),0)
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD) CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD)
else else
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD) CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(CM_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD)
endif endif
endif endif
@ -345,10 +346,10 @@ ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),build/target/product/security/testkey)
else else
TARGET_VENDOR_RELEASE_BUILD_ID := $(TARGET_VENDOR_RELEASE_BUILD_ID) TARGET_VENDOR_RELEASE_BUILD_ID := $(TARGET_VENDOR_RELEASE_BUILD_ID)
endif endif
ifeq ($(PRODUCT_VERSION_MAINTENANCE),0) ifeq ($(CM_VERSION_MAINTENANCE),0)
CM_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD) CM_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD)
else else
CM_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD) CM_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(CM_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(CM_BUILD)
endif endif
endif endif
endif endif