diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:28:42 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:28:42 -0800 |
commit | 88b607994a148f4af5bffee163e39ce8296750c6 (patch) | |
tree | fa249ff843e976cf034f2029437d3362a8396321 /core/version_defaults.mk | |
parent | 05806d7af62e07c6225b2e7103a1b115ecf6c9ad (diff) | |
download | build-88b607994a148f4af5bffee163e39ce8296750c6.tar.gz build-88b607994a148f4af5bffee163e39ce8296750c6.tar.bz2 build-88b607994a148f4af5bffee163e39ce8296750c6.zip |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'core/version_defaults.mk')
-rw-r--r-- | core/version_defaults.mk | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/core/version_defaults.mk b/core/version_defaults.mk new file mode 100644 index 000000000..e38a80366 --- /dev/null +++ b/core/version_defaults.mk @@ -0,0 +1,84 @@ +# +# Copyright (C) 2008 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# Handle various build version information. +# +# Guarantees that the following are defined: +# PLATFORM_VERSION +# PLATFORM_SDK_VERSION +# BUILD_ID +# BUILD_NUMBER +# + +# Look for an optional file containing overrides of the defaults, +# but don't cry if we don't find it. We could just use -include, but +# the build.prop target also wants INTERNAL_BUILD_ID_MAKEFILE to be set +# if the file exists. +# +INTERNAL_BUILD_ID_MAKEFILE := $(wildcard $(BUILD_SYSTEM)/build_id.mk) +ifneq "" "$(INTERNAL_BUILD_ID_MAKEFILE)" + include $(INTERNAL_BUILD_ID_MAKEFILE) +endif + +ifeq "" "$(PLATFORM_VERSION)" + # This is the canonical definition of the platform version, + # which is the version that we reveal to the end user. + # Update this value when the platform version changes (rather + # than overriding it somewhere else). Can be an arbitrary string. + PLATFORM_VERSION := 1.5 +endif + +ifeq "" "$(PLATFORM_SDK_VERSION)" + # This is the canonical definition of the SDK version, which defines + # the set of APIs and functionality available in the platform. This is + # a single integer, that increases monotonically as updates to the SDK + # are released. + PLATFORM_SDK_VERSION := 3 +endif + +ifeq "" "$(BUILD_ID)" + # Used to signify special builds. E.g., branches and/or releases, + # like "M5-RC7". Can be an arbitrary string, but must be a single + # word and a valid file name. + # + # If there is no BUILD_ID set, make it obvious. + BUILD_ID := UNKNOWN +endif + +ifeq "" "$(BUILD_NUMBER)" + # BUILD_NUMBER should be set to the source control value that + # represents the current state of the source code. E.g., a + # perforce changelist number or a git hash. Can be an arbitrary string + # (to allow for source control that uses something other than numbers), + # but must be a single word and a valid file name. + # + # If no BUILD_NUMBER is set, create a useful "I am an engineering build + # 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". + BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S) +endif + +ifeq "true" "$(DISPLAY_BUILD_NUMBER)" + # if the build_id.mk has this defined, then BUILD_ID is updated with + # the BUILD_NUMBER as well. For development branches, this will be + # set, but release branches this will not be set. + BUILD_DISPLAY_ID := "$(BUILD_ID).$(BUILD_NUMBER)" +else + BUILD_DISPLAY_ID := "$(BUILD_ID)" +endif + + |