aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNan Zhang <nanzhang@google.com>2018-02-20 13:29:14 -0800
committerNan Zhang <nanzhang@google.com>2018-02-21 10:34:35 -0800
commit9d03eaf85ca79a871f59311168a5b1cba6725198 (patch)
tree75941dc3ef31d75c11020199a2102100cb4cb0e6
parent5373a82117e42ab1e27c94714d436a04900a8c8b (diff)
downloadTV-9d03eaf85ca79a871f59311168a5b1cba6725198.tar.gz
And use BUILD_NUMBER_FROM_FILE instead of BUILD_NUMBER to reduce build reruns. Test: m -j32 Bug: b/70351683 Change-Id: If5eb8891920ddd0486e263dd996f21efd36677c0
-rw-r--r--version.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/version.mk b/version.mk
index 6886dc07..b76c39ed 100644
--- a/version.mk
+++ b/version.mk
@@ -58,7 +58,7 @@ code_version_build := 007
#####################################################
#####################################################
# Collect automatic version code parameters
-ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
+ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
# This is an eng build
base_version_buildtype := 0
else
@@ -94,12 +94,12 @@ version_code_package := $(code_version_major)$(base_version_minor)$(code_version
# and hh is the git hash
# On eng builds, the BUILD_NUMBER has the user and timestamp inline
ifdef TARGET_BUILD_APPS
-ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
+ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
git_hash := $(shell git --git-dir $(LOCAL_PATH)/.git log -n 1 --pretty=format:%h)
date_string := $(shell date +%Y-%m-%d)
version_name_package := $(base_version_major).$(base_version_minor).$(code_version_build) (eng.$(USER).$(git_hash).$(date_string)-$(base_version_arch)$(base_version_density))
else
- version_name_package := $(base_version_major).$(base_version_minor).$(code_version_build) ($(BUILD_NUMBER)-$(base_version_arch)$(base_version_density))
+ version_name_package := $(base_version_major).$(base_version_minor).$(code_version_build) ($(BUILD_NUMBER_FROM_FILE)-$(base_version_arch)$(base_version_density))
endif
else # !TARGET_BUILD_APPS
version_name_package := $(base_version_major).$(base_version_minor).$(code_version_build)