summaryrefslogtreecommitdiffstats
path: root/core/package.mk
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-09-18 17:34:29 -0700
committerDianne Hackborn <hackbod@google.com>2011-09-19 10:42:04 -0700
commit14169bcea813b2f6c5aa6993b7f154d9c03f5b18 (patch)
treed772bac93fcbfebb6046e12cc08b738dc178a386 /core/package.mk
parentabaf3d6bbd4cebb183f61ea41be994f4ed2c3d8c (diff)
downloadbuild-14169bcea813b2f6c5aa6993b7f154d9c03f5b18.zip
build-14169bcea813b2f6c5aa6993b7f154d9c03f5b18.tar.gz
build-14169bcea813b2f6c5aa6993b7f154d9c03f5b18.tar.bz2
New LOCAL_SDK_RES_VERSION config var.
This allows an app to target a different SDK level for its resources than it uses for its Java code. This is useful because it is generally safe to use various newer symbols like attribute names, as older versions of the platform will simply ignore them. Change-Id: Ida19ec9f259c4ea70de846e9a63546e263b1c91e
Diffstat (limited to 'core/package.mk')
-rw-r--r--core/package.mk13
1 files changed, 9 insertions, 4 deletions
diff --git a/core/package.mk b/core/package.mk
index e79059a..9f54bb0 100644
--- a/core/package.mk
+++ b/core/package.mk
@@ -161,6 +161,11 @@ endif
include $(BUILD_SYSTEM)/java.mk
#################################
+LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION))
+ifeq ($(LOCAL_SDK_RES_VERSION),)
+ LOCAL_SDK_RES_VERSION:=$(LOCAL_SDK_VERSION)
+endif
+
full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE)
$(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
@@ -250,12 +255,12 @@ else
# Most packages should link against the resources defined by framework-res.
# Even if they don't have their own resources, they may use framework
# resources.
-ifneq ($(filter-out current,$(LOCAL_SDK_VERSION)),)
+ifneq ($(filter-out current,$(LOCAL_SDK_RES_VERSION)),)
# for released sdk versions, the platform resources were built into android.jar.
framework_res_package_export := \
- $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_VERSION)/android.jar
+ $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar
framework_res_package_export_deps := $(framework_res_package_export)
-else # LOCAL_SDK_VERSION
+else # LOCAL_SDK_RES_VERSION
framework_res_package_export := \
$(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk
# We can't depend directly on the export.apk file; it won't get its
@@ -263,7 +268,7 @@ framework_res_package_export := \
# corresponding R.stamp file, which lists the export.apk as a dependency.
framework_res_package_export_deps := \
$(dir $(framework_res_package_export))src/R.stamp
-endif # LOCAL_SDK_VERSION
+endif # LOCAL_SDK_RES_VERSION
$(R_file_stamp): $(framework_res_package_export_deps)
$(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_AAPT_INCLUDES := $(framework_res_package_export)