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

Side by Side Diff: platform_tools/android/bin/android_setup.sh

Issue 22617002: Update Skia Android tools. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # android_setup.sh: Sets environment variables used by other Android scripts. 3 # android_setup.sh: Sets environment variables used by other Android scripts.
4 4
5 # Parse the arguments for a DEVICE_ID. 5 # Parse the arguments for a DEVICE_ID.
6 DEVICE_ID="" 6 DEVICE_ID=""
7 while (( "$#" )); do 7 while (( "$#" )); do
8 if [[ $(echo "$1" | grep "^-d$") != "" ]]; 8 if [[ $(echo "$1" | grep "^-d$") != "" ]];
9 then 9 then
10 DEVICE_ID=$2 10 DEVICE_ID=$2
11 shift 11 shift
12 else 12 else
13 APP_ARGS="$APP_ARGS $1" 13 APP_ARGS=("${APP_ARGS[@]}" "${1}")
14 fi 14 fi
15 15
16 shift 16 shift
17 done 17 done
18 18
19 APP_ARGS=$(echo ${APP_ARGS} | sed 's/^ *//g') 19 APP_ARGS=$(echo ${APP_ARGS} | sed 's/^ *//g')
20 20
21 function exportVar { 21 function exportVar {
22 NAME=$1 22 NAME=$1
23 VALUE=$2 23 VALUE=$2
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 ANDROID_ARCH="x86" 203 ANDROID_ARCH="x86"
204 ;; 204 ;;
205 *) 205 *)
206 echo -n "ERROR: unknown device specified ($TARGET_DEVICE), valid values: " 206 echo -n "ERROR: unknown device specified ($TARGET_DEVICE), valid values: "
207 echo "nexus_[s,4,7,10] xoom galaxy_nexus razr_i arm arm_thumb arm_v7 arm_v 7_thumb x86" 207 echo "nexus_[s,4,7,10] xoom galaxy_nexus razr_i arm arm_thumb arm_v7 arm_v 7_thumb x86"
208 return 1; 208 return 1;
209 ;; 209 ;;
210 esac 210 esac
211 211
212 echo "The build is targeting the device: $TARGET_DEVICE" 212 echo "The build is targeting the device: $TARGET_DEVICE"
213 export DEVICE_ID="$TARGET_DEVICE"
213 214
214 # Set up the toolchain. 215 # Set up the toolchain.
215 setup_toolchain 216 setup_toolchain
216 if [[ "$?" != "0" ]]; then 217 if [[ "$?" != "0" ]]; then
217 return 1 218 return 1
218 fi 219 fi
219 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}" 220 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}"
220 221
221 # Use the "android" flavor of the Makefile generator for both Linux and OS X. 222 # Use the "android" flavor of the Makefile generator for both Linux and OS X.
222 exportVar GYP_GENERATORS "make-android" 223 exportVar GYP_GENERATORS "make-android"
(...skipping 28 matching lines...) Expand all
251 then 252 then
252 $ADB pull $ANDROID_SRC $HOST_DST 253 $ADB pull $ANDROID_SRC $HOST_DST
253 # else 254 # else
254 # echo "md5 match of android [$ANDROID_SRC] and host [$HOST_DST]" 255 # echo "md5 match of android [$ANDROID_SRC] and host [$HOST_DST]"
255 fi 256 fi
256 else 257 else
257 $ADB pull $ANDROID_SRC $HOST_DST 258 $ADB pull $ANDROID_SRC $HOST_DST
258 fi 259 fi
259 } 260 }
260 261
262 # adb_push_if_needed(host_src, android_dst)
263 adb_push_if_needed() {
264
265 # get adb location
266 source $SCRIPT_DIR/utils/setup_adb.sh
267
268 # read input params
269 HOST_SRC="$1"
270 ANDROID_DST="$2"
271
272 ANDROID_LS=`$ADB shell ls -ld $ANDROID_DST`
273 if [ "${ANDROID_LS:0:1}" == "d" ];
274 then
275 ANDROID_DST="${ANDROID_DST}/$(basename ${HOST_SRC})"
276 fi
277
278 echo "ANDROID: $ANDROID_DST"
279
280 ANDROID_LS=`$ADB shell ls -ld $ANDROID_DST`
281 if [ "${ANDROID_LS:0:1}" == "-" ];
282 then
283 #get the MD5 for dst and src
284 ANDROID_MD5=`$ADB shell md5 $ANDROID_DST`
285 HOST_MD5=`md5sum $HOST_SRC`
286
287 if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ];
288 then
289 $ADB push $HOST_SRC $ANDROID_DST
290 # else
291 # echo "md5 match of android [${ANDROID_DST}] and host [${HOST_SRC}]"
292 fi
293 else
294 $ADB push $HOST_SRC $ANDROID_DST
295 fi
296 }
297
261 # Set up the device. 298 # Set up the device.
262 setup_device "${DEVICE_ID}" 299 setup_device "${DEVICE_ID}"
263 if [[ "$?" != "0" ]]; then 300 if [[ "$?" != "0" ]]; then
264 exit 1 301 exit 1
265 fi 302 fi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698