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

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

Issue 22929006: default to device type of last build if no device type is given (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 DEVICE_SERIAL="" 7 DEVICE_SERIAL=""
8 while (( "$#" )); do 8 while (( "$#" )); do
9 if [[ $(echo "$1" | grep "^-d$") != "" ]]; 9 if [[ $(echo "$1" | grep "^-d$") != "" ]];
10 then 10 then
11 DEVICE_ID=$2 11 DEVICE_ID=$2
12 shift 12 shift
13 elif [[ "$1" == "-s" ]]; 13 elif [[ "$1" == "-s" ]];
14 then 14 then
15 if [[ $# -lt 2 ]]; 15 if [[ $# -lt 2 ]];
16 then 16 then
17 echo "ERROR: missing serial number" 17 echo "ERROR: missing serial number"
18 exit 1; 18 exit 1;
19 fi 19 fi
20 DEVICE_SERIAL="-s $2" 20 DEVICE_SERIAL="-s $2"
21 shift 21 shift
22 else 22 else
23 APP_ARGS=("${APP_ARGS[@]}" "${1}") 23 APP_ARGS=("${APP_ARGS[@]}" "${1}")
24 fi 24 fi
25 25
26 shift 26 shift
27 done 27 done
28 28
29 if [ -z "$DEVICE_ID" ]
borenet 2013/08/19 20:30:50 Why not do this block where the previous default w
30 then
31
32 if [ ! -f .android_config ]
33 then
34 DEVICE_ID="arm_v7"
35 echo "INFO: no target device type was specified so using the default 'ar m_v7'"
borenet 2013/08/19 20:30:50 Use "${DEVICE_ID}" instead of "arm_v7"?
36 else
37 DEVICE_ID=$(cat .android_config)
38 echo "INFO: no target device type was specified so using the device from the most recent build"
borenet 2013/08/19 20:30:50 Include $DEVICE_ID?
39 fi
40 fi
41
29 function exportVar { 42 function exportVar {
30 NAME=$1 43 NAME=$1
31 VALUE=$2 44 VALUE=$2
32 echo export $NAME=\"$VALUE\" 45 echo export $NAME=\"$VALUE\"
33 export $NAME="$VALUE" 46 export $NAME="$VALUE"
34 } 47 }
35 48
36 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 49 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
37 50
38 # A valid Android SDK installation is required to build the sample app. 51 # A valid Android SDK installation is required to build the sample app.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 setup_device() { 166 setup_device() {
154 DEFINES="OS=android" 167 DEFINES="OS=android"
155 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/' )" 168 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/' )"
156 DEFINES="${DEFINES} skia_os=android" 169 DEFINES="${DEFINES} skia_os=android"
157 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.." 170 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.."
158 DEFINES="${DEFINES} skia_shared_lib=1" 171 DEFINES="${DEFINES} skia_shared_lib=1"
159 172
160 # Setup the build variation depending on the target device 173 # Setup the build variation depending on the target device
161 TARGET_DEVICE="$1" 174 TARGET_DEVICE="$1"
162 175
163 if [ -z "$TARGET_DEVICE" ]; then
164 echo "INFO: no target device type was specified so using the default 'arm_v7 '"
165 TARGET_DEVICE="arm_v7"
166 fi
167
168 case $TARGET_DEVICE in 176 case $TARGET_DEVICE in
169 nexus_s) 177 nexus_s)
170 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb= 1" 178 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb= 1"
171 DEFINES="${DEFINES} skia_texture_cache_mb_limit=24" 179 DEFINES="${DEFINES} skia_texture_cache_mb_limit=24"
172 ANDROID_ARCH="arm" 180 ANDROID_ARCH="arm"
173 ;; 181 ;;
174 nexus_4 | nexus_7 | nexus_10) 182 nexus_4 | nexus_7 | nexus_10)
175 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb= 1" 183 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb= 1"
176 ANDROID_ARCH="arm" 184 ANDROID_ARCH="arm"
177 ;; 185 ;;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 else 314 else
307 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST 315 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
308 fi 316 fi
309 } 317 }
310 318
311 # Set up the device. 319 # Set up the device.
312 setup_device "${DEVICE_ID}" 320 setup_device "${DEVICE_ID}"
313 if [[ "$?" != "0" ]]; then 321 if [[ "$?" != "0" ]]; then
314 exit 1 322 exit 1
315 fi 323 fi
OLDNEW
« platform_tools/android/bin/android_make ('K') | « platform_tools/android/bin/android_make ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698