SDK: source.properties templates.

This adds support for "templates" source.properties files that can
inherit the platform version/codename/api level from the build.

The purpose is for a given build to always generate SDK files that
match the platform generated in the same branch.

Change-Id: Id623bbef45a04d953da8eade7e8c34c77709f9c3
This commit is contained in:
Raphael
2011-11-15 16:30:14 -08:00
parent 0efad946bd
commit d79eab5a39
19 changed files with 66 additions and 44 deletions

View File

@@ -1,3 +1,27 @@
# ===== SDK source.property files =====
# Add all files to be generated from the source.prop templates to the SDK pre-requisites
ALL_SDK_FILES += $(patsubst \
$(TOPDIR)development/sdk/%_source.prop_template, \
$(HOST_OUT)/development/sdk/%_source.properties, \
$(wildcard $(TOPDIR)development/sdk/*_source.prop_template))
# Rule to convert a source.prop template into the desired source.property
# Rewritten variables:
# - ${PLATFORM_VERSION} e.g. "1.0"
# - ${PLATFORM_SDK_VERSION} e.g. "3", aka the API level
# - ${PLATFORM_VERSION_CODENAME} e.g. "REL" (transformed into "") or "Cupcake"
$(HOST_OUT)/development/sdk/%_source.properties : $(TOPDIR)development/sdk/%_source.prop_template
@echo Generate $@
$(hide) mkdir -p $(dir $@)
$(hide) sed -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \
-e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \
-e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \
$< > $@
# ===== Android Support/Compatibility Library =====
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
# The source files for this library are _all_ generated, something we don't do # The source files for this library are _all_ generated, something we don't do

View File

@@ -18,4 +18,4 @@
prebuilt/android-${TARGET_ARCH}/kernel/kernel-qemu-armv7 system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu prebuilt/android-${TARGET_ARCH}/kernel/kernel-qemu-armv7 system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
# version files for the SDK updater, from development.git # version files for the SDK updater, from development.git
development/sdk/images_armeabi-v7a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties ${HOST_OUT}/development/sdk/images_armeabi-v7a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties

View File

@@ -17,4 +17,4 @@
prebuilt/android-${TARGET_ARCH}/kernel/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu prebuilt/android-${TARGET_ARCH}/kernel/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
# version files for the SDK updater, from development.git # version files for the SDK updater, from development.git
development/sdk/images_armeabi_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties ${HOST_OUT}/development/sdk/images_armeabi_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties

View File

@@ -17,4 +17,4 @@
prebuilt/android-${TARGET_ARCH}/kernel/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu prebuilt/android-${TARGET_ARCH}/kernel/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
# version files for the SDK updater, from development.git # version files for the SDK updater, from development.git
development/sdk/images_x86_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties ${HOST_OUT}/development/sdk/images_x86_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties

View File

@@ -61,7 +61,7 @@ external/clang/LICENSE.TXT platform-tools/renderscript/clang-
############################################################################## ##############################################################################
# version files for the SDK updater, from development.git # version files for the SDK updater, from development.git
development/sdk/platform_source.properties platforms/${PLATFORM_NAME}/source.properties ${HOST_OUT}/development/sdk/platform_source.properties platforms/${PLATFORM_NAME}/source.properties
# copy build prop from out/.../sdk/ # copy build prop from out/.../sdk/
sdk/sdk-build.prop platforms/${PLATFORM_NAME}/build.prop sdk/sdk-build.prop platforms/${PLATFORM_NAME}/build.prop
@@ -132,7 +132,7 @@ system/build.prop system-images/${PLATFORM_NAME}/${TARG
############################################################################## ##############################################################################
# version files for the SDK updater, from sdk.git # version files for the SDK updater, from sdk.git
development/sdk/doc_source.properties docs/source.properties ${HOST_OUT}/development/sdk/doc_source.properties docs/source.properties
# the docs # the docs
docs/offline-sdk docs docs/offline-sdk docs

View File

@@ -88,10 +88,10 @@ endef
# $3=package to create, must be "sources" # $3=package to create, must be "sources"
# #
define mk-sdk-repo-sources define mk-sdk-repo-sources
$(call sdk-repo-pkg-zip,$(1),$(2),$(3)): $(2) $(TOPDIR)development/sdk/source_source.properties $(call sdk-repo-pkg-zip,$(1),$(2),$(3)): $(2) $(HOST_OUT)/development/sdk/source_source.properties
@echo "Building SDK sources package" @echo "Building SDK sources package"
$(hide) $(TOPDIR)development/build/tools/mk_sources_zip.py \ $(hide) $(TOPDIR)development/build/tools/mk_sources_zip.py \
$(TOPDIR)development/sdk/source_source.properties \ $(HOST_OUT)/development/sdk/source_source.properties \
$(call sdk-repo-pkg-zip,$(1),$(2),$(3)) \ $(call sdk-repo-pkg-zip,$(1),$(2),$(3)) \
$(TOPDIR). $(TOPDIR).
$(call dist-for-goals, sdk_repo, $(call sdk-repo-pkg-zip,$(1),$(2),$(3))) $(call dist-for-goals, sdk_repo, $(call sdk-repo-pkg-zip,$(1),$(2),$(3)))

View File

@@ -0,0 +1,4 @@
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}

View File

@@ -1,5 +0,0 @@
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=15
#AndroidVersion.CodeName=

View File

@@ -0,0 +1,6 @@
Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
SystemImage.Abi=armeabi-v7a

View File

@@ -1,6 +0,0 @@
Pkg.Desc=Android SDK Platform 4.1
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=15
#AndroidVersion.CodeName=
SystemImage.Abi=armeabi-v7a

View File

@@ -0,0 +1,6 @@
Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
SystemImage.Abi=armeabi

View File

@@ -1,6 +0,0 @@
Pkg.Desc=Android SDK Platform 4.1
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=15
#AndroidVersion.CodeName=
SystemImage.Abi=armeabi

View File

@@ -0,0 +1,6 @@
Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
SystemImage.Abi=x86

View File

@@ -1,6 +0,0 @@
Pkg.Desc=Android SDK Platform 4.1
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=15
#AndroidVersion.CodeName=
SystemImage.Abi=x86

View File

@@ -0,0 +1,9 @@
Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
Pkg.UserSrc=false
Platform.Version=${PLATFORM_VERSION}
Pkg.Revision=1
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
Layoutlib.Api=7
Layoutlib.Revision=1
Platform.MinToolsRev=15

View File

@@ -1,9 +0,0 @@
Pkg.Desc=Android SDK Platform 4.1
Pkg.UserSrc=false
Platform.Version=4.1
Pkg.Revision=1
AndroidVersion.ApiLevel=15
#AndroidVersion.CodeName=
Layoutlib.Api=7
Layoutlib.Revision=1
Platform.MinToolsRev=15

View File

@@ -0,0 +1,4 @@
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}

View File

@@ -1,4 +0,0 @@
Pkg.UserSrc=false
Pkg.Revision=1
AndroidVersion.ApiLevel=15
#AndroidVersion.CodeName=

View File

@@ -3,4 +3,3 @@ Pkg.Revision=4
Extra.Vendor=android Extra.Vendor=android
Extra.Path=support Extra.Path=support
Extra.OldPaths=compatibility Extra.OldPaths=compatibility