1#!/bin/bash 2function die() { 3 echo "Error: $*" 4 exit 1 5} 6 7set -e # fail early 8 9# CD to the top android directory 10D=`dirname "$0"` 11cd "$D/../../../../" 12 13HOST=`uname` 14if [ "$HOST" == "Linux" ]; then 15 echo # nothing to do 16 17elif [ "$HOST" == "Darwin" ]; then 18 echo # nothing to do 19 20elif [ "${HOST:0:6}" == "CYGWIN" ]; then 21 if [ "x$1" == "x" ] || [ `basename "$1"` != "layoutlib.jar" ]; then 22 echo "Usage: $0 sdk/platforms/xxx/data/layoutlib.jar" 23 echo "Argument 1 should be the path to the layoutlib.jar that should be updated." 24 exit 1 25 fi 26 27 LIBS="layoutlib ninepatch" 28 echo "Make java libs: $LIBS" 29 make -j3 showcommands $LIBS || die "Bridge: Failed to build one of $LIBS." 30 31 echo "Updating your SDK in $1" 32 cp -vf "out/host/windows-x86/framework/layoutlib.jar" "$1" 33 chmod -v a+rx "$1" 34 35else 36 echo "Unsupported platform ($HOST). Nothing done." 37fi 38 39