version_defaults.mk revision 09591102d0ee841119be3744698c86b4a0a7d1f3
1#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17#
18# Handle various build version information.
19#
20# Guarantees that the following are defined:
21#     PLATFORM_VERSION
22#     PLATFORM_SDK_VERSION
23#     BUILD_ID
24#     BUILD_NUMBER
25#
26
27# Look for an optional file containing overrides of the defaults,
28# but don't cry if we don't find it.  We could just use -include, but
29# the build.prop target also wants INTERNAL_BUILD_ID_MAKEFILE to be set
30# if the file exists.
31#
32INTERNAL_BUILD_ID_MAKEFILE := $(wildcard $(BUILD_SYSTEM)/build_id.mk)
33ifneq "" "$(INTERNAL_BUILD_ID_MAKEFILE)"
34  include $(INTERNAL_BUILD_ID_MAKEFILE)
35endif
36
37ifeq "" "$(PLATFORM_VERSION)"
38  # This is the canonical definition of the platform version,
39  # which is the version that we reveal to the end user.
40  # Update this value when the platform version changes (rather
41  # than overriding it somewhere else).  Can be an arbitrary string.
42  PLATFORM_VERSION := 1.5
43endif
44
45ifeq "" "$(PLATFORM_SDK_VERSION)"
46  # This is the canonical definition of the SDK version, which defines
47  # the set of APIs and functionality available in the platform.  This is
48  # a single integer, that increases monotonically as updates to the SDK
49  # are released.
50  PLATFORM_SDK_VERSION := 3
51endif
52
53ifeq "" "$(BUILD_ID)"
54  # Used to signify special builds.  E.g., branches and/or releases,
55  # like "M5-RC7".  Can be an arbitrary string, but must be a single
56  # word and a valid file name.
57  #
58  # If there is no BUILD_ID set, make it obvious.
59  BUILD_ID := UNKNOWN
60endif
61
62ifeq "" "$(BUILD_NUMBER)"
63  # BUILD_NUMBER should be set to the source control value that
64  # represents the current state of the source code.  E.g., a
65  # perforce changelist number or a git hash.  Can be an arbitrary string
66  # (to allow for source control that uses something other than numbers),
67  # but must be a single word and a valid file name.
68  #
69  # If no BUILD_NUMBER is set, create a useful "I am an engineering build
70  # from this date/time" value.  Make it start with a non-digit so that
71  # anyone trying to parse it as an integer will probably get "0".
72  BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S)
73endif
74
75