The fix will work for Linux and Mac, however for Windows the DDMS icons will have an invalid path.
I can address the Windows DDMS issue in a next CL if necessary by merging in a different
CL from upstream.
#!/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 to the top android directory
+D=`dirname "$0"`
+cd "$D/../../../../"
+
+DEST="development/tools/eclipse/plugins/com.android.ide.eclipse.adt"
+# computes "../.." from DEST to here (in /android)
+BACK=`echo $DEST | sed 's@[^/]*@..@g'`
+
+LIBS="jarutils androidprefs"
+
+echo "make java libs ..."
+make -j3 showcommands $LIBS || die "Fail to build one of $LIBS."
+
+echo "Copying java libs to $DEST"
-cd ../plugins/com.android.ide.eclipse.adt
HOST=`uname`
if [ "$HOST" == "Linux" ]; then
- ln -svf ../../../../out/host/linux-x86/framework/jarutils.jar .
- ln -svf ../../../../out/host/linux-x86/framework/androidprefs.jar .
+ for LIB in $LIBS; do
+ ln -svf $BACK/out/host/linux-x86/framework/$LIB.jar "$DEST/"
+ done
+
elif [ "$HOST" == "Darwin" ]; then
- ln -svf ../../../../out/host/darwin-x86/framework/jarutils.jar .
- ln -svf ../../../../out/host/darwin-x86/framework/androidprefs.jar .
-elif [ "${HOST:0:6}" == "CYGWIN" ]; then
-
- DEVICE_DIR="../../../.."
- echo "make java libs ..."
- ( cd "$DEVICE_DIR" &&
- make -j3 showcommands jarutils androidprefs ) || \
- die "Define javac and retry."
+ for LIB in $LIBS; do
+ ln -svf $BACK/out/host/darwin-x86/framework/$LIB.jar "$DEST/"
+ done
- for DIR in "$PWD" ; do
- echo "Copying java libs to $DIR"
- for JAR in jarutils.jar androidprefs.jar ; do
- cp -vf "$DEVICE_DIR/out/host/windows-x86/framework/$JAR" "$DIR"
- done
- done
+elif [ "${HOST:0:6}" == "CYGWIN" ]; then
+ for LIB in $LIBS; do
+ cp -vf $BACK/out/host/windows-x86/framework/$LIB.jar "$DEST/"
+ done
- chmod a+rx *.jar
+ chmod -v a+rx "$DEST"/*.jar
else
- echo "Unsupported platform ($HOST). Nothing done."
+ echo "Unsupported platform ($HOST). Nothing done."
fi
echo "### $0 executing"
function die() {
- echo "Error: $*"
- exit 1
+ echo "Error: $*"
+ exit 1
}
-D="device/tools/eclipse/scripts"
-if [ -d "../$D" ]; then
- cd "../$D"
-else
- [ "${PWD: -28}" == "$D" ] || die "Please execute this from the $D directory"
-fi
+# CD to the top android directory
+D=`dirname "$0"`
+cd "$D/../../../../"
+
+DEST="development/tools/eclipse/scripts"
set -e # fail early
echo ; echo "### ADT ###" ; echo
-./create_adt_symlinks.sh "$*"
+$DEST/create_adt_symlinks.sh "$*"
echo ; echo "### COMMON ###" ; echo
-./create_common_symlinks.sh "$*"
+$DEST/create_common_symlinks.sh "$*"
echo ; echo "### EDITORS ###" ; echo
-./create_editors_symlinks.sh "$*"
+$DEST/create_editors_symlinks.sh "$*"
echo ; echo "### DDMS ###" ; echo
-./create_ddms_symlinks.sh "$*"
+$DEST/create_ddms_symlinks.sh "$*"
echo ; echo "### TEST ###" ; echo
-./create_test_symlinks.sh "$*"
+$DEST/create_test_symlinks.sh "$*"
echo ; echo "### BRIDGE ###" ; echo
-./create_bridge_symlinks.sh "$*"
+$DEST/create_bridge_symlinks.sh "$*"
echo "### $0 done"
#!/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
-elif [ "$HOST" == "Darwin" ]; then
- 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
+ echo # nothing to do
- DEVICE_DIR="../../"
- echo "make java libs ..."
- ( cd "$DEVICE_DIR" &&
- make -j3 showcommands layoutlib ninepatch ) || \
- die "Define javac and retry."
+elif [ "$HOST" == "Darwin" ]; then
+ echo # nothing to do
- 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
+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
+
+ echo "make java libs ..."
+ LIBS="layoutlib ninepatch"
+ make -j3 showcommands $LIBS || die "Define javac and retry."
+
+ for DIR in frameworks/base/tools/layoutlib "$1" ; do
+ echo "Copying java libs to $DIR"
+ for LIB in $LIBS; do
+ cp -vf "out/host/windows-x86/framework/$LIB.jar" "$DIR"
+ done
+ chmod -v a+rx "$LIB"/*.jar
+ done
else
- echo "Unsupported platform ($HOST). Nothing done."
+ echo "Unsupported platform ($HOST). Nothing done."
fi
#!/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 to the top android directory
+D=`dirname "$0"`
+cd "$D/../../../../"
+
+DEST="development/tools/eclipse/plugins/com.android.ide.eclipse.common"
+# computes "../.." from DEST to here (in /android)
+BACK=`echo $DEST | sed 's@[^/]*@..@g'`
+
+LIBS="sdkstats androidprefs"
+
+echo "make java libs ..."
+make -j3 showcommands $LIBS || die "Fail to build one of $LIBS."
+
+echo "Copying java libs to $DEST"
-cd ../plugins/com.android.ide.eclipse.common
HOST=`uname`
if [ "$HOST" == "Linux" ]; then
- ln -svf ../../../../out/host/linux-x86/framework/sdkstats.jar .
- ln -svf ../../../../out/host/linux-x86/framework/androidprefs.jar .
+ for LIB in $LIBS; do
+ ln -svf $BACK/out/host/linux-x86/framework/$LIB.jar "$DEST/"
+ done
+
elif [ "$HOST" == "Darwin" ]; then
- ln -svf ../../../../out/host/darwin-x86/framework/sdkstats.jar .
- ln -svf ../../../../out/host/darwin-x86/framework/androidprefs.jar .
-elif [ "${HOST:0:6}" == "CYGWIN" ]; then
-
- DEVICE_DIR="../../../.."
- echo "make java libs ..."
- ( cd "$DEVICE_DIR" &&
- make -j3 sdkstats androidprefs ) || \
- die "Define javac and retry."
+ for LIB in $LIBS; do
+ ln -svf $BACK/out/host/darwin-x86/framework/$LIB.jar "$DEST/"
+ done
- for DIR in "$PWD" ; do
- echo "Copying java libs to $DIR"
- for JAR in sdkstats.jar androidprefs.jar ; do
- cp -vf "$DEVICE_DIR/out/host/windows-x86/framework/$JAR" "$DIR"
- chmod a+rx "$DIR/$JAR"
- done
- done
+elif [ "${HOST:0:6}" == "CYGWIN" ]; then
+ for LIB in $LIBS; do
+ cp -vf $BACK/out/host/windows-x86/framework/$LIB.jar "$DEST/"
+ done
+ chmod -v a+rx "$DEST"/*.jar
else
- echo "Unsupported platform ($HOST). Nothing done."
+ echo "Unsupported platform ($HOST). Nothing done."
fi
DIR="ln -svf"
HOST=`uname`
if [ "${HOST:0:6}" == "CYGWIN" ]; then
- CMD="cp -rvf"
- DIR="rsync -avW --delete-after"
+ CMD="cp -rvf"
+ DIR="rsync -avW --delete-after"
fi
-cd ../plugins/com.android.ide.eclipse.ddms
-mkdir -p libs
-cd libs
-$CMD ../../../../../prebuilt/common/jfreechart/jcommon-1.0.12.jar .
-$CMD ../../../../../prebuilt/common/jfreechart/jfreechart-1.0.9.jar .
-$CMD ../../../../../prebuilt/common/jfreechart/jfreechart-1.0.9-swt.jar .
-
-cd ../src/com/android
-$DIR ../../../../../../ddms/libs/ddmlib/src/com/android/ddmlib .
-$DIR ../../../../../../ddms/libs/ddmuilib/src/com/android/ddmuilib .
-
-# goes back to the icons directory
-cd ../../../icons/
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/debug-attach.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/debug-wait.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/debug-error.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/device.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/emulator.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/heap.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/thread.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/empty.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/warning.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/d.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/e.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/i.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/v.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/w.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/add.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/delete.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/edit.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/save.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/push.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/pull.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/clear.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/up.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/down.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/gc.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/halt.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/load.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/importBug.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/play.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/pause.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/forward.png .
-$CMD ../../../../ddms/libs/ddmuilib/src/resources/images/backward.png .
+# CD to the top android directory
+D=`dirname "$0"`
+cd "$D/../../../../"
+# computes relative ".." paths from $1 to here (in /android)
+function back() {
+ echo $1 | sed 's@[^/]*@..@g'
+}
+BASE="development/tools/eclipse/plugins/com.android.ide.eclipse.ddms"
+
+DEST=$BASE/libs
+mkdir -p $D
+BACK=`back $DEST`
+for i in prebuilt/common/jfreechart/*.jar; do
+ $CMD $BACK/$i $DEST/
+done
+
+DEST=$BASE/src/com/android
+BACK=`back $DEST`
+for i in development/tools/ddms/libs/ddmlib/src/com/android/ddmlib \
+ development/tools/ddms/libs/ddmuilib/src/com/android/ddmuilib ; do
+ $DIR $BACK/$i $DEST/
+done
+
+DEST=$BASE/icons
+BACK=`back $DEST`
+
+for i in debug-attach.png debug-wait.png debug-error.png device.png emulator.png \
+ heap.png thread.png empty.png warning.png d.png e.png i.png \
+ v.png w.png add.png delete.png edit.png save.png push.png pull.png \
+ clear.png up.png down.png gc.png halt.png load.png importBug.png \
+ play.png pause.png forward.png backward.png ; do
+ $CMD $BACK/development/tools/ddms/libs/ddmuilib/src/resources/images/$i $DEST/
+done
#!/bin/bash
function die() {
- echo "Error: $*"
- exit 1
+ echo "Error: $*"
+ exit 1
}
-cd ../plugins/com.android.ide.eclipse.editors
+set -e # fail early
+
+# CD to the top android directory
+D=`dirname "$0"`
+cd "$D/../../../../"
+
+DEST="development/tools/eclipse/plugins/com.android.ide.eclipse.editors"
+# computes "../.." from DEST to here (in /android)
+BACK=`echo $DEST | sed 's@[^/]*@..@g'`
+
+LIBS="layoutlib_api layoutlib_utils ninepatch"
+
+echo "make java libs ..."
+make -j3 showcommands $LIBS || die "Fail to build one of $LIBS."
+
+echo "Copying java libs to $DEST"
+
HOST=`uname`
if [ "$HOST" == "Linux" ]; then
- ln -svf ../../../../out/host/linux-x86/framework/layoutlib_api.jar .
- ln -svf ../../../../out/host/linux-x86/framework/layoutlib_utils.jar .
- ln -svf ../../../../out/host/linux-x86/framework/kxml2-2.3.0.jar .
- ln -svf ../../../../out/host/linux-x86/framework/ninepatch.jar .
+ for LIB in $LIBS; do
+ ln -svf $BACK/out/host/linux-x86/framework/$LIB.jar "$DEST/"
+ done
+ ln -svf $BACK/out/host/linux-x86/framework/kxml2-2.3.0.jar "$DEST/"
+
elif [ "$HOST" == "Darwin" ]; then
- ln -svf ../../../../out/host/darwin-x86/framework/layoutlib_api.jar .
- ln -svf ../../../../out/host/darwin-x86/framework/layoutlib_utils.jar .
- ln -svf ../../../../out/host/darwin-x86/framework/kxml2-2.3.0.jar .
- ln -svf ../../../../out/host/darwin-x86/framework/ninepatch.jar .
+ for LIB in $LIBS; do
+ ln -svf $BACK/out/host/darwin-x86/framework/$LIB.jar "$DEST/"
+ done
+ ln -svf $BACK/out/host/darwin-x86/framework/kxml2-2.3.0.jar "$DEST/"
+
elif [ "${HOST:0:6}" == "CYGWIN" ]; then
- set -e # fail early
- DEVICE_DIR="../../../../"
- echo "make java libs ..."
- ( cd "$DEVICE_DIR" &&
- make -j3 showcommands layoutlib_api layoutlib_utils ninepatch ) || \
- die "Define javac and 'make layoutlib_api ninepatch' from device."
-
- echo "Copying java libs to $PWD"
- for JAR in layoutlib_api.jar layoutlib_utils.jar ninepatch.jar ; do
- cp -vf "$DEVICE_DIR/out/host/windows-x86/framework/$JAR" .
- done
- if [ ! -f "./kxml2-2.3.0.jar" ]; then
- cp -v $DEVICE_DIR/prebuilt/common/kxml2/kxml2-2.3.0.jar .
- chmod -v a+rx *.jar
- fi
+ for LIB in $LIBS; do
+ cp -vf $BACK/out/host/windows-x86/framework/$LIB.jar "$DEST/"
+ done
+
+ if [ ! -f "$DEST/kxml2-2.3.0.jar" ]; then
+ cp -v "prebuilt/common/kxml2/kxml2-2.3.0.jar" "$DEST/"
+ fi
+ chmod -v a+rx "$DEST"/*.jar
else
- echo "Unsupported platform ($HOST). Nothing done."
+ echo "Unsupported platform ($HOST). Nothing done."
fi