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