From 3c5dcb8d135d6e58fcbd006701d6ab1746ca6757 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Mon, 22 Sep 2014 23:44:01 +0800 Subject: build-android: some changes on TARGET_OUT_DIR 1. make it possible to use value of TARGET_OUT_DIR set on android-build if we set the TARGET_OUT_DIR variant value via the settings from android-build, then use that set value. Since the value of PRODUCT_OUT is defined by TARGET_DEVICE, and the value of TARGET_DEVICE is defined by PRODUCT_DEVICE. and some of PRODUCT_DEVICEs are defined with the generic_ prefix. like for aosp_arm64 product, the PRODUCT_DEVICE is generic_arm64. it's not right to just remove string before _ in this case. 2. specified TARGET_OUT_DIR explicitly when caculate the md5sum of .img, .tar.bz2 files since when build the 64bit version with AOSP master, there are other directories (like external/ frameworks/ system/) are generated under out/target/product/, so if we use command like "cd out/target/product/*/", there will be errors. Change-Id: Ia4cbfc1807491fe4e1e798d6c8e1fadb55ea39eb Signed-off-by: Yongqin Liu --- build-scripts/build-android | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build-scripts') diff --git a/build-scripts/build-android b/build-scripts/build-android index fc5aad2..0f5b991 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -24,8 +24,11 @@ source "${BUILD_SCRIPT_ROOT}"/helpers trap infrastructure_error ERR -# Set TARGET_OUT_DIR since few TARGET_PRODUCT include "full_" keyword as well -export TARGET_OUT_DIR=`echo $TARGET_PRODUCT | sed 's/_/\n/;s/.*\n//'` +if [ -z "${TARGET_OUT_DIR}" ]; then + # only set TARGET_OUT_DIR when it is not set + # Set TARGET_OUT_DIR since few TARGET_PRODUCT include "full_" keyword as well + export TARGET_OUT_DIR=`echo $TARGET_PRODUCT | sed 's/_/\n/;s/.*\n//'` +fi if [ -n "$BUILD_COPYCAT" ]; then @@ -188,7 +191,7 @@ elif [ -f "out/target/product/$TARGET_OUT_DIR/obj/kernel/.config" ]; then cp "out/target/product/$TARGET_OUT_DIR/obj/kernel/.config" out/kernel_config fi # Create md5sums file for platform artifacts -(cd out/target/product/*/; md5sum *.tar.bz2 *.img >MD5SUMS) || true +(cd out/target/product/${TARGET_OUT_DIR}/; md5sum *.tar.bz2 *.img >MD5SUMS) || true (cd out/; ${BUILD_SCRIPT_ROOT}/create-user-build-script) if [ -f out/kernel_config ]; then -- cgit v1.2.3