From 3d308aa22cee717875943040f6323526d1fe5695 Mon Sep 17 00:00:00 2001 From: Raphael Moll Date: Sat, 1 Oct 2011 23:44:08 -0700 Subject: [PATCH] SDK: generate support library package on build server. Also fix packaging of system image (it had an extra root directory in it, e.g. it was packaging android-4/armeabi-v7a/ instead of just armeabu-v7a/) Change-Id: I0254b2680168d25103222f8871b2af37a7406b58 --- build/tools/mk_sdk_repo_xml.sh | 10 +++++++--- build/tools/sdk_repo.mk | 29 ++++++++++++++++++++++++++++- sdk/support_source.properties | 2 ++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/build/tools/mk_sdk_repo_xml.sh b/build/tools/mk_sdk_repo_xml.sh index e977a03fb..a97ecaf7c 100755 --- a/build/tools/mk_sdk_repo_xml.sh +++ b/build/tools/mk_sdk_repo_xml.sh @@ -6,7 +6,7 @@ set -e PROG_DIR=$(dirname $0) -TYPES="tool platform-tool platform sample doc add-on system-image source" +TYPES="tool platform-tool platform sample doc add-on system-image source support" OSES="linux macosx windows any linux-x86 darwin" TMP_DIR=$(mktemp -d -t sdkrepo.tmp.XXXXXXXX) @@ -156,6 +156,10 @@ while [[ -n "$1" ]]; do [[ -z $TYPE ]] && error "Unknown archive type '$1'." shift + ELEMENT="$TYPE" + # The element name is different for extras: + [[ "$TYPE" == "support" ]] && ELEMENT="extra" + MAP="" FIRST="1" LIBS_XML="" @@ -230,7 +234,7 @@ while [[ -n "$1" ]]; do MAP=$(parse_attributes "$PROPS" ${ATTRS[@]}) # Time to generate the XML for the package - echo " " >> "$OUT" + echo " " >> "$OUT" output_attributes "$OUT" $MAP [[ -n "$LIBS_XML" ]] && echo "$LIBS_XML" >> "$OUT" echo " " >> "$OUT" @@ -259,7 +263,7 @@ EOFA if [[ ! "$OS" ]]; then echo " " >> "$OUT" - echo " " >> "$OUT" + echo " " >> "$OUT" fi done diff --git a/build/tools/sdk_repo.mk b/build/tools/sdk_repo.mk index 549b66b93..de48e57e4 100644 --- a/build/tools/sdk_repo.mk +++ b/build/tools/sdk_repo.mk @@ -56,6 +56,31 @@ SDK_REPO_XML_ARGS += $(3) $(1) \ $(call sdk-repo-pkg-zip,$(1),$(2),$(3)):$(notdir $(call sdk-repo-pkg-zip,$(1),$(2),$(3))) endef +# Defines the rule to build an SDK repository package when the +# package directory contains 3 levels from the sdk dir, for example +# to package SDK/extra/android/support or SDK/system-images/android-N/armeabi. +# Because we do not know the intermediary directory name, this only works +# if each directory contains a single sub-directory (e.g. sdk/$4/*/* must be +# unique.) +# +# $1=OS (e.g. linux-x86, windows, etc) +# $2=sdk zip (e.g. out/host/linux.../android-eng-sdk.zip) +# $3=package to create (e.g. system-images, support, etc.) +# $4=the root of directory to package in the sdk (e.g. extra/android). +# this must be a 2-segment path, the last one can be *. +# +# The rule depends on the SDK zip file, which is defined by $2. +# +define mk-sdk-repo-pkg-3 +$(call sdk-repo-pkg-zip,$(1),$(2),$(3)): $(2) + @echo "Building SDK repository package $(3) from $(notdir $(2))" + $(hide) cd $(basename $(2))/$(4) && \ + zip -9rq ../../../$(notdir $(call sdk-repo-pkg-zip,$(1),$(2),$(3))) * +$(call dist-for-goals, sdk_repo, $(call sdk-repo-pkg-zip,$(1),$(2),$(3))) +SDK_REPO_XML_ARGS += $(3) $(1) \ + $(call sdk-repo-pkg-zip,$(1),$(2),$(3)):$(notdir $(call sdk-repo-pkg-zip,$(1),$(2),$(3))) +endef + # Defines the rule to build an SDK sources package. # # $1=OS (e.g. linux-x86, windows, etc) @@ -99,7 +124,8 @@ $(eval $(call mk-sdk-repo-pkg-1,$(HOST_OS),$(MAIN_SDK_ZIP),platform-tools)) $(eval $(call mk-sdk-repo-pkg-1,$(HOST_OS),$(MAIN_SDK_ZIP),docs)) $(eval $(call mk-sdk-repo-pkg-2,$(HOST_OS),$(MAIN_SDK_ZIP),platforms)) $(eval $(call mk-sdk-repo-pkg-2,$(HOST_OS),$(MAIN_SDK_ZIP),samples)) -$(eval $(call mk-sdk-repo-pkg-2,$(HOST_OS),$(MAIN_SDK_ZIP),system-images)) +$(eval $(call mk-sdk-repo-pkg-3,$(HOST_OS),$(MAIN_SDK_ZIP),system-images,system-images/*)) +$(eval $(call mk-sdk-repo-pkg-3,$(HOST_OS),$(MAIN_SDK_ZIP),support,extras/android)) $(eval $(call mk-sdk-repo-sources,$(HOST_OS),$(MAIN_SDK_ZIP),sources)) SDK_REPO_DEPS += \ @@ -109,6 +135,7 @@ SDK_REPO_DEPS += \ $(call sdk-repo-pkg-zip,$(HOST_OS),$(MAIN_SDK_ZIP),platforms) \ $(call sdk-repo-pkg-zip,$(HOST_OS),$(MAIN_SDK_ZIP),samples) \ $(call sdk-repo-pkg-zip,$(HOST_OS),$(MAIN_SDK_ZIP),system-images) \ + $(call sdk-repo-pkg-zip,$(HOST_OS),$(MAIN_SDK_ZIP),support) \ $(call sdk-repo-pkg-zip,$(HOST_OS),$(MAIN_SDK_ZIP),sources) endif diff --git a/sdk/support_source.properties b/sdk/support_source.properties index cd3a0b099..16d5cd8a0 100644 --- a/sdk/support_source.properties +++ b/sdk/support_source.properties @@ -1,4 +1,6 @@ Pkg.UserSrc=false Pkg.Revision=4 +Extra.Vendor=android +Extra.Path=support Extra.OldPaths=compatibility