Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 'webrtc/video', | 22 'webrtc/video', |
| 23 ] | 23 ] |
| 24 | 24 |
| 25 # List of directories of "supported" native APIs. That means changes to headers | 25 # List of directories of "supported" native APIs. That means changes to headers |
| 26 # will be done in a compatible way following this scheme: | 26 # will be done in a compatible way following this scheme: |
| 27 # 1. Non-breaking changes are made. | 27 # 1. Non-breaking changes are made. |
| 28 # 2. The old APIs as marked as deprecated (with comments). | 28 # 2. The old APIs as marked as deprecated (with comments). |
| 29 # 3. Deprecation is announced to discuss-webrtc@googlegroups.com and | 29 # 3. Deprecation is announced to discuss-webrtc@googlegroups.com and |
| 30 # webrtc-users@google.com (internal list). | 30 # webrtc-users@google.com (internal list). |
| 31 # 4. (later) The deprecated APIs are removed. | 31 # 4. (later) The deprecated APIs are removed. |
| 32 # Directories marked as DEPRECATED should not be used. They're only present in | |
| 33 # the list to support legacy downstream code. | |
| 34 NATIVE_API_DIRS = ( | 32 NATIVE_API_DIRS = ( |
| 35 'talk/app/webrtc', | 33 'talk/app/webrtc', |
|
the sun
2015/12/10 10:56:57
Note that until there is an include/ dir under tal
| |
| 36 'webrtc', | 34 'webrtc', |
| 37 'webrtc/base', # DEPRECATED. | |
| 38 'webrtc/common_audio/include', # DEPRECATED. | |
| 39 'webrtc/modules/audio_coding/include', | 35 'webrtc/modules/audio_coding/include', |
|
the sun
2015/12/10 10:02:20
Move to LEGACY:
webrtc/modules/audio_coding/includ
stefan-webrtc
2015/12/10 10:14:32
No, I'm OK with that. We don't want new projects t
pbos-webrtc
2015/12/10 10:20:01
I think all of video_coding should also go under l
the sun
2015/12/10 10:56:57
Ah, I thought that was required to feed codec inst
| |
| 40 'webrtc/modules/audio_conference_mixer/include', # DEPRECATED. | |
| 41 'webrtc/modules/audio_device/include', | 36 'webrtc/modules/audio_device/include', |
| 42 'webrtc/modules/audio_processing/include', | 37 'webrtc/modules/audio_processing/include', |
| 43 'webrtc/modules/bitrate_controller/include', | 38 'webrtc/modules/bitrate_controller/include', |
| 44 'webrtc/modules/include', | 39 'webrtc/modules/include', |
| 45 'webrtc/modules/remote_bitrate_estimator/include', | 40 'webrtc/modules/remote_bitrate_estimator/include', |
| 46 'webrtc/modules/rtp_rtcp/include', | 41 'webrtc/modules/rtp_rtcp/include', |
| 47 'webrtc/modules/rtp_rtcp/source', # DEPRECATED. | |
| 48 'webrtc/modules/utility/include', | 42 'webrtc/modules/utility/include', |
| 49 'webrtc/modules/video_coding/codecs/h264/include', | 43 'webrtc/modules/video_coding/codecs/h264/include', |
| 50 'webrtc/modules/video_coding/codecs/i420/include', | 44 'webrtc/modules/video_coding/codecs/i420/include', |
| 51 'webrtc/modules/video_coding/codecs/vp8/include', | 45 'webrtc/modules/video_coding/codecs/vp8/include', |
| 52 'webrtc/modules/video_coding/codecs/vp9/include', | 46 'webrtc/modules/video_coding/codecs/vp9/include', |
| 53 'webrtc/modules/video_coding/include', | 47 'webrtc/modules/video_coding/include', |
| 54 'webrtc/system_wrappers/include', # DEPRECATED. | |
| 55 'webrtc/voice_engine/include', | 48 'webrtc/voice_engine/include', |
| 56 ) | 49 ) |
| 50 # These directories should not be used but are maintained only to avoid breaking | |
| 51 # some legacy downstream code. | |
| 52 LEGACY_API_DIRS = ( | |
| 53 'webrtc/base', | |
| 54 'webrtc/common_audio/include', | |
| 55 'webrtc/modules/audio_conference_mixer/include', | |
| 56 'webrtc/modules/rtp_rtcp/source', | |
| 57 'webrtc/system_wrappers/include', | |
| 58 ) | |
| 59 API_DIRS = NATIVE_API_DIRS[:] + LEGACY_API_DIRS[:] | |
| 57 | 60 |
| 58 | 61 |
| 59 def _VerifyNativeApiHeadersListIsValid(input_api, output_api): | 62 def _VerifyNativeApiHeadersListIsValid(input_api, output_api): |
| 60 """Ensures the list of native API header directories is up to date.""" | 63 """Ensures the list of native API header directories is up to date.""" |
| 61 non_existing_paths = [] | 64 non_existing_paths = [] |
| 62 native_api_full_paths = [ | 65 native_api_full_paths = [ |
| 63 input_api.os_path.join(input_api.PresubmitLocalPath(), | 66 input_api.os_path.join(input_api.PresubmitLocalPath(), |
| 64 *path.split('/')) for path in NATIVE_API_DIRS] | 67 *path.split('/')) for path in API_DIRS] |
| 65 for path in native_api_full_paths: | 68 for path in native_api_full_paths: |
| 66 if not os.path.isdir(path): | 69 if not os.path.isdir(path): |
| 67 non_existing_paths.append(path) | 70 non_existing_paths.append(path) |
| 68 if non_existing_paths: | 71 if non_existing_paths: |
| 69 return [output_api.PresubmitError( | 72 return [output_api.PresubmitError( |
| 70 'Directories to native API headers have changed which has made the ' | 73 'Directories to native API headers have changed which has made the ' |
| 71 'list in PRESUBMIT.py outdated.\nPlease update it to the current ' | 74 'list in PRESUBMIT.py outdated.\nPlease update it to the current ' |
| 72 'location of our native APIs.', | 75 'location of our native APIs.', |
| 73 non_existing_paths)] | 76 non_existing_paths)] |
| 74 return [] | 77 return [] |
| 75 | 78 |
| 76 | 79 |
| 77 def _CheckNativeApiHeaderChanges(input_api, output_api): | 80 def _CheckNativeApiHeaderChanges(input_api, output_api): |
| 78 """Checks to remind proper changing of native APIs.""" | 81 """Checks to remind proper changing of native APIs.""" |
| 79 files = [] | 82 files = [] |
| 80 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): | 83 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): |
| 81 if f.LocalPath().endswith('.h'): | 84 if f.LocalPath().endswith('.h'): |
| 82 for path in NATIVE_API_DIRS: | 85 for path in API_DIRS: |
| 83 if os.path.dirname(f.LocalPath()) == path: | 86 if os.path.dirname(f.LocalPath()) == path: |
| 84 files.append(f) | 87 files.append(f) |
| 85 | 88 |
| 86 if files: | 89 if files: |
| 87 return [output_api.PresubmitNotifyResult( | 90 return [output_api.PresubmitNotifyResult( |
| 88 'You seem to be changing native API header files. Please make sure ' | 91 'You seem to be changing native API header files. Please make sure ' |
| 89 'you:\n' | 92 'you:\n' |
| 90 ' 1. Make compatible changes that don\'t break existing clients.\n' | 93 ' 1. Make compatible changes that don\'t break existing clients.\n' |
| 91 ' 2. Mark the old APIs as deprecated.\n' | 94 ' 2. Mark the old APIs as deprecated.\n' |
| 92 ' 3. Create a timeline and plan for when the deprecated method will ' | 95 ' 3. Create a timeline and plan for when the deprecated method will ' |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 for builder in masters[master]: | 460 for builder in masters[master]: |
| 458 if 'presubmit' in builder: | 461 if 'presubmit' in builder: |
| 459 # Do not trigger presubmit builders, since they're likely to fail | 462 # Do not trigger presubmit builders, since they're likely to fail |
| 460 # (e.g. OWNERS checks before finished code review), and we're running | 463 # (e.g. OWNERS checks before finished code review), and we're running |
| 461 # local presubmit anyway. | 464 # local presubmit anyway. |
| 462 pass | 465 pass |
| 463 else: | 466 else: |
| 464 try_config[master][builder] = ['defaulttests'] | 467 try_config[master][builder] = ['defaulttests'] |
| 465 | 468 |
| 466 return try_config | 469 return try_config |
| OLD | NEW |