SDK: fix win-sdk build errors, make future errors fatal.

Firs this fixes a cp/rm errors that were logged when building the Windows SDK.
There errors happens because the secondary sdk/tools/patch_windows_sdk.sh
was run twice.

Next the shell script is changed to make any error fatal and actually
break the build, like it should.

In the makefile, merge Ying's fix to correctly pass showcommands.

Change-Id: Iee75e42b0b0bbba3c26858c82c933660dc6d74ae
This commit is contained in:
Raphael
2011-02-01 12:48:48 -08:00
parent 0e2de35b07
commit 7a508aed2a
2 changed files with 15 additions and 15 deletions

View File

@@ -5,7 +5,8 @@
# - development/tools/build/path_windows_sdk.sh to process the # - development/tools/build/path_windows_sdk.sh to process the
# platform-dependent folders and files. # platform-dependent folders and files.
# - sdk/build/patch_windows_sdk.sh to process folder and files which # - sdk/build/patch_windows_sdk.sh to process folder and files which
# depend on the sdk.git repo. This file will be invoked by this one. # depend on the sdk.git repo. This file is invoked by the makefile
# at development/tools/build/windows_sdk.mk.
# #
# Input arguments: # Input arguments:
# -q = Optional arg to make this silent. Must be given first. # -q = Optional arg to make this silent. Must be given first.
@@ -16,13 +17,17 @@
# $3 = An optional replacement for $TOPDIR (inherited from the Android # $3 = An optional replacement for $TOPDIR (inherited from the Android
# build system), which is the top directory where Android is located. # build system), which is the top directory where Android is located.
set -e # any error stops the build
# Verbose by default. Use -q to make more silent. # Verbose by default. Use -q to make more silent.
V="-v" V=""
Q="" Q=""
if [[ "$1" == "-q" ]]; then if [[ "$1" == "-q" ]]; then
Q="$1" Q="$1"
V=""
shift shift
else
echo "Win SDK: $0 $*"
set -x # show bash commands; no need for V=-v
fi fi
TEMP_SDK_DIR=$1 TEMP_SDK_DIR=$1
@@ -30,17 +35,16 @@ WIN_OUT_DIR=$2
TOPDIR=${TOPDIR:-$3} TOPDIR=${TOPDIR:-$3}
# The unix2dos is provided by the APT package "tofrodos". However # The unix2dos is provided by the APT package "tofrodos". However
# as of ubuntu lucid, the package renamed the command to "todos". # as for ubuntu lucid, the package renamed the command to "todos".
UNIX2DOS=`which unix2dos` UNIX2DOS=$(which unix2dos || true)
if [[ ! -x $UNIX2DOS ]]; then if [[ ! -x $UNIX2DOS ]]; then
UNIX2DOS=`which todos` UNIX2DOS=$(which todos || true)
fi fi
PLATFORMS=( $TEMP_SDK_DIR/platforms/* ) PLATFORMS=( $TEMP_SDK_DIR/platforms/* )
if [[ ${#PLATFORMS[@]} != 1 ]]; then if [[ ${#PLATFORMS[@]} != 1 ]]; then
echo "Error: Too many platforms found in $TEMP_SDK_DIR" echo "Error: Too many platforms found in $TEMP_SDK_DIR"
echo "Only one was expected." echo "Expected one. Instead, found: ${PLATFORMS[@]}"
echo "Instead, found: ${PLATFORMS[@]}"
exit 1 exit 1
fi fi
@@ -54,7 +58,6 @@ TOOLS=$TEMP_SDK_DIR/tools
PLATFORM_TOOLS=$TEMP_SDK_DIR/platform-tools PLATFORM_TOOLS=$TEMP_SDK_DIR/platform-tools
LIB=$TEMP_SDK_DIR/tools/lib LIB=$TEMP_SDK_DIR/tools/lib
rm $V $TOOLS/{dmtracedump,etc1tool,hprof-conv,sqlite3,zipalign} rm $V $TOOLS/{dmtracedump,etc1tool,hprof-conv,sqlite3,zipalign}
rm $V $TOOLS/proguard/bin/*.sh
rm $V $LIB/*/swt.jar rm $V $LIB/*/swt.jar
rm $V $PLATFORM_TOOLS/{adb,aapt,aidl,dx,dexdump,llvm-rs-cc} rm $V $PLATFORM_TOOLS/{adb,aapt,aidl,dx,dexdump,llvm-rs-cc}
@@ -107,11 +110,8 @@ if [[ -x $UNIX2DOS ]]; then
find $TEMP_SDK_DIR -maxdepth 3 -name "*.bat" -type f -print0 | xargs -0 $UNIX2DOS find $TEMP_SDK_DIR -maxdepth 3 -name "*.bat" -type f -print0 | xargs -0 $UNIX2DOS
fi fi
# Execute the packaging script in the sdk directory # Just to make it easier on the build servers, we want fastboot and adb
${TOPDIR}sdk/build/patch_windows_sdk.sh $Q ${TEMP_SDK_DIR} ${WIN_OUT_DIR} ${TOPDIR} # (and its DLLs) next to the new SDK.
# Just to make it easier on the build servers, we want fastboot and adb (and its DLLs)
# next to the new SDK, so up one dir.
for i in fastboot.exe adb.exe AdbWinApi.dll AdbWinUsbApi.dll; do for i in fastboot.exe adb.exe AdbWinApi.dll AdbWinUsbApi.dll; do
cp -f $V $WIN_OUT_DIR/host/windows-x86/bin/$i $TEMP_SDK_DIR/../$i cp -f $V $WIN_OUT_DIR/host/windows-x86/bin/$i $TEMP_SDK_DIR/../$i
done done

View File

@@ -76,7 +76,7 @@ win_sdk: $(WIN_SDK_ZIP)
winsdk-tools: $(WIN_BUILD_PREREQ) winsdk-tools: $(WIN_BUILD_PREREQ)
$(call winsdk-banner,Build Windows Tools) $(call winsdk-banner,Build Windows Tools)
$(hide) USE_MINGW=1 $(MAKE) PRODUCT-$(TARGET_PRODUCT)-$(strip $(WIN_TARGETS)) $(hide) USE_MINGW=1 $(MAKE) PRODUCT-$(TARGET_PRODUCT)-$(strip $(WIN_TARGETS)) $(if $(hide),,showcommands)
$(WIN_SDK_ZIP): winsdk-tools sdk $(WIN_SDK_ZIP): winsdk-tools sdk
$(call winsdk-banner,Build $(WIN_SDK_NAME)) $(call winsdk-banner,Build $(WIN_SDK_NAME))