| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 # Runs the license checker for the WebView build. | 262 # Runs the license checker for the WebView build. |
| 263 # License checker may return error code 1 meaning that |
| 264 # there are non-fatal problems (warnings). Everything |
| 265 # above 1 is considered to be a show-stopper. |
| 263 function bb_check_webview_licenses { | 266 function bb_check_webview_licenses { |
| 264 echo "@@@BUILD_STEP Check licenses for WebView@@@" | 267 echo "@@@BUILD_STEP Check licenses for WebView@@@" |
| 265 ( | 268 ( |
| 266 set +e | 269 set +e |
| 267 cd "${SRC_ROOT}" | 270 cd "${SRC_ROOT}" |
| 268 python android_webview/tools/webview_licenses.py scan | 271 python android_webview/tools/webview_licenses.py scan |
| 269 if [[ $? -ne 0 ]]; then | 272 local licenses_exit_code=$? |
| 273 if [[ $licenses_exit_code -eq 1 ]]; then |
| 270 echo "@@@STEP_WARNINGS@@@" | 274 echo "@@@STEP_WARNINGS@@@" |
| 275 elif [[ $licenses_exit_code -gt 1 ]]; then |
| 276 echo "@@@STEP_FAILURE@@@" |
| 271 fi | 277 fi |
| 272 return 0 | 278 return 0 |
| 273 ) | 279 ) |
| 274 } | 280 } |
| 275 | 281 |
| 276 # Retrieve a packed json property using python | 282 # Retrieve a packed json property using python |
| 277 function bb_get_json_prop { | 283 function bb_get_json_prop { |
| 278 local JSON="$1" | 284 local JSON="$1" |
| 279 local PROP="$2" | 285 local PROP="$2" |
| 280 | 286 |
| 281 python -c "import json; print json.loads('$JSON').get('$PROP', '')" | 287 python -c "import json; print json.loads('$JSON').get('$PROP', '')" |
| 282 } | 288 } |
| OLD | NEW |