Code drop from //branches/cupcake/...@124589

This commit is contained in:
The Android Open Source Project
2008-12-17 18:04:04 -08:00
parent 5c11852110
commit e943f2fd8e
659 changed files with 47382 additions and 9976 deletions

View File

@@ -0,0 +1,225 @@
#!/bin/bash
# build script for eclipse adt build on linux platform
#
# Usage: development/tools/eclipse/scripts/build_plugins <build_version>
#
# It expects environment variable ECLIPSE_HOME to be defined to point to _your_
# version of Eclipse RCP (must have the WTP & GEF plugins available too.)
#
# If ECLIPSE_HOME is not provided, this script will _download_ a reference version
# of Eclipse RCP and install it in a specific location.
#
# Other properties, ant scripts that drive the build are defined in ./buildConfig
# Currently, this script will create an update site at ${user.home}/www/no_crawl/android-build
# or at the directory specified using "-d"
# Known Issues:
# - Build does not properly clean up after itself (build server always executes from
# a clean state.)
# - Script will fail if current absolute path has spaces in it.
# - Only linux is supported for now
set -e # abort this script early if any command fails
#
# -- Utility methods --
#
function printUsage() {
echo "Usage: $0 <build_qualifier> [-i] [-d <destination-directory>] [-a <archivePrefix>] "
echo "<build_qualifier>: build qualifier string"
echo "-i = build internal site. Otherwise, external site will be built"
echo "-d = destination directory. Default is $USER/www/no_crawl/. Cannot contain spaces."
echo "-a = archive prefix. Cannot contain spaces."
}
function die() {
echo $@
exit 1
}
function dieWithUsage() {
echo $@
echo
printUsage
exit 1
}
#
# -- Setup our custom version of Eclipse --
#
# The dependency on the linux platform comes from a series of environment
# variables that the eclipse ant runner expects. These are defined in the
# build.properties file. We can easily support other platforms but would need
# to override those values in this script.
HOST=`uname`
[ "$HOST" == "Linux" ] || die "ERROR: This script is currently only supported on Linux platform"
# Make sure this runs from the tools/eclipse plugin.
D=`dirname "$0"`
cd "$D/.."
[ `basename "$PWD"` == "eclipse" ] || dieWithUsage "Please run this script from the device/tools/eclipse directory"
# check for number of parameters
[ $# -lt 1 ] && dieWithUsage "ERROR: Not enough parameters"
# check if ECLIPSE_HOME set (ECLIPSE_HOME is were the "eclipse" binary and the
# "plugins" sub-directory are located)
if [ -z "$ECLIPSE_HOME" ]; then
BASE_DIR=/buildbot/eclipse-android
echo "ECLIPSE_HOME not set, using $BASE_DIR as default"
if [ ! -d "$BASE_DIR" ]; then
mkdir -p "$BASE_DIR" || die "Please create a directory $BASE_DIR where Eclipse will be installed, i.e. execute 'mkdir -p $BASE_DIR && chown $USER $BASE_DIR'."
fi
# download the version if not available
VERSION="3.4.0"
BASE_DIR="$BASE_DIR/$VERSION"
scripts/setup_eclipse.sh -p "$BASE_DIR"
ECLIPSE_HOME="$BASE_DIR/eclipse" # path to installed directory
PID_FILE="$BASE_DIR/eclipse.pid"
[ -f "$PID_FILE" ] && ECLIPSE_PID=`cat "$PID_FILE"`
fi
echo "PWD=`pwd`"
echo "ECLIPSE_HOME=$ECLIPSE_HOME"
#
# -- Site parameters and Build version --
#
BUILD_VERSION="$1" ; shift
# parse for build internal site flag. If set, pass in internalSite property to ant scripts
if [ "-i" == "$1" ]; then
shift
echo "Setting for internal site build"
SITE_PARAM="-DinternalSite=1 -DupdateSiteSource=$PWD/sites/internal"
else
SITE_PARAM="-DupdateSiteSource=$PWD/sites/external"
fi
if [ "-d" == $1 ]; then
shift
echo "Setting destination directory to $1"
SITE_PARAM="$SITE_PARAM -DupdateSiteRoot=$1"
shift
fi
if [ "-a" == "$1" ]; then
shift
echo "Setting archivePrefix to $1"
SITE_PARAM="$SITE_PARAM -DarchivePrefix=$1"
shift
fi
#
# -- Configuration directory --
#
# The "configuration directory" will hold the workspace for this build.
# If it contains old data the build may fail so we need to clean it first
# and create it if it doesn't exist.
CONFIG_DIR="../../../out/eclipse-configuration-$BUILD_VERSION"
[ -d "$CONFIG_DIR" ] && rm -rfv "$CONFIG_DIR"
mkdir -p "$CONFIG_DIR"
# The "buildConfig" directory contains our customized ant rules
BUILDCONFIG="$PWD/buildConfig"
#
# -- Find Eclipse Launcher --
#
# Get the Eclipse launcher and build script to use
function findFirst() {
for i in "$@"; do
if [ -f "$i" ]; then
echo "$i"
return
fi
done
}
LAUNCHER=`findFirst "$ECLIPSE_HOME"/plugins/org.eclipse.equinox.launcher_*.jar`
BUILDFILE=`findFirst "$ECLIPSE_HOME"/plugins/org.eclipse.pde.build_*/scripts/build.xml`
# make sure we found valid files
if [ ! -f "$LAUNCHER" ]; then
echo "Installation Error: Eclipse plugin org.eclipse.equinox.launcher...jar not detected. " \
"Found '$LAUNCHER'. Aborting."
exit 1
fi
if [ ! -f "$BUILDFILE" ]; then
echo "Installation Error: Eclipse build file org.eclipse.pde.build_.../scripts/build.xml " \
"not detected. Found '$BUILDFILE'. Aborting."
exit 1
fi
#
# -- Print configuration used and actually execute the build --
#
echo "Eclipse configuration found:"
echo " Eclipse Home: $ECLIPSE_HOME"
echo " Launcher: $LAUNCHER"
echo " Build File: $BUILDFILE"
echo " Build Config: $BUILDCONFIG"
echo " Config Dir: $CONFIG_DIR"
# clean input directories to make sure there's nothing left from previous run
rm -fv *.properties *.xml
find . -name "@*" | xargs rm -rfv
# Now execute the ant runner
set +e # don't stop on errors anymore, we want to catch there here
java \
-jar $LAUNCHER \
-data "$CONFIG_DIR" \
-configuration "$CONFIG_DIR" \
-application org.eclipse.ant.core.antRunner \
-buildfile $BUILDFILE \
-Dbuilder=$BUILDCONFIG \
-DbuildDirectory=$PWD \
-DforceContextQualifier=$BUILD_VERSION \
-DECLIPSE_HOME=$ECLIPSE_HOME \
$SITE_PARAM
RESULT=$?
if [ "0" != "$RESULT" ]; then
echo "JAVA died with error code $RESULT"
echo "Dump of build config logs:"
for i in "$CONFIG_DIR"/*.log; do
if [ -f "$i" ]; then
echo "----------------------"
echo "--- $i"
echo "----------------------"
cat "$i"
echo
fi
done
fi
#
# -- Cleanup
#
if [ -n "$ECLIPSE_PID" ] && [ -f "$PID_FILE" ]; then
rm -fv "$PID_FILE"
kill -9 "$ECLIPSE_PID"
fi
# we're done!

View File

@@ -46,9 +46,10 @@ function die() {
}
function check_params() {
# This needs to run from //device
[ `basename "$PWD"` == "device" ] || \
die "Please execute $0 from the //device directory, not $PWD"
# This needs to run from the top android directory
# Automatically CD to the top android directory, whatever its name
D=`dirname "$0"`
cd "$D/../../../../" && echo "Switched to directory $PWD"
# The current Eclipse build has some Linux dependency in its config files
[ `uname` == "Linux" ] || die "This must run from a Linux box."
@@ -60,14 +61,12 @@ function check_params() {
function build_libs() {
MAKE_OPT="-j8"
echo "*** Building: make $MAKE_OPT dx ping ddms jarutils androidprefs layoutlib_api"
make $MAKE_OPT dx ping ddms jarutils androidprefs layoutlib_api layoutlib_utils
echo "*** Building: make $MAKE_OPT dx ping ddms jarutils androidprefs layoutlib_api ninepatch sdklib sdkuilib"
make $MAKE_OPT dx ping ddms jarutils androidprefs layoutlib_api layoutlib_utils ninepatch sdklib sdkuilib
}
function build_plugin {
cd tools/eclipse/scripts
./create_all_symlinks.sh
cd .. # cd back to tools/eclipse
development/tools/eclipse/scripts/create_all_symlinks.sh
# Qualifier is "v" followed by date/time in YYYYMMDDHHSS format and the optional
# build number.
@@ -90,7 +89,7 @@ function build_plugin {
[ -d "$DEST_DIR/$BUILD_PREFIX" ] || rm -rfv "$DEST_DIR/$BUILD_PREFIX"
# Perform the Eclipse build and move the result in $DEST_DIR/android-build
./doBuild.sh $QUALIFIER $INTERNAL_BUILD -d "$DEST_DIR" -a "$BUILD_PREFIX"
development/tools/eclipse/scripts/build_plugins.sh $QUALIFIER $INTERNAL_BUILD -d "$DEST_DIR" -a "$BUILD_PREFIX"
# Cleanup
[ -d "$QUALIFIER" ] && rm -rfv "$QUALIFIER"

View File

@@ -1,42 +1,50 @@
#!/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="sdkstats jarutils androidprefs layoutlib_api layoutlib_utils ninepatch sdklib sdkuilib"
echo "make java libs ..."
make -j3 showcommands $LIBS || die "ADT: 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
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/jarutils.jar .
ln -svf ../../../../out/host/darwin-x86/framework/androidprefs.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
for LIB in $LIBS; do
cp -vf out/host/windows-x86/framework/$LIB.jar "$DEST/"
done
DEVICE_DIR="../../../.."
echo "make java libs ..."
( cd "$DEVICE_DIR" &&
make -j3 showcommands jarutils androidprefs ) || \
die "Define javac and retry."
if [ ! -f "$DEST/kxml2-2.3.0.jar" ]; then
cp -v "prebuilt/common/kxml2/kxml2-2.3.0.jar" "$DEST/"
fi
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
chmod a+rx *.jar
chmod -v a+rx "$DEST"/*.jar
else
echo "Unsupported platform ($HOST). Nothing done."
echo "Unsupported platform ($HOST). Nothing done."
fi

View File

@@ -3,30 +3,25 @@
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 "$*"
echo ; echo "### COMMON ###" ; echo
./create_common_symlinks.sh "$*"
echo ; echo "### EDITORS ###" ; echo
./create_editors_symlinks.sh "$*"
$DEST/create_adt_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"

View File

@@ -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

View File

@@ -1,42 +0,0 @@
#!/bin/bash
function die() {
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 ../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 .
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 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
else
echo "Unsupported platform ($HOST). Nothing done."
fi

View File

@@ -4,58 +4,76 @@
# Run this from device/tools/eclipse/scripts
#----------------------------------------------------------------------------|
CMD="ln -svf"
DIR="ln -svf"
set -e
HOST=`uname`
if [ "${HOST:0:6}" == "CYGWIN" ]; then
CMD="cp -rvf"
DIR="rsync -avW --delete-after"
# We can't use symlinks under Cygwin
function cpfile { # $1=dest $2=source
cp -fv $2 $1/
}
function cpdir() { # $1=dest $2=source
rsync -avW --delete-after $2 $1
}
else
# For all other systems which support symlinks
# computes the "reverse" path, e.g. "a/b/c" => "../../.."
function back() {
echo $1 | sed 's@[^/]*@..@g'
}
function cpfile { # $1=dest $2=source
ln -svf `back $1`/$2 $1/
}
function cpdir() { # $1=dest $2=source
ln -svf `back $1`/$2 $1
}
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/../../../../"
BASE="development/tools/eclipse/plugins/com.android.ide.eclipse.ddms"
DEST=$BASE/libs
mkdir -p $DEST
for i in prebuilt/common/jfreechart/*.jar; do
cpfile $DEST $i
done
DEST=$BASE/src/com/android
mkdir -p $DEST
for i in development/tools/ddms/libs/ddmlib/src/com/android/ddmlib \
development/tools/ddms/libs/ddmuilib/src/com/android/ddmuilib ; do
cpdir $DEST $i
done
DEST=$BASE/icons
mkdir -p $DEST
for i in \
add.png \
backward.png \
clear.png \
d.png debug-attach.png debug-error.png debug-wait.png delete.png device.png down.png \
e.png edit.png empty.png emulator.png \
forward.png \
gc.png \
heap.png halt.png \
i.png importBug.png \
load.png \
pause.png play.png pull.png push.png \
save.png \
thread.png \
up.png \
v.png \
w.png warning.png ; do
cpfile $DEST development/tools/ddms/libs/ddmuilib/src/resources/images/$i
done

View File

@@ -1,39 +0,0 @@
#!/bin/bash
function die() {
echo "Error: $*"
exit 1
}
cd ../plugins/com.android.ide.eclipse.editors
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 .
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 .
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
else
echo "Unsupported platform ($HOST). Nothing done."
fi

View File

@@ -1,24 +1,48 @@
#!/bin/bash
cd ../plugins/com.android.ide.eclipse.tests
set -e
# 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.tests"
DEST=$BASE
BACK=`back $DEST`
HOST=`uname`
if [ "$HOST" == "Linux" ]; then
ln -svf ../../../../out/host/linux-x86/framework/kxml2-2.3.0.jar .
DIR="ln -svf"
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/kxml2-2.3.0.jar .
DIR="ln -svf"
ln -svf $BACK/out/host/darwin-x86/framework/kxml2-2.3.0.jar "$DEST/"
elif [ "${HOST:0:6}" == "CYGWIN" ]; then
if [ "x$1" == "x" ]; then
echo "Usage: $0 <path to jars>"
echo "Argument 1 should be the path to the jars you want to copy. "
echo " e.g. android_sdk_windows_NNN/tools/lib/ "
echo "(since you can't rebuild them under Windows, you need prebuilt ones "
echo " from an SDK drop or a Linux/Mac)"
exit 1
fi
if [ ! -f "kxml2-2.3.0.jar" ]; then
wget -O "kxml2-2.3.0.jar" "http://internap.dl.sourceforge.net/sourceforge/kxml/kxml2-2.3.0.jar"
chmod a+rx *.jar
fi
DIR="rsync -avW --delete-after"
JAR="kxml2-2.3.0.jar"
if [ ! -f "$DEST/$JAR" ]; then
# Get the jar from ADT if we can, otherwise download it.
if [ -f "$DEST/../com.android.ide.eclipse.adt/$JAR" ]; then
cp "$DEST/../com.android.ide.eclipse.adt/$JAR" "$DEST/$JAR"
else
wget -O "$DEST/$JAR" "http://internap.dl.sourceforge.net/sourceforge/kxml/$JAR"
fi
chmod a+rx "$DEST/$JAR"
fi
else
echo "Unsupported platform ($HOST). Nothing done."
echo "Unsupported platform ($HOST). Nothing done."
fi
# create link to ddmlib tests
DEST=$BASE/unittests/com/android
BACK=`back $DEST`
$DIR $BACK/development/tools/ddms/libs/ddmlib/tests/src/com/android/ddmlib $DEST/

View File

@@ -0,0 +1,37 @@
#!/bin/bash
OLD="$1"
NEW="$2"
# sanity check in input args
if [ -z "$OLD" ] || [ -z "$NEW" ]; then
cat <<EOF
Usage: $0 <old> <new>
Changes the ADT plugin revision number.
Example:
cd tools/eclipse
scripts/update_version.sh 0.1.2 0.2.3
EOF
exit 1
fi
# sanity check on current dir
if [ `basename "$PWD"` != "eclipse" ]; then
echo "Please run this from tools/eclipse."
exit 1
fi
# quote dots for regexps
OLD="${OLD//./\.}"
NEW="${NEW//./\.}"
# Find all the files with the old pattern, except changes.txt and
# p4 edit them. Skip that if there's no p4 in path.
if which g4 1>/dev/null 2>/dev/null ; then
grep -rl "$OLD" * | grep -E "\.xml$|\.MF$" | xargs -n 5 g4 edit
fi
# Now find the same files but this time use sed to replace in-place with
# the new pattern. Old files get backuped with the .old extension.
grep -rl "$OLD" * | grep -E "\.xml$|\.MF$" | xargs -n 1 sed -i.old "s/$OLD/$NEW/g"