| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # | 5 # |
| 6 # Bash functions used by buildbot annotator scripts for the android | 6 # Bash functions used by buildbot annotator scripts for the android |
| 7 # build of chromium. Executing this script should not perform actions | 7 # build of chromium. Executing this script should not perform actions |
| 8 # other than setting variables and defining of functions. | 8 # other than setting variables and defining of functions. |
| 9 | 9 |
| 10 # Number of jobs on the compile line; e.g. make -j"${JOBS}" | 10 # Number of jobs on the compile line; e.g. make -j"${JOBS}" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 --build-properties "$BUILD_PROPERTIES" | 252 --build-properties "$BUILD_PROPERTIES" |
| 253 local extract_exit_code=$? | 253 local extract_exit_code=$? |
| 254 if (( $extract_exit_code > 1 )); then | 254 if (( $extract_exit_code > 1 )); then |
| 255 echo "@@@STEP_WARNINGS@@@" | 255 echo "@@@STEP_WARNINGS@@@" |
| 256 return | 256 return |
| 257 fi | 257 fi |
| 258 return $extract_exit_code | 258 return $extract_exit_code |
| 259 ) | 259 ) |
| 260 } | 260 } |
| 261 | 261 |
| 262 # Reboot all phones and wait for them to start back up | |
| 263 # Does not break build if a phone fails to restart | |
| 264 function bb_reboot_phones { | |
| 265 echo "@@@BUILD_STEP Rebooting phones@@@" | |
| 266 # Restart adb to work around bugs, sleep to wait for usb discovery. | |
| 267 adb kill-server | |
| 268 adb start-server | |
| 269 sleep .5 | |
| 270 | |
| 271 ( | |
| 272 set +e | |
| 273 cd $CHROME_SRC/build/android/pylib; | |
| 274 for DEVICE in $(adb_get_devices); do | |
| 275 python -c "import android_commands;\ | |
| 276 android_commands.AndroidCommands(device='$DEVICE').Reboot(True)" & | |
| 277 done | |
| 278 wait | |
| 279 ) | |
| 280 } | |
| 281 | |
| 282 # Runs the license checker for the WebView build. | 262 # Runs the license checker for the WebView build. |
| 283 function bb_check_webview_licenses { | 263 function bb_check_webview_licenses { |
| 284 echo "@@@BUILD_STEP Check licenses for WebView@@@" | 264 echo "@@@BUILD_STEP Check licenses for WebView@@@" |
| 285 ( | 265 ( |
| 286 set +e | 266 set +e |
| 287 cd "${SRC_ROOT}" | 267 cd "${SRC_ROOT}" |
| 288 python android_webview/tools/webview_licenses.py scan | 268 python android_webview/tools/webview_licenses.py scan |
| 289 if [[ $? -ne 0 ]]; then | 269 if [[ $? -ne 0 ]]; then |
| 290 echo "@@@STEP_WARNINGS@@@" | 270 echo "@@@STEP_WARNINGS@@@" |
| 291 fi | 271 fi |
| 292 return 0 | 272 return 0 |
| 293 ) | 273 ) |
| 294 } | 274 } |
| 295 | 275 |
| 296 # Retrieve a packed json property using python | 276 # Retrieve a packed json property using python |
| 297 function bb_get_json_prop { | 277 function bb_get_json_prop { |
| 298 local JSON="$1" | 278 local JSON="$1" |
| 299 local PROP="$2" | 279 local PROP="$2" |
| 300 | 280 |
| 301 python -c "import json; print json.loads('$JSON').get('$PROP', '')" | 281 python -c "import json; print json.loads('$JSON').get('$PROP', '')" |
| 302 } | 282 } |
| OLD | NEW |