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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 export GOMA_DIR=/b/build/goma | 57 export GOMA_DIR=/b/build/goma |
58 . build/android/envsetup.sh | 58 . build/android/envsetup.sh |
59 | 59 |
60 local extra_gyp_defines="$(bb_get_json_prop "$FACTORY_PROPERTIES" \ | 60 local extra_gyp_defines="$(bb_get_json_prop "$FACTORY_PROPERTIES" \ |
61 extra_gyp_defines)" | 61 extra_gyp_defines)" |
62 export GYP_DEFINES+=" fastbuild=1 $extra_gyp_defines" | 62 export GYP_DEFINES+=" fastbuild=1 $extra_gyp_defines" |
63 if echo $extra_gyp_defines | grep -qE 'clang|asan'; then | 63 if echo $extra_gyp_defines | grep -qE 'clang|asan'; then |
64 unset CXX_target | 64 unset CXX_target |
65 fi | 65 fi |
66 | 66 |
67 adb kill-server | |
68 adb start-server | |
69 | |
70 local build_path="${SRC_ROOT}/out/${BUILDTYPE}" | 67 local build_path="${SRC_ROOT}/out/${BUILDTYPE}" |
71 local landmines_triggered_path="$build_path/.landmines_triggered" | 68 local landmines_triggered_path="$build_path/.landmines_triggered" |
72 python "$SRC_ROOT/build/landmines.py" | 69 python "$SRC_ROOT/build/landmines.py" |
73 | 70 |
74 if [[ $BUILDBOT_CLOBBER || -f "$landmines_triggered_path" ]]; then | 71 if [[ $BUILDBOT_CLOBBER || -f "$landmines_triggered_path" ]]; then |
75 echo "@@@BUILD_STEP Clobber@@@" | 72 echo "@@@BUILD_STEP Clobber@@@" |
76 | 73 |
77 if [[ -z $BUILDBOT_CLOBBER ]]; then | 74 if [[ -z $BUILDBOT_CLOBBER ]]; then |
78 echo "Clobbering due to triggered landmines: " | 75 echo "Clobbering due to triggered landmines: " |
79 cat "$landmines_triggered_path" | 76 cat "$landmines_triggered_path" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 return | 396 return |
400 fi | 397 fi |
401 return $extract_exit_code | 398 return $extract_exit_code |
402 ) | 399 ) |
403 } | 400 } |
404 | 401 |
405 # Reboot all phones and wait for them to start back up | 402 # Reboot all phones and wait for them to start back up |
406 # Does not break build if a phone fails to restart | 403 # Does not break build if a phone fails to restart |
407 function bb_reboot_phones { | 404 function bb_reboot_phones { |
408 echo "@@@BUILD_STEP Rebooting phones@@@" | 405 echo "@@@BUILD_STEP Rebooting phones@@@" |
| 406 # Restart adb to work around bugs, sleep to wait for usb discovery. |
| 407 adb kill-server |
| 408 adb start-server |
| 409 sleep .5 |
| 410 |
409 ( | 411 ( |
410 set +e | 412 set +e |
411 cd $CHROME_SRC/build/android/pylib; | 413 cd $CHROME_SRC/build/android/pylib; |
412 for DEVICE in $(adb_get_devices); do | 414 for DEVICE in $(adb_get_devices); do |
413 python -c "import android_commands;\ | 415 python -c "import android_commands;\ |
414 android_commands.AndroidCommands(device='$DEVICE').Reboot(True)" & | 416 android_commands.AndroidCommands(device='$DEVICE').Reboot(True)" & |
415 done | 417 done |
416 wait | 418 wait |
417 ) | 419 ) |
418 } | 420 } |
(...skipping 12 matching lines...) Expand all Loading... |
431 ) | 433 ) |
432 } | 434 } |
433 | 435 |
434 # Retrieve a packed json property using python | 436 # Retrieve a packed json property using python |
435 function bb_get_json_prop { | 437 function bb_get_json_prop { |
436 local JSON="$1" | 438 local JSON="$1" |
437 local PROP="$2" | 439 local PROP="$2" |
438 | 440 |
439 python -c "import json; print json.loads('$JSON').get('$PROP', '')" | 441 python -c "import json; print json.loads('$JSON').get('$PROP', '')" |
440 } | 442 } |
OLD | NEW |