aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/scripts/create_bridge_symlinks.sh
diff options
context:
space:
mode:
Diffstat (limited to 'eclipse/scripts/create_bridge_symlinks.sh')
-rwxr-xr-xeclipse/scripts/create_bridge_symlinks.sh51
1 files changed, 21 insertions, 30 deletions
diff --git a/eclipse/scripts/create_bridge_symlinks.sh b/eclipse/scripts/create_bridge_symlinks.sh
index f01a89e..605ef63 100755
--- a/eclipse/scripts/create_bridge_symlinks.sh
+++ b/eclipse/scripts/create_bridge_symlinks.sh
@@ -1,47 +1,38 @@
#!/bin/bash
function die() {
- echo "Error: $*"
- exit 1
+ echo "Error: $*"
+ exit 1
}
set -e # fail early
-# This may run either from the //device directory or from the
-# eclipse/script directory. Allow for both.
-D="device/tools/eclipse/scripts"
-[ -d "$D" ] && cd "$D"
-[ -d "../$D" ] && cd "../$D"
-
-cd ../../layoutlib
+# CD to the top android directory
+D=`dirname "$0"`
+cd "$D/../../../../"
HOST=`uname`
if [ "$HOST" == "Linux" ]; then
- echo # nothing to do
+ echo # nothing to do
+
elif [ "$HOST" == "Darwin" ]; then
- echo # nothing to do
+ echo # nothing to do
+
elif [ "${HOST:0:6}" == "CYGWIN" ]; then
- if [ "x$1" == "x" ]; then
- echo "Usage: $0 sdk/tools/lib/"
- echo "Argument 1 should be the path to the jars you want to copy. "
- echo " e.g. android_sdk_windows_NNN/tools/lib/ "
- echo "This will be used to update layout.lib after it has been built here."
- exit 1
- fi
+ if [ "x$1" == "x" ] || [ `basename "$1"` != "layoutlib.jar" ]; then
+ echo "Usage: $0 sdk/platforms/xxx/data/layoutlib.jar"
+ echo "Argument 1 should be the path to the layoutlib.jar that should be updated."
+ exit 1
+ fi
- DEVICE_DIR="../../"
- echo "make java libs ..."
- ( cd "$DEVICE_DIR" &&
- make -j3 showcommands layoutlib ninepatch ) || \
- die "Define javac and retry."
+ LIBS="layoutlib ninepatch"
+ echo "Make java libs: $LIBS"
+ make -j3 showcommands $LIBS || die "Bridge: Failed to build one of $LIBS."
- for DIR in "$PWD" "$1" ; do
- echo "Copying java libs to $DIR"
- for JAR in ninepatch.jar layoutlib.jar ; do
- cp -vf "$DEVICE_DIR/out/host/windows-x86/framework/$JAR" "$DIR"
- done
- done
+ echo "Updating your SDK in $1"
+ cp -vf "out/host/windows-x86/framework/layoutlib.jar" "$1"
+ chmod -v a+rx "$1"
else
- echo "Unsupported platform ($HOST). Nothing done."
+ echo "Unsupported platform ($HOST). Nothing done."
fi