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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 input_api, output_api)) | 321 input_api, output_api)) |
322 results.extend(_CheckSubversionConfig(input_api, output_api)) | 322 results.extend(_CheckSubversionConfig(input_api, output_api)) |
323 return results | 323 return results |
324 | 324 |
325 | 325 |
326 def GetPreferredTrySlaves(project, change): | 326 def GetPreferredTrySlaves(project, change): |
327 affected_files = change.LocalPaths() | 327 affected_files = change.LocalPaths() |
328 only_objc_files = all(f.endswith(('.mm', '.m')) for f in affected_files) | 328 only_objc_files = all(f.endswith(('.mm', '.m')) for f in affected_files) |
329 if only_objc_files: | 329 if only_objc_files: |
330 return ['mac_rel'] | 330 return ['mac_rel'] |
331 preferred = ['win_rel', 'linux_rel', 'mac_rel'] | 331 preferred = ['win_rel', 'linux_rel', 'mac_rel', 'linux_clang:compile'] |
332 preferred = ['win_rel', 'linux_rel', 'mac_rel', 'linux_clang'] | |
333 if any(f.endswith(('.h', '.cc', '.cpp', '.cxx')) for f in affected_files): | |
334 preferred.append('linux_clang') | |
335 aura_re = '_aura[^/]*[.][^/]*' | 332 aura_re = '_aura[^/]*[.][^/]*' |
336 if any(re.search(aura_re, f) for f in affected_files): | 333 if any(re.search(aura_re, f) for f in affected_files): |
337 preferred.append('linux_chromeos') | 334 preferred.append('linux_chromeos') |
338 # Nothing in chrome/ | 335 # Nothing in chrome/ |
339 android_re_list = ('^base/', | 336 android_re_list = ('^base/', |
340 '^build/common.gypi$', | 337 '^build/common.gypi$', |
341 '^content/', | 338 '^content/', |
342 '^ipc/', | 339 '^ipc/', |
343 '^jingle/', | 340 '^jingle/', |
344 '^media/', | 341 '^media/', |
345 '^net/', | 342 '^net/', |
346 '^sql/') | 343 '^sql/') |
347 # Nothing that looks like win-only or aura-only | 344 # Nothing that looks like win-only or aura-only |
348 win_re = '_win\.(cc|h)$' | 345 win_re = '_win\.(cc|h)$' |
349 possibly_android = True | 346 possibly_android = True |
350 for non_android_re in (aura_re, win_re): | 347 for non_android_re in (aura_re, win_re): |
351 if all(re.search(non_android_re, f) for f in affected_files): | 348 if all(re.search(non_android_re, f) for f in affected_files): |
352 possibly_android = False | 349 possibly_android = False |
353 break | 350 break |
354 if possibly_android: | 351 if possibly_android: |
355 for f in change.AffectedFiles(): | 352 for f in change.AffectedFiles(): |
356 if any(re.search(r, f.LocalPath()) for r in android_re_list): | 353 if any(re.search(r, f.LocalPath()) for r in android_re_list): |
357 preferred.append('android') | 354 preferred.append('android') |
358 break | 355 break |
359 return preferred | 356 return preferred |
OLD | NEW |