blob: 263dc2068cab4ac36d2ff0488e1afd412235012c [file] [log] [blame]
The Android Open Source Project55a2c712009-03-03 19:29:09 -08001#!/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"`
Raphaelf1d64e22009-11-18 11:27:35 -080011cd "$D/../../../"
The Android Open Source Project55a2c712009-03-03 19:29:09 -080012
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
Raphaelf1d64e22009-11-18 11:27:35 -080022 echo "Usage: $0 yoursdk/platforms/xxx/data/layoutlib.jar"
The Android Open Source Project55a2c712009-03-03 19:29:09 -080023 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