blob: 05952be5bfef27c3455e41f3f637ab68b3377a8d [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
Raphaeld83de502010-02-03 15:45:10 -080022 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."
The Android Open Source Project55a2c712009-03-03 19:29:09 -080024 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
Raphaeld83de502010-02-03 15:45:10 -080030 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
The Android Open Source Project55a2c712009-03-03 19:29:09 -080037
38else
39 echo "Unsupported platform ($HOST). Nothing done."
40fi
41