Use new aapt feature to add default version info to .apks.
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 902afed..ca8487f 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -20,6 +20,8 @@
# Guarantees that the following are defined:
# PLATFORM_VERSION
# PLATFORM_SDK_VERSION
+# PLATFORM_VERSION_CODENAME
+# DEFAULT_APP_TARGET_SDK
# BUILD_ID
# BUILD_NUMBER
#
@@ -55,11 +57,24 @@
endif
ifeq "" "$(PLATFORM_VERSION_CODENAME)"
- # This is the current development code-name, if the build is not a final
- # release build. If this is a final release build, it is simply "REL".
+ # If the build is not a final release build, then this is the current
+ # development code-name. If this is a final release build, it is simply "REL".
PLATFORM_VERSION_CODENAME := Donut
endif
+ifeq "" "$(DEFAULT_APP_TARGET_SDK)"
+ # This is the default minSdkVersion and targetSdkVersion to use for
+ # all .apks created by the build system. It can be overridden by explicitly
+ # setting these in the .apk's AndroidManifest.xml. It is either the code
+ # name of the development build or, if this is a release build, the official
+ # SDK version of this release.
+ ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
+ DEFAULT_APP_TARGET_SDK := $(PLATFORM_SDK_VERSION)
+ else
+ DEFAULT_APP_TARGET_SDK := $(PLATFORM_VERSION_CODENAME)
+ endif
+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