OSDN Git Service

Don't add BUILD_NUMBER to version for platform builds
authorDan Willemsen <dwillemsen@google.com>
Wed, 28 Oct 2015 23:45:38 +0000 (16:45 -0700)
committerDan Willemsen <dwillemsen@google.com>
Wed, 28 Oct 2015 23:49:48 +0000 (16:49 -0700)
We're removing differences between two builds that have the same source.
These builds will have different BUILD_NUMBERs though, so it shouldn't
be embedded in the binary.

For eng builds, using the current date forces the APK to be rebuilt
every time the makefiles are read. Remove this for platform builds, but
keep it if building unbundled.

Bug: 24201956
Change-Id: Ib5696a8e5867a6a19b7abdc7d4e5e51037fc4a33

version.mk

index b9926f8..7b38210 100644 (file)
@@ -79,10 +79,12 @@ endif
 version_code_package := $(base_version_major)$(base_version_minor)$(base_version_build)$(base_version_buildtype)$(base_version_arch)$(base_version_density)
 
 # The version name scheme for the package apk is:
+# - For platform builds:     M.m.bbb
 # - For eng build (t=0):     M.m.bbb eng.$(USER)-hh
 # - For build server (t=1):  M.m.bbb (nnnnnn-hh)
 #       where nnnnnn is the build number from the build server (no zero-padding)
 # On eng builds, the BUILD_NUMBER has the user and timestamp inline
+ifdef TARGET_BUILD_APPS
 ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
   git_hash := $(shell git --git-dir $(LOCAL_PATH)/.git log -n 1 --pretty=format:%h)
   date_string := $$(date +%m%d%y_%H%M%S)
@@ -90,6 +92,9 @@ ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
 else
   version_name_package := $(base_version_major).$(base_version_minor).$(base_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).$(base_version_build)
+endif
 
 # Cleanup the locals
 base_version_major :=