| OLD | NEW |
| 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
| 4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
| 5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
| 6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
| 7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
| 8 | 8 |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 res_type = output_api.PresubmitPromptWarning | 228 res_type = output_api.PresubmitPromptWarning |
| 229 result = [res_type('Changelist failed cpplint.py check.')] | 229 result = [res_type('Changelist failed cpplint.py check.')] |
| 230 | 230 |
| 231 return result | 231 return result |
| 232 | 232 |
| 233 def _CheckNoRtcBaseDeps(input_api, gyp_files, output_api): | 233 def _CheckNoRtcBaseDeps(input_api, gyp_files, output_api): |
| 234 pattern = input_api.re.compile(r"base.gyp:rtc_base\s*'") | 234 pattern = input_api.re.compile(r"base.gyp:rtc_base\s*'") |
| 235 violating_files = [] | 235 violating_files = [] |
| 236 for f in gyp_files: | 236 for f in gyp_files: |
| 237 gyp_exceptions = ( | 237 gyp_exceptions = ( |
| 238 'audio_device.gypi', |
| 238 'base_tests.gyp', | 239 'base_tests.gyp', |
| 239 'desktop_capture.gypi', | 240 'desktop_capture.gypi', |
| 240 'p2p.gyp', | 241 'p2p.gyp', |
| 241 'sdk.gyp', | 242 'sdk.gyp', |
| 242 'webrtc_test_common.gyp', | 243 'webrtc_test_common.gyp', |
| 243 'webrtc_tests.gypi', | 244 'webrtc_tests.gypi', |
| 244 ) | 245 ) |
| 245 if f.LocalPath().endswith(gyp_exceptions): | 246 if f.LocalPath().endswith(gyp_exceptions): |
| 246 continue | 247 continue |
| 247 contents = input_api.ReadFile(f) | 248 contents = input_api.ReadFile(f) |
| 248 if pattern.search(contents): | 249 if pattern.search(contents): |
| 249 violating_files.append(f) | 250 violating_files.append(f) |
| 250 if violating_files: | 251 if violating_files: |
| 251 return [output_api.PresubmitError( | 252 return [output_api.PresubmitError( |
| 252 'Depending on rtc_base is not allowed. Change your dependency to ' | 253 'Depending on rtc_base is not allowed. Change your dependency to ' |
| 253 'rtc_base_approved and possibly sanitize and move the desired source ' | 254 'rtc_base_approved and possibly sanitize and move the desired source ' |
| 254 'file(s) to rtc_base_approved.\nChanged GYP files:', | 255 'file(s) to rtc_base_approved.\nChanged GYP files:', |
| 255 items=violating_files)] | 256 items=violating_files)] |
| 256 return [] | 257 return [] |
| 257 | 258 |
| 258 def _CheckNoRtcBaseDepsGn(input_api, gn_files, output_api): | 259 def _CheckNoRtcBaseDepsGn(input_api, gn_files, output_api): |
| 259 pattern = input_api.re.compile(r'base:rtc_base\s*"') | 260 pattern = input_api.re.compile(r'base:rtc_base\s*"') |
| 260 violating_files = [] | 261 violating_files = [] |
| 261 for f in gn_files: | 262 for f in gn_files: |
| 262 gn_exceptions = ( | 263 gn_exceptions = ( |
| 264 os.path.join('audio_device', 'BUILD.gn'), |
| 263 os.path.join('base_tests', 'BUILD.gn'), | 265 os.path.join('base_tests', 'BUILD.gn'), |
| 264 os.path.join('desktop_capture', 'BUILD.gn'), | 266 os.path.join('desktop_capture', 'BUILD.gn'), |
| 265 os.path.join('p2p', 'BUILD.gn'), | 267 os.path.join('p2p', 'BUILD.gn'), |
| 266 os.path.join('sdk', 'BUILD.gn'), | 268 os.path.join('sdk', 'BUILD.gn'), |
| 267 os.path.join('webrtc_test_common', 'BUILD.gn'), | 269 os.path.join('webrtc_test_common', 'BUILD.gn'), |
| 268 os.path.join('webrtc_tests', 'BUILD.gn'), | 270 os.path.join('webrtc_tests', 'BUILD.gn'), |
| 269 | 271 |
| 270 # TODO(ehmaldonado): Clean up references to rtc_base in these files. | 272 # TODO(ehmaldonado): Clean up references to rtc_base in these files. |
| 271 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3806 | 273 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3806 |
| 272 os.path.join('webrtc', 'BUILD.gn'), | 274 os.path.join('webrtc', 'BUILD.gn'), |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 for builder in masters[master]: | 623 for builder in masters[master]: |
| 622 if 'presubmit' in builder: | 624 if 'presubmit' in builder: |
| 623 # Do not trigger presubmit builders, since they're likely to fail | 625 # Do not trigger presubmit builders, since they're likely to fail |
| 624 # (e.g. OWNERS checks before finished code review), and we're running | 626 # (e.g. OWNERS checks before finished code review), and we're running |
| 625 # local presubmit anyway. | 627 # local presubmit anyway. |
| 626 pass | 628 pass |
| 627 else: | 629 else: |
| 628 try_config[master][builder] = ['defaulttests'] | 630 try_config[master][builder] = ['defaulttests'] |
| 629 | 631 |
| 630 return try_config | 632 return try_config |
| OLD | NEW |