From 26bcf6a51141fa9dec7df8b932835ccd7b1ab182 Mon Sep 17 00:00:00 2001 From: Raphael Moll Date: Tue, 3 Jun 2014 10:44:56 -0700 Subject: [PATCH] Move SDK system-image source.prop_templates in their own folder. This allows to have a different rule to generate the source.properties based on the templates and place them in a directory that depends on the current target CPU ABI. In turn this prevents the build from mixing different source.props when building different targets. Change-Id: I4a1d9f47426c94f376947ddae8be9f5549331616 --- build/Android.mk | 20 +++++++++++++++++-- build/sdk-android-arm64-v8a.atree | 2 +- build/sdk-android-armeabi-v7a.atree | 2 +- build/sdk-android-armeabi.atree | 2 +- build/sdk-android-mips.atree | 2 +- build/sdk-android-x86.atree | 2 +- build/sdk-android-x86_64.atree | 2 +- build/tools/sdk_repo.mk | 6 +++--- .../images_arm64-v8a_source.prop_template | 0 .../images_armeabi-v7a_source.prop_template | 0 .../images_armeabi_source.prop_template | 0 .../images_mips_source.prop_template | 0 .../images_x86_64_source.prop_template | 0 .../images_x86_source.prop_template | 0 14 files changed, 27 insertions(+), 11 deletions(-) rename {sdk => sys-img}/images_arm64-v8a_source.prop_template (100%) rename {sdk => sys-img}/images_armeabi-v7a_source.prop_template (100%) rename {sdk => sys-img}/images_armeabi_source.prop_template (100%) rename {sdk => sys-img}/images_mips_source.prop_template (100%) rename {sdk => sys-img}/images_x86_64_source.prop_template (100%) rename {sdk => sys-img}/images_x86_source.prop_template (100%) diff --git a/build/Android.mk b/build/Android.mk index f20a76ef8..4c2e7c13d 100644 --- a/build/Android.mk +++ b/build/Android.mk @@ -8,14 +8,21 @@ ALL_SDK_FILES += $(patsubst \ $(patsubst \ $(TOPDIR)development/samples/%_source.prop_template, \ $(HOST_OUT)/development/samples/%_source.properties, \ - $(wildcard $(TOPDIR)development/samples/*_source.prop_template)) + $(wildcard $(TOPDIR)development/samples/*_source.prop_template)) \ + $(patsubst \ + $(TOPDIR)development/sys-img/%_source.prop_template, \ + $(HOST_OUT)/development/sys-img-$(TARGET_CPU_ABI)/%_source.properties, \ + $(wildcard $(TOPDIR)development/sys-img/*_source.prop_template)) # Rule to convert a source.prop template into the desired source.property +# This needs to vary based on the CPU ABI for the system-image files. # 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 +# - ${TARGET_ARCH} e.g. "arm", "x86", "mips" and their 64-bit variants. +# - ${TARGET_CPU_ABI} e.g. "armeabi", "x86", "mips" and their 64-bit variants. +$(HOST_OUT)/development/sys-img-$(TARGET_CPU_ABI)/%_source.properties : $(TOPDIR)development/sys-img/%_source.prop_template @echo Generate $@ $(hide) mkdir -p $(dir $@) $(hide) sed \ @@ -26,6 +33,15 @@ $(HOST_OUT)/development/sdk/%_source.properties : $(TOPDIR)development/sdk/%_sou -e 's/$${TARGET_CPU_ABI}/$(TARGET_CPU_ABI)/' \ $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@ +$(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))/' \ + $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@ + $(HOST_OUT)/development/samples/%_source.properties : $(TOPDIR)development/samples/%_source.prop_template @echo Generate $@ $(hide) mkdir -p $(dir $@) diff --git a/build/sdk-android-arm64-v8a.atree b/build/sdk-android-arm64-v8a.atree index aefbe9e41..0103b89c8 100644 --- a/build/sdk-android-arm64-v8a.atree +++ b/build/sdk-android-arm64-v8a.atree @@ -19,4 +19,4 @@ prebuilts/qemu-kernel/arm/kernel-qemu-armv7 system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu # version files for the SDK updater, from development.git -${HOST_OUT}/development/sdk/images_arm64-v8a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties +${HOST_OUT}/development/sys-img-${TARGET_CPU_ABI}/images_arm64-v8a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties diff --git a/build/sdk-android-armeabi-v7a.atree b/build/sdk-android-armeabi-v7a.atree index 603f1465a..97dceda2d 100644 --- a/build/sdk-android-armeabi-v7a.atree +++ b/build/sdk-android-armeabi-v7a.atree @@ -18,4 +18,4 @@ prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu-armv7 system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu # version files for the SDK updater, from development.git -${HOST_OUT}/development/sdk/images_armeabi-v7a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties +${HOST_OUT}/development/sys-img-${TARGET_CPU_ABI}/images_armeabi-v7a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties diff --git a/build/sdk-android-armeabi.atree b/build/sdk-android-armeabi.atree index f641ee309..af0d02950 100644 --- a/build/sdk-android-armeabi.atree +++ b/build/sdk-android-armeabi.atree @@ -17,4 +17,4 @@ prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu # version files for the SDK updater, from development.git -${HOST_OUT}/development/sdk/images_armeabi_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties +${HOST_OUT}/development/sys-img-${TARGET_CPU_ABI}/images_armeabi_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties diff --git a/build/sdk-android-mips.atree b/build/sdk-android-mips.atree index 5e8e5ca5f..7ec630979 100644 --- a/build/sdk-android-mips.atree +++ b/build/sdk-android-mips.atree @@ -18,4 +18,4 @@ prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu # version files for the SDK updater, from development.git -development/sdk/images_mips_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties +development/sys-img-${TARGET_CPU_ABI}/images_mips_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties diff --git a/build/sdk-android-x86.atree b/build/sdk-android-x86.atree index 1eaf479c0..f8f6aab9c 100644 --- a/build/sdk-android-x86.atree +++ b/build/sdk-android-x86.atree @@ -17,4 +17,4 @@ prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu # version files for the SDK updater, from development.git -${HOST_OUT}/development/sdk/images_${TARGET_ARCH}_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties +${HOST_OUT}/development/sys-img-${TARGET_CPU_ABI}/images_${TARGET_ARCH}_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties diff --git a/build/sdk-android-x86_64.atree b/build/sdk-android-x86_64.atree index bbe4bd69a..2c953e625 100644 --- a/build/sdk-android-x86_64.atree +++ b/build/sdk-android-x86_64.atree @@ -17,4 +17,4 @@ prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu # version files for the SDK updater, from development.git -${HOST_OUT}/development/sdk/images_${TARGET_ARCH}_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties +${HOST_OUT}/development/sys-img-${TARGET_CPU_ABI}/images_${TARGET_ARCH}_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties diff --git a/build/tools/sdk_repo.mk b/build/tools/sdk_repo.mk index 6de011768..8d13d7073 100644 --- a/build/tools/sdk_repo.mk +++ b/build/tools/sdk_repo.mk @@ -208,9 +208,9 @@ endif # ----------------------------------------------------------------- # Rules for the SDK Repository XML -SDK_REPO_XML := $(HOST_OUT)/sdk/repository.xml -SDK_EXTRAS_XML := $(HOST_OUT)/sdk/repo-extras.xml -SDK_SYSIMG_XML := $(HOST_OUT)/sdk/repo-sys-img.xml +SDK_REPO_XML := $(MAIN_SDK_DIR)/repository.xml +SDK_EXTRAS_XML := $(MAIN_SDK_DIR)/repo-extras.xml +SDK_SYSIMG_XML := $(MAIN_SDK_DIR)/repo-sys-img.xml ifneq ($(SDK_REPO_XML_ARGS),) diff --git a/sdk/images_arm64-v8a_source.prop_template b/sys-img/images_arm64-v8a_source.prop_template similarity index 100% rename from sdk/images_arm64-v8a_source.prop_template rename to sys-img/images_arm64-v8a_source.prop_template diff --git a/sdk/images_armeabi-v7a_source.prop_template b/sys-img/images_armeabi-v7a_source.prop_template similarity index 100% rename from sdk/images_armeabi-v7a_source.prop_template rename to sys-img/images_armeabi-v7a_source.prop_template diff --git a/sdk/images_armeabi_source.prop_template b/sys-img/images_armeabi_source.prop_template similarity index 100% rename from sdk/images_armeabi_source.prop_template rename to sys-img/images_armeabi_source.prop_template diff --git a/sdk/images_mips_source.prop_template b/sys-img/images_mips_source.prop_template similarity index 100% rename from sdk/images_mips_source.prop_template rename to sys-img/images_mips_source.prop_template diff --git a/sdk/images_x86_64_source.prop_template b/sys-img/images_x86_64_source.prop_template similarity index 100% rename from sdk/images_x86_64_source.prop_template rename to sys-img/images_x86_64_source.prop_template diff --git a/sdk/images_x86_source.prop_template b/sys-img/images_x86_source.prop_template similarity index 100% rename from sdk/images_x86_source.prop_template rename to sys-img/images_x86_source.prop_template