Refactor versioning
* Replace the 1-to-1 variable-to-buildtype stuff with a single environment variable. CM_[TYPE]=true becomes CM_BUILDTYPE=[TYPE] * Change the placement of the extra version tag: 10.2-21234567-TYPE-model-TAG becomes 10.2-21234567-TYPE-TAG-model, for consistency with the rest. The last component of the version should always be the model. * Add support for the SNAPSHOT build type, for use with the monthlies * Unknown types will still fallback to UNOFFICIAL * Accept the jenkins RELEASE_TYPE variable as an alternative to CM_BUILDTYPE for compatibility with older branches Change-Id: Idf96c7ca887747a5ae49a17cf5adf642fb1d561f
This commit is contained in:
parent
989a313c54
commit
554f3703e5
@ -218,25 +218,41 @@ PRODUCT_VERSION_MAJOR = 10
|
|||||||
PRODUCT_VERSION_MINOR = 2
|
PRODUCT_VERSION_MINOR = 2
|
||||||
PRODUCT_VERSION_MAINTENANCE = 0-RC0
|
PRODUCT_VERSION_MAINTENANCE = 0-RC0
|
||||||
|
|
||||||
# Set CM_BUILDTYPE
|
# Set CM_BUILDTYPE from the env RELEASE_TYPE, for jenkins compat
|
||||||
ifdef CM_NIGHTLY
|
|
||||||
CM_BUILDTYPE := NIGHTLY
|
ifndef CM_BUILDTYPE
|
||||||
|
ifdef RELEASE_TYPE
|
||||||
|
# Starting with "CM_" is optional
|
||||||
|
RELEASE_TYPE := $(shell echo $(RELEASE_TYPE) | sed -e 's|^CM_||g')
|
||||||
|
CM_BUILDTYPE := $(RELEASE_TYPE)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef CM_EXPERIMENTAL
|
|
||||||
CM_BUILDTYPE := EXPERIMENTAL
|
# Filter out random types, so it'll reset to UNOFFICIAL
|
||||||
endif
|
ifeq ($(filter RELEASE NIGHTLY SNAPSHOT EXPERIMENTAL,$(CM_BUILDTYPE)),)
|
||||||
ifdef CM_RELEASE
|
CM_BUILDTYPE :=
|
||||||
CM_BUILDTYPE := RELEASE
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CM_BUILDTYPE
|
ifdef CM_BUILDTYPE
|
||||||
ifdef CM_EXTRAVERSION
|
ifneq ($(CM_BUILDTYPE), SNAPSHOT)
|
||||||
# Force build type to EXPERIMENTAL
|
ifdef CM_EXTRAVERSION
|
||||||
CM_BUILDTYPE := EXPERIMENTAL
|
# Force build type to EXPERIMENTAL
|
||||||
# Remove leading dash from CM_EXTRAVERSION
|
CM_BUILDTYPE := EXPERIMENTAL
|
||||||
CM_EXTRAVERSION := $(shell echo $(CM_EXTRAVERSION) | sed 's/-//')
|
# Remove leading dash from CM_EXTRAVERSION
|
||||||
# Add leading dash to CM_EXTRAVERSION
|
CM_EXTRAVERSION := $(shell echo $(CM_EXTRAVERSION) | sed 's/-//')
|
||||||
CM_EXTRAVERSION := -$(CM_EXTRAVERSION)
|
# Add leading dash to CM_EXTRAVERSION
|
||||||
|
CM_EXTRAVERSION := -$(CM_EXTRAVERSION)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifndef CM_EXTRAVERSION
|
||||||
|
# Force build type to EXPERIMENTAL, SNAPSHOT mandates a tag
|
||||||
|
CM_BUILDTYPE := EXPERIMENTAL
|
||||||
|
else
|
||||||
|
# Remove leading dash from CM_EXTRAVERSION
|
||||||
|
CM_EXTRAVERSION := $(shell echo $(CM_EXTRAVERSION) | sed 's/-//')
|
||||||
|
# Add leading dash to CM_EXTRAVERSION
|
||||||
|
CM_EXTRAVERSION := -$(CM_EXTRAVERSION)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
# If CM_BUILDTYPE is not defined, set to UNOFFICIAL
|
# If CM_BUILDTYPE is not defined, set to UNOFFICIAL
|
||||||
@ -244,13 +260,13 @@ else
|
|||||||
CM_EXTRAVERSION :=
|
CM_EXTRAVERSION :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CM_RELEASE
|
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 ($(PRODUCT_VERSION_MINOR),0)
|
ifeq ($(PRODUCT_VERSION_MINOR),0)
|
||||||
CM_VERSION := $(PRODUCT_VERSION_MAJOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)-$(CM_BUILD)$(CM_EXTRAVERSION)
|
CM_VERSION := $(PRODUCT_VERSION_MAJOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD)
|
||||||
else
|
else
|
||||||
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)-$(CM_BUILD)$(CM_EXTRAVERSION)
|
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user