OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Top-level presubmit script for Chromium. | 5 """Top-level presubmit script for Chromium. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into gcl. | 8 for more details about the presubmit API built into gcl. |
9 """ | 9 """ |
10 | 10 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 input_api, output_api)) | 301 input_api, output_api)) |
302 results.extend(_CheckSubversionConfig(input_api, output_api)) | 302 results.extend(_CheckSubversionConfig(input_api, output_api)) |
303 return results | 303 return results |
304 | 304 |
305 | 305 |
306 def GetPreferredTrySlaves(project, change): | 306 def GetPreferredTrySlaves(project, change): |
307 affected_files = change.LocalPaths() | 307 affected_files = change.LocalPaths() |
308 only_objc_files = all(f.endswith(('.mm', '.m')) for f in affected_files) | 308 only_objc_files = all(f.endswith(('.mm', '.m')) for f in affected_files) |
309 if only_objc_files: | 309 if only_objc_files: |
310 return ['mac_rel'] | 310 return ['mac_rel'] |
311 preferred = ['win_rel', 'linux_rel', 'mac_rel', 'android'] | 311 preferred = ['win_rel', 'linux_rel', 'mac_rel'] |
312 if any(f.endswith(('.h', '.cc', '.cpp', '.cxx')) for f in affected_files): | 312 if any(f.endswith(('.h', '.cc', '.cpp', '.cxx')) for f in affected_files): |
313 preferred.append('linux_clang') | 313 preferred.append('linux_clang') |
314 aura_re = '_aura[^/]*[.][^/]*' | 314 aura_re = '_aura[^/]*[.][^/]*' |
315 if any(re.search(aura_re, f) for f in affected_files): | 315 if any(re.search(aura_re, f) for f in affected_files): |
316 preferred.append('linux_chromeos') | 316 preferred.append('linux_chromeos') |
317 # Nothing in chrome/ | |
318 android_re_list = ('^base/', '^ipc/', '^net/', '^sql/', '^jingle/', | |
M-A Ruel
2012/03/01 21:21:40
Can you put them one per line in sorted order?
| |
319 '^content/', '^media/', | |
320 '^build/common.gypi$') | |
321 # Nothing that looks like win-only or aura-only | |
322 win_re = '_win\.(cc|h)$' | |
323 possibly_android = True | |
324 for non_android_re in (aura_re, win_re): | |
M-A Ruel
2012/03/01 21:21:40
if any(
all(re.search(r, f) for f in affected_
| |
325 if all(re.search(non_android_re, f) for f in affected_files): | |
326 possibly_android = False | |
327 break | |
328 if possibly_android: | |
329 for f in change.AffectedFiles(): | |
330 if any(re.search(r, f.LocalPath()) for r in android_re_list): | |
331 preferred.append('android') | |
332 break | |
317 return preferred | 333 return preferred |
OLD | NEW |