Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: platform_tools/android/bin/android_setup.sh

Issue 17910006: Add MD5 support when syncing debug files and option to just start gdbserver (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: updating adb_pull f(x) Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « platform_tools/android/bin/android_gdbserver ('k') | platform_tools/android/bin/utils/setup_adb.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/bin/android_setup.sh
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index e5cea6e863850b5bb1a01a7cb943fd6bad7fc043..efd39d1c2df1bbd7f7761232dc5adf3563521d31 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -118,6 +118,9 @@ exportVar RANLIB "$ANDROID_TOOLCHAIN_PREFIX-ranlib"
exportVar OBJCOPY "$ANDROID_TOOLCHAIN_PREFIX-objcopy"
exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip"
+# Use the "android" flavor of the Makefile generator for both Linux and OS X.
+exportVar GYP_GENERATORS "make-android"
+
# Helper function to configure the GYP defines to the appropriate values
# based on the target device.
setup_device() {
@@ -184,19 +187,36 @@ setup_device() {
exportVar SKIA_OUT "out/config/android-${TARGET_DEVICE}"
}
-# Run the setup device command initially as a convenience for the user
-#setup_device
-#echo "** The device has been setup for you by default. If you would like to **"
-#echo "** use a different device then run the setup_device function with the **"
-#echo "** appropriate input. **"
+# adb_pull_if_needed(android_src, host_dst)
+adb_pull_if_needed() {
-# Use the "android" flavor of the Makefile generator for both Linux and OS X.
-exportVar GYP_GENERATORS "make-android"
+ # get adb location
+ source $SCRIPT_DIR/utils/setup_adb.sh
+
+ # read input params
+ ANDROID_SRC="$1"
+ HOST_DST="$2"
-# Helper function so that when we run "make" to build for clank it exports
-# the toolchain variables to make.
-#make_android() {
-# CC="$CROSS_CC" CXX="$CROSS_CXX" LINK="$CROSS_LINK" \
-# AR="$CROSS_AR" RANLIB="$CROSS_RANLIB" \
-# command make $*
-#}
+ if [ -d $HOST_DST ];
+ then
+ HOST_DST="${HOST_DST}/$(basename ${ANDROID_SRC})"
+ fi
+
+ echo "HOST: $HOST_DST"
+
+ if [ -f $HOST_DST ];
+ then
+ #get the MD5 for dst and src
+ ANDROID_MD5=`$ADB shell md5 $ANDROID_SRC`
+ HOST_MD5=`md5sum $HOST_DST`
+
+ if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ];
+ then
+ $ADB pull $ANDROID_SRC $HOST_DST
+# else
+# echo "md5 match of android [$ANDROID_SRC] and host [$HOST_DST]"
+ fi
+ else
+ $ADB pull $ANDROID_SRC $HOST_DST
+ fi
+}
« no previous file with comments | « platform_tools/android/bin/android_gdbserver ('k') | platform_tools/android/bin/utils/setup_adb.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698