Merge "Use BUILD_NUMBER_FROM_FILE instead of BUILD_NUMBER in Make."
This commit is contained in:
commit
d3bec931cd
4 changed files with 35 additions and 22 deletions
|
@ -4,15 +4,6 @@
|
||||||
# intermedites-dir-for
|
# intermedites-dir-for
|
||||||
LOCAL_PATH := $(BUILD_SYSTEM)
|
LOCAL_PATH := $(BUILD_SYSTEM)
|
||||||
|
|
||||||
# Pick a reasonable string to use to identify files.
|
|
||||||
ifneq (,$(filter eng.%,$(BUILD_NUMBER)))
|
|
||||||
# BUILD_NUMBER has a timestamp in it, which means that
|
|
||||||
# it will change every time. Pick a stable value.
|
|
||||||
FILE_NAME_TAG := eng.$(USER)
|
|
||||||
else
|
|
||||||
FILE_NAME_TAG := $(BUILD_NUMBER)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# Define rules to copy PRODUCT_COPY_FILES defined by the product.
|
# Define rules to copy PRODUCT_COPY_FILES defined by the product.
|
||||||
# PRODUCT_COPY_FILES contains words like <source file>:<dest file>[:<owner>].
|
# PRODUCT_COPY_FILES contains words like <source file>:<dest file>[:<owner>].
|
||||||
|
@ -238,28 +229,37 @@ $(intermediate_system_build_prop): PRIVATE_BUILD_DESC := $(build_desc)
|
||||||
|
|
||||||
# The string used to uniquely identify the combined build and product; used by the OTA server.
|
# The string used to uniquely identify the combined build and product; used by the OTA server.
|
||||||
ifeq (,$(strip $(BUILD_FINGERPRINT)))
|
ifeq (,$(strip $(BUILD_FINGERPRINT)))
|
||||||
ifneq ($(filter eng.%,$(BUILD_NUMBER)),)
|
ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
|
||||||
BF_BUILD_NUMBER := $(USER)$(shell $(DATE) +%m%d%H%M)
|
BF_BUILD_NUMBER := $(USER)$$($(DATE_FROM_FILE) +%m%d%H%M)
|
||||||
else
|
else
|
||||||
BF_BUILD_NUMBER := $(BUILD_NUMBER)
|
BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
|
||||||
endif
|
endif
|
||||||
BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
|
BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
|
||||||
endif
|
endif
|
||||||
ifneq ($(words $(BUILD_FINGERPRINT)),1)
|
# unset it for safety.
|
||||||
$(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
|
BF_BUILD_NUMBER :=
|
||||||
endif
|
|
||||||
|
|
||||||
$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) > $(PRODUCT_OUT)/build_fingerprint.txt)
|
BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt
|
||||||
BUILD_FINGERPRINT_FROM_FILE := $$(cat $(PRODUCT_OUT)/build_fingerprint.txt)
|
ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE)))
|
||||||
|
$(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))")
|
||||||
|
endif
|
||||||
|
BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE))
|
||||||
|
# unset it for safety.
|
||||||
|
BUILD_FINGERPRINT :=
|
||||||
|
|
||||||
# The string used to uniquely identify the system build; used by the OTA server.
|
# The string used to uniquely identify the system build; used by the OTA server.
|
||||||
# This purposefully excludes any product-specific variables.
|
# This purposefully excludes any product-specific variables.
|
||||||
ifeq (,$(strip $(BUILD_THUMBPRINT)))
|
ifeq (,$(strip $(BUILD_THUMBPRINT)))
|
||||||
BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
|
BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
|
||||||
endif
|
endif
|
||||||
ifneq ($(words $(BUILD_THUMBPRINT)),1)
|
|
||||||
$(error BUILD_THUMBPRINT cannot contain spaces: "$(BUILD_THUMBPRINT)")
|
BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt
|
||||||
|
ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE)))
|
||||||
|
$(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))")
|
||||||
endif
|
endif
|
||||||
|
BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE))
|
||||||
|
# unset it for safety.
|
||||||
|
BUILD_THUMBPRINT :=
|
||||||
|
|
||||||
KNOWN_OEM_THUMBPRINT_PROPERTIES := \
|
KNOWN_OEM_THUMBPRINT_PROPERTIES := \
|
||||||
ro.product.brand \
|
ro.product.brand \
|
||||||
|
@ -347,7 +347,7 @@ endif
|
||||||
PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
|
PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
|
||||||
BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
|
BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
|
||||||
BUILD_FINGERPRINT="$(BUILD_FINGERPRINT_FROM_FILE)" \
|
BUILD_FINGERPRINT="$(BUILD_FINGERPRINT_FROM_FILE)" \
|
||||||
$(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT)") \
|
$(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \
|
||||||
TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
|
TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
|
||||||
TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \
|
TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \
|
||||||
TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
|
TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
|
||||||
|
|
11
core/main.mk
11
core/main.mk
|
@ -61,12 +61,23 @@ include $(BUILD_SYSTEM)/clang/config.mk
|
||||||
# when using ninja.
|
# when using ninja.
|
||||||
$(shell mkdir -p $(OUT_DIR) && \
|
$(shell mkdir -p $(OUT_DIR) && \
|
||||||
echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt)
|
echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt)
|
||||||
|
BUILD_NUMBER_FILE := $(OUT_DIR)/build_number.txt
|
||||||
|
|
||||||
ifeq ($(HOST_OS),darwin)
|
ifeq ($(HOST_OS),darwin)
|
||||||
DATE_FROM_FILE := date -r $(BUILD_DATETIME_FROM_FILE)
|
DATE_FROM_FILE := date -r $(BUILD_DATETIME_FROM_FILE)
|
||||||
else
|
else
|
||||||
DATE_FROM_FILE := date -d @$(BUILD_DATETIME_FROM_FILE)
|
DATE_FROM_FILE := date -d @$(BUILD_DATETIME_FROM_FILE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Pick a reasonable string to use to identify files.
|
||||||
|
ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
|
||||||
|
# BUILD_NUMBER has a timestamp in it, which means that
|
||||||
|
# it will change every time. Pick a stable value.
|
||||||
|
FILE_NAME_TAG := eng.$(USER)
|
||||||
|
else
|
||||||
|
FILE_NAME_TAG := $(file <$(BUILD_NUMBER_FILE))
|
||||||
|
endif
|
||||||
|
|
||||||
# Make an empty directory, which can be used to make empty jars
|
# Make an empty directory, which can be used to make empty jars
|
||||||
EMPTY_DIRECTORY := $(OUT_DIR)/empty
|
EMPTY_DIRECTORY := $(OUT_DIR)/empty
|
||||||
$(shell mkdir -p $(EMPTY_DIRECTORY) && rm -rf $(EMPTY_DIRECTORY)/*)
|
$(shell mkdir -p $(EMPTY_DIRECTORY) && rm -rf $(EMPTY_DIRECTORY)/*)
|
||||||
|
|
|
@ -151,7 +151,7 @@ $(my_built_custom_image): $(INTERNAL_USERIMAGES_DEPS) $(my_built_modules) $(my_i
|
||||||
cat $(PRIVATE_DICT_FILE) >> $(PRIVATE_INTERMEDIATES)/image_info.txt)
|
cat $(PRIVATE_DICT_FILE) >> $(PRIVATE_INTERMEDIATES)/image_info.txt)
|
||||||
# Generate the image.
|
# Generate the image.
|
||||||
$(if $(filter oem,$(PRIVATE_MOUNT_POINT)), \
|
$(if $(filter oem,$(PRIVATE_MOUNT_POINT)), \
|
||||||
$(hide) echo "oem.buildnumber=$(BUILD_NUMBER)" >> $(PRIVATE_STAGING_DIR)/oem.prop)
|
$(hide) echo "oem.buildnumber=$(BUILD_NUMBER_FROM_FILE)" >> $(PRIVATE_STAGING_DIR)/oem.prop)
|
||||||
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
|
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
|
||||||
build/make/tools/releasetools/build_image.py \
|
build/make/tools/releasetools/build_image.py \
|
||||||
$(PRIVATE_STAGING_DIR) $(PRIVATE_INTERMEDIATES)/image_info.txt $@ $(TARGET_OUT)
|
$(PRIVATE_STAGING_DIR) $(PRIVATE_INTERMEDIATES)/image_info.txt $@ $(TARGET_OUT)
|
||||||
|
|
|
@ -271,6 +271,7 @@ endif
|
||||||
# to soong_ui.
|
# to soong_ui.
|
||||||
BUILD_DATETIME :=
|
BUILD_DATETIME :=
|
||||||
|
|
||||||
|
HAS_BUILD_NUMBER := true
|
||||||
ifndef BUILD_NUMBER
|
ifndef BUILD_NUMBER
|
||||||
# BUILD_NUMBER should be set to the source control value that
|
# BUILD_NUMBER should be set to the source control value that
|
||||||
# represents the current state of the source code. E.g., a
|
# represents the current state of the source code. E.g., a
|
||||||
|
@ -282,4 +283,5 @@ ifndef BUILD_NUMBER
|
||||||
# from this date/time" value. Make it start with a non-digit so that
|
# from this date/time" value. Make it start with a non-digit so that
|
||||||
# anyone trying to parse it as an integer will probably get "0".
|
# anyone trying to parse it as an integer will probably get "0".
|
||||||
BUILD_NUMBER := eng.$(shell echo $${USER:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S)
|
BUILD_NUMBER := eng.$(shell echo $${USER:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S)
|
||||||
|
HAS_BUILD_NUMBER := false
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue