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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 function exportVar { 1 function exportVar {
2 NAME=$1 2 NAME=$1
3 VALUE=$2 3 VALUE=$2
4 echo export $NAME=\"$VALUE\" 4 echo export $NAME=\"$VALUE\"
5 export $NAME="$VALUE" 5 export $NAME="$VALUE"
6 } 6 }
7 7
8 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 8 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9 9
10 # A valid Android SDK installation is required to build the sample app. 10 # A valid Android SDK installation is required to build the sample app.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 exportVar LINK "$ANDROID_TOOLCHAIN_PREFIX-gcc" 111 exportVar LINK "$ANDROID_TOOLCHAIN_PREFIX-gcc"
112 else 112 else
113 exportVar CC "$ANDROID_MAKE_CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc" 113 exportVar CC "$ANDROID_MAKE_CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
114 exportVar CXX "$ANDROID_MAKE_CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++" 114 exportVar CXX "$ANDROID_MAKE_CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++"
115 exportVar LINK "$ANDROID_MAKE_CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc" 115 exportVar LINK "$ANDROID_MAKE_CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
116 fi 116 fi
117 exportVar RANLIB "$ANDROID_TOOLCHAIN_PREFIX-ranlib" 117 exportVar RANLIB "$ANDROID_TOOLCHAIN_PREFIX-ranlib"
118 exportVar OBJCOPY "$ANDROID_TOOLCHAIN_PREFIX-objcopy" 118 exportVar OBJCOPY "$ANDROID_TOOLCHAIN_PREFIX-objcopy"
119 exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip" 119 exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip"
120 120
121 # Use the "android" flavor of the Makefile generator for both Linux and OS X.
122 exportVar GYP_GENERATORS "make-android"
123
121 # Helper function to configure the GYP defines to the appropriate values 124 # Helper function to configure the GYP defines to the appropriate values
122 # based on the target device. 125 # based on the target device.
123 setup_device() { 126 setup_device() {
124 DEFINES="OS=android" 127 DEFINES="OS=android"
125 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/' )" 128 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/' )"
126 DEFINES="${DEFINES} skia_os=android" 129 DEFINES="${DEFINES} skia_os=android"
127 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.." 130 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.."
128 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}" 131 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}"
129 DEFINES="${DEFINES} skia_shared_lib=1" 132 DEFINES="${DEFINES} skia_shared_lib=1"
130 133
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return 1; 180 return 1;
178 ;; 181 ;;
179 esac 182 esac
180 183
181 echo "The build is targeting the device: $TARGET_DEVICE" 184 echo "The build is targeting the device: $TARGET_DEVICE"
182 185
183 exportVar GYP_DEFINES "$DEFINES" 186 exportVar GYP_DEFINES "$DEFINES"
184 exportVar SKIA_OUT "out/config/android-${TARGET_DEVICE}" 187 exportVar SKIA_OUT "out/config/android-${TARGET_DEVICE}"
185 } 188 }
186 189
187 # Run the setup device command initially as a convenience for the user 190 # adb_pull_if_needed(android_src, host_dst)
188 #setup_device 191 adb_pull_if_needed() {
189 #echo "** The device has been setup for you by default. If you would like to **"
190 #echo "** use a different device then run the setup_device function with the **"
191 #echo "** appropriate input. **"
192 192
193 # Use the "android" flavor of the Makefile generator for both Linux and OS X. 193 # get adb location
194 exportVar GYP_GENERATORS "make-android" 194 source $SCRIPT_DIR/utils/setup_adb.sh
195 195
196 # Helper function so that when we run "make" to build for clank it exports 196 # read input params
197 # the toolchain variables to make. 197 ANDROID_SRC="$1"
198 #make_android() { 198 HOST_DST="$2"
199 # CC="$CROSS_CC" CXX="$CROSS_CXX" LINK="$CROSS_LINK" \ 199
200 # AR="$CROSS_AR" RANLIB="$CROSS_RANLIB" \ 200 if [ -d $HOST_DST ];
201 # command make $* 201 then
202 #} 202 HOST_DST="${HOST_DST}/$(basename ${ANDROID_SRC})"
203 fi
204
205 echo "HOST: $HOST_DST"
206
207 if [ -f $HOST_DST ];
208 then
209 #get the MD5 for dst and src
210 ANDROID_MD5=`$ADB shell md5 $ANDROID_SRC`
211 HOST_MD5=`md5sum $HOST_DST`
212
213 if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ];
214 then
215 $ADB pull $ANDROID_SRC $HOST_DST
216 # else
217 # echo "md5 match of android [$ANDROID_SRC] and host [$HOST_DST]"
218 fi
219 else
220 $ADB pull $ANDROID_SRC $HOST_DST
221 fi
222 }
OLDNEW
« 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