| OLD | NEW |
| 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 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 DEFINES="${DEFINES} skia_shared_lib=1" | 158 DEFINES="${DEFINES} skia_shared_lib=1" |
| 159 | 159 |
| 160 # Setup the build variation depending on the target device | 160 # Setup the build variation depending on the target device |
| 161 TARGET_DEVICE="$1" | 161 TARGET_DEVICE="$1" |
| 162 | 162 |
| 163 if [ -z "$TARGET_DEVICE" ]; then | 163 if [ -z "$TARGET_DEVICE" ]; then |
| 164 if [ -f .android_config ]; then | 164 if [ -f .android_config ]; then |
| 165 TARGET_DEVICE=$(cat .android_config) | 165 TARGET_DEVICE=$(cat .android_config) |
| 166 echo "INFO: no target device was specified so using the device (${TARGET_D
EVICE}) from the most recent build" | 166 echo "INFO: no target device was specified so using the device (${TARGET_D
EVICE}) from the most recent build" |
| 167 else | 167 else |
| 168 TARGET_DEVICE="arm_v7_thumb" | 168 TARGET_DEVICE="arm_v7_thumb" |
| 169 echo "INFO: no target device type was specified so using the default '${TA
RGET_DEVICE}'" | 169 echo "INFO: no target device type was specified so using the default '${TA
RGET_DEVICE}'" |
| 170 fi | 170 fi |
| 171 fi | 171 fi |
| 172 | 172 |
| 173 case $TARGET_DEVICE in | 173 case $TARGET_DEVICE in |
| 174 nexus_s) | 174 nexus_s) |
| 175 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=
1" | 175 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=
1" |
| 176 DEFINES="${DEFINES} skia_texture_cache_mb_limit=24" | 176 DEFINES="${DEFINES} skia_texture_cache_mb_limit=24" |
| 177 ANDROID_ARCH="arm" | 177 ANDROID_ARCH="arm" |
| 178 ;; | 178 ;; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 echo "The build is targeting the device: $TARGET_DEVICE" | 230 echo "The build is targeting the device: $TARGET_DEVICE" |
| 231 export DEVICE_ID="$TARGET_DEVICE" | 231 export DEVICE_ID="$TARGET_DEVICE" |
| 232 | 232 |
| 233 # Set up the toolchain. | 233 # Set up the toolchain. |
| 234 setup_toolchain | 234 setup_toolchain |
| 235 if [[ "$?" != "0" ]]; then | 235 if [[ "$?" != "0" ]]; then |
| 236 return 1 | 236 return 1 |
| 237 fi | 237 fi |
| 238 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}" | 238 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}" |
| 239 | 239 |
| 240 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
| 241 exportVar GYP_GENERATORS "make-android" |
| 240 exportVar GYP_DEFINES "$DEFINES" | 242 exportVar GYP_DEFINES "$DEFINES" |
| 241 exportVar SKIA_OUT "out/config/android-${TARGET_DEVICE}" | 243 exportVar SKIA_OUT "out/config/android-${TARGET_DEVICE}" |
| 242 } | 244 } |
| 243 | 245 |
| 244 # adb_pull_if_needed(android_src, host_dst) | 246 # adb_pull_if_needed(android_src, host_dst) |
| 245 adb_pull_if_needed() { | 247 adb_pull_if_needed() { |
| 246 | 248 |
| 247 # get adb location | 249 # get adb location |
| 248 source $SCRIPT_DIR/utils/setup_adb.sh | 250 source $SCRIPT_DIR/utils/setup_adb.sh |
| 249 | 251 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 else | 319 else |
| 318 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST | 320 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST |
| 319 fi | 321 fi |
| 320 } | 322 } |
| 321 | 323 |
| 322 # Set up the device. | 324 # Set up the device. |
| 323 setup_device "${DEVICE_ID}" | 325 setup_device "${DEVICE_ID}" |
| 324 if [[ "$?" != "0" ]]; then | 326 if [[ "$?" != "0" ]]; then |
| 325 exit 1 | 327 exit 1 |
| 326 fi | 328 fi |
| OLD | NEW |