summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2017-03-08 05:08:49 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-08 05:08:49 +0000
commit7efd8833303167ae36dd564b664a062bc18a1a1b (patch)
treef3325234a3afa319156f676221a6c00616bd8bc6
parent1085738fdd10142d0cfac2c8d5a332dc490d7f91 (diff)
parent17c7b6045a6ebe55d9b75823a8fe3ec0d45ffa51 (diff)
downloadextras-7efd8833303167ae36dd564b664a062bc18a1a1b.tar.gz
Merge "Separate system_version and product_version." am: b7b92040c2
am: 17c7b6045a Change-Id: I7ea71a0659015d41d8744e2baab339926b98eecb
-rw-r--r--brillo_config/Android.mk45
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