2 # Copyright (C) 2013 Google Inc.
5 # The version code scheme for the package apk is:
8 # M - major version (one or more digits)
9 # m - minor version (exactly 1 digit)
10 # bbb - manually specified build number (exactly 3 digits)
11 # t - build type (exactly 1 digit). Current valid values are:
13 # 1 : build server build
14 # a - device architecture (exactly 1 digit). Current valid values are:
20 # d - asset density (exactly 1 digit). Current valid values are:
25 # Mmbbb is specified manually. tad is automatically set during the build.
27 # For the client jar, the version code is agnostic to the target architecture and density: Mmbbbt00
29 # NOTE: arch needs to be more significant than density because x86 devices support running ARM
30 # code in emulation mode, so all x86 versions must be higher than all ARM versions to ensure
31 # we deliver true x86 code to those devices.
34 # 2.0.001 - Factory ROM and 0-day OTA 4.4 (KK)
35 # 2.0.002 - 4.4 MR1 system image
37 # Specify the following manually. Note that base_version_minor must be exactly 1 digit and
38 # base_version_build must be exactly 3 digits.
39 base_version_major := 2
40 base_version_minor := 0
41 base_version_build := 002
43 #####################################################
44 #####################################################
45 # Collect automatic version code parameters
46 ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
47 # This is an eng build
48 base_version_buildtype := 0
50 # This is a build server build
51 base_version_buildtype := 1
54 ifeq "$(TARGET_ARCH)" "x86"
55 base_version_arch := 7
56 else ifeq "$(TARGET_ARCH)" "mips"
57 base_version_arch := 5
58 else ifeq "$(TARGET_ARCH)" "arm"
59 ifeq ($(TARGET_ARCH_VARIANT),armv5te)
60 base_version_arch := 1
62 base_version_arch := 3
65 base_version_arch := 0
68 ifeq "$(package_dpi)" "mdpi"
69 base_version_density := 2
70 else ifeq "$(package_dpi)" "hdpi"
71 base_version_density := 4
72 else ifeq "$(package_dpi)" "xhdpi"
73 base_version_density := 6
75 base_version_density := 0
78 # Build the version code
79 version_code_package := $(base_version_major)$(base_version_minor)$(base_version_build)$(base_version_buildtype)$(base_version_arch)$(base_version_density)
81 # The version name scheme for the package apk is:
82 # - For eng build (t=0): M.m.bbb eng.$(USER)-hh
83 # - For build server (t=1): M.m.bbb (nnnnnn-hh)
84 # where nnnnnn is the build number from the build server (no zero-padding)
85 # On eng builds, the BUILD_NUMBER has the user and timestamp inline
86 ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
87 git_hash := $(shell git --git-dir $(LOCAL_PATH)/.git log -n 1 --pretty=format:%h)
88 date_string := $(shell date +%m%d%y_%H%M%S)
89 version_name_package := $(base_version_major).$(base_version_minor).$(base_version_build) (eng.$(USER).$(git_hash).$(date_string)-$(base_version_arch)$(base_version_density))
91 version_name_package := $(base_version_major).$(base_version_minor).$(base_version_build) ($(BUILD_NUMBER)-$(base_version_arch)$(base_version_density))
98 base_version_buildtype :=
100 base_version_density :=