| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Presubmit script for android buildbot. | 5 """Presubmit script for android buildbot. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
| 8 details on the presubmit API built into depot_tools. | 8 details on the presubmit API built into depot_tools. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 | 11 |
| 12 def CommonChecks(input_api, output_api): | 12 def CommonChecks(input_api, output_api): |
| 13 output = [] | 13 output = [] |
| 14 | 14 |
| 15 build_android_dir = input_api.PresubmitLocalPath() | 15 build_android_dir = input_api.PresubmitLocalPath() |
| 16 | 16 |
| 17 def J(*dirs): | 17 def J(*dirs): |
| 18 """Returns a path relative to presubmit directory.""" | 18 """Returns a path relative to presubmit directory.""" |
| 19 return input_api.os_path.join(build_android_dir, *dirs) | 19 return input_api.os_path.join(build_android_dir, *dirs) |
| 20 | 20 |
| 21 build_pys = [ | 21 build_pys = [ |
| 22 r'gyp/.*\.py$', | 22 r'gyp/.*\.py$', |
| 23 r'gn/.*\.py', | 23 r'gn/.*\.py', |
| 24 r'incremental_install/.*\.py', | 24 r'incremental_install/.*\.py', |
| 25 ] | 25 ] |
| 26 output.extend(input_api.canned_checks.RunPylint( | 26 output.extend(input_api.canned_checks.RunPylint( |
| 27 input_api, | 27 input_api, |
| 28 output_api, | 28 output_api, |
| 29 pylintrc='pylintrc', | 29 pylintrc='pylintrc', |
| 30 # devil and symbols have their own PRESUBMIT.py | 30 # symbols has their own PRESUBMIT.py |
| 31 black_list=build_pys + [r'devil/.*\.py$', r'pylib/symbols/.*\.py$'], | 31 black_list=build_pys + [r'pylib/symbols/.*\.py$'], |
| 32 extra_paths_list=[J(), J('buildbot')])) | 32 extra_paths_list=[ |
| 33 J(), |
| 34 J('buildbot'), |
| 35 J('..', '..', 'third_party', 'catapult', 'devil') |
| 36 ])) |
| 33 output.extend(input_api.canned_checks.RunPylint( | 37 output.extend(input_api.canned_checks.RunPylint( |
| 34 input_api, | 38 input_api, |
| 35 output_api, | 39 output_api, |
| 36 white_list=build_pys, | 40 white_list=build_pys, |
| 37 extra_paths_list=[J('gyp'), J('gn')])) | 41 extra_paths_list=[J('gyp'), J('gn')])) |
| 38 | 42 |
| 39 # Disabled due to http://crbug.com/410936 | 43 # Disabled due to http://crbug.com/410936 |
| 40 #output.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 44 #output.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
| 41 #input_api, output_api, J('buildbot', 'tests'))) | 45 #input_api, output_api, J('buildbot', 'tests'))) |
| 42 | 46 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 | 66 |
| 63 return output | 67 return output |
| 64 | 68 |
| 65 | 69 |
| 66 def CheckChangeOnUpload(input_api, output_api): | 70 def CheckChangeOnUpload(input_api, output_api): |
| 67 return CommonChecks(input_api, output_api) | 71 return CommonChecks(input_api, output_api) |
| 68 | 72 |
| 69 | 73 |
| 70 def CheckChangeOnCommit(input_api, output_api): | 74 def CheckChangeOnCommit(input_api, output_api): |
| 71 return CommonChecks(input_api, output_api) | 75 return CommonChecks(input_api, output_api) |
| OLD | NEW |