diff options
author | Sen Jiang <senj@google.com> | 2017-03-08 05:11:19 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-08 05:11:19 +0000 |
commit | 2083957eb18220a9f96e5d3ec9ca1af7b754b148 (patch) | |
tree | 732e3d239993954fb489c54c66272ae518b67a65 | |
parent | 38b869312fd471ba7e9147a9307c6acfad6575c2 (diff) | |
parent | 7efd8833303167ae36dd564b664a062bc18a1a1b (diff) | |
download | extras-2083957eb18220a9f96e5d3ec9ca1af7b754b148.tar.gz |
Merge "Separate system_version and product_version." am: b7b92040c2 am: 17c7b6045a
am: 7efd883330
Change-Id: I69ec2cc2e601db942b830f56c8c33851c0337916
-rw-r--r-- | brillo_config/Android.mk | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/brillo_config/Android.mk b/brillo_config/Android.mk index b4d8c932..7c1dd6c2 100644 --- a/brillo_config/Android.mk +++ b/brillo_config/Android.mk @@ -43,20 +43,49 @@ LOCAL_MODULE_CLASS := FAKE LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY) include $(BUILD_SYSTEM)/base_rules.mk -# The version is set to 0.0.0 if the user did not set the actual version and +# The version is set to 0 if the user did not set the actual version and # a version cannot be loaded from the product cfgtree. # This allows us to have a valid version number while being easy to filter. ifeq ($(BRILLO_PRODUCT_VERSION),) # Load from file first BRILLO_PRODUCT_VERSION := $(call cfgtree-get-if-exists,brillo/product_version) endif -# If the version is still empty, override it with 0.0.0 +# If the version is still empty, override it with 0 ifeq ($(BRILLO_PRODUCT_VERSION),) -BRILLO_PRODUCT_VERSION := "0.0.0" +BRILLO_PRODUCT_VERSION := "0" endif -ifeq ($(shell echo $(BRILLO_PRODUCT_VERSION) | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$$'),) +ifeq ($(shell echo $(BRILLO_PRODUCT_VERSION) | grep -E '^[0-9]+$$'),) $(error Invalid BRILLO_PRODUCT_VERSION "$(BRILLO_PRODUCT_VERSION)", must be \ - three numbers separated by dots. Example: "1.2.0") + a single number. Example: "1") +endif + +$(LOCAL_BUILT_MODULE): + $(hide) mkdir -p $(dir $@) + echo $(BRILLO_PRODUCT_VERSION) > $@ + $(hide) mkdir -p $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY) + ln -sf /oem/$(OSRELEASED_DIRECTORY)/product_version $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY) + + +include $(CLEAR_VARS) +LOCAL_MODULE := system_version +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY) +include $(BUILD_SYSTEM)/base_rules.mk + +# The version is set to 0.0 if the user did not set the actual version and +# a version cannot be loaded from the product cfgtree. +# This allows us to have a valid version number while being easy to filter. +ifeq ($(BRILLO_SYSTEM_VERSION),) +# Load from file first +BRILLO_SYSTEM_VERSION := $(call cfgtree-get-if-exists,brillo/system_version) +endif +# If the version is still empty, override it with 0.0 +ifeq ($(BRILLO_SYSTEM_VERSION),) +BRILLO_SYSTEM_VERSION := "0.0" +endif +ifeq ($(shell echo $(BRILLO_SYSTEM_VERSION) | grep -E '^[0-9]+\.[0-9]+$$'),) +$(error Invalid BRILLO_SYSTEM_VERSION "$(BRILLO_SYSTEM_VERSION)", must be \ + two numbers separated by dots. Example: "1.2") endif # Append BUILD_NUMBER if it is a number or a build timestamp otherwise. @@ -67,11 +96,9 @@ endif $(LOCAL_BUILT_MODULE): $(hide) mkdir -p $(dir $@) ifeq ($(shell echo $(BUILD_NUMBER) | grep -E '[^0-9]'),) - echo $(BRILLO_PRODUCT_VERSION).$(BUILD_NUMBER) > $@ + echo $(BRILLO_SYSTEM_VERSION).$(BUILD_NUMBER) > $@ else - echo $(BRILLO_PRODUCT_VERSION).$(BUILD_DATETIME) > $@ + echo $(BRILLO_SYSTEM_VERSION).$(BUILD_DATETIME) > $@ endif - $(hide) mkdir -p $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY) - ln -sf /oem/$(OSRELEASED_DIRECTORY)/product_version $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY) endif |