Chromium Code Reviews| Index: PRESUBMIT.py |
| diff --git a/PRESUBMIT.py b/PRESUBMIT.py |
| index a832761c89dbd05a4205729a132260d5df334b22..76314dc24101d2248cf17c1f259b30a1cbf5d91b 100755 |
| --- a/PRESUBMIT.py |
| +++ b/PRESUBMIT.py |
| @@ -14,6 +14,73 @@ import subprocess |
| import sys |
| +NATIVE_API_DIRS = ( |
| + 'talk/app/webrtc', |
| + 'webrtc', |
| + 'webrtc/common_audio/include', # DEPRECATED (will go away). |
|
Andrew MacDonald
2015/11/25 19:10:40
I think there are several users of common_audio. A
kjellander_webrtc
2015/11/25 22:16:51
Yes, but AFAIK the plan is to get rid of that and
Andrew MacDonald
2015/11/25 23:09:53
OK. +aluebs for visibility as I believe beamer/ is
aluebs-webrtc
2015/11/25 23:54:45
Yes, common_audio is extensively used in beamer, i
kjellander_webrtc
2015/11/26 08:37:53
Please discuss this with Henrik L (added to review
|
| + 'webrtc/modules/audio_coding/main/include', |
|
Andrew MacDonald
2015/11/25 19:10:40
nit: Before we publish this as an "official" direc
kjellander_webrtc
2015/11/25 22:16:51
Alright, I'll take care of this one too. I created
Andrew MacDonald
2015/11/25 23:09:53
Thanks! RIP main.
|
| + 'webrtc/modules/audio_conference_mixer/include', # DEPRECATED (will go away). |
| + 'webrtc/modules/audio_device/include', |
| + 'webrtc/modules/audio_processing/include', |
| + 'webrtc/modules/bitrate_controller/include', |
| + 'webrtc/modules/include', |
| + 'webrtc/modules/remote_bitrate_estimator/include', |
| + 'webrtc/modules/rtp_rtcp/include', |
| + 'webrtc/modules/rtp_rtcp/source', # DEPRECATED (will go away). |
| + 'webrtc/modules/utility/include', |
| + 'webrtc/modules/video_coding/codecs/h264/include', |
| + 'webrtc/modules/video_coding/codecs/i420/include', |
| + 'webrtc/modules/video_coding/codecs/vp8/include', |
| + 'webrtc/modules/video_coding/codecs/vp9/include', |
| + 'webrtc/modules/video_coding/include', |
| + 'webrtc/system_wrappers/include', |
| + 'webrtc/voice_engine/include', |
| +) |
| + |
| + |
| +def _VerifyNativeApiHeadersListIsValid(input_api, output_api): |
| + """Ensures the list of native API header directories is up to date.""" |
| + non_existing_paths = [] |
| + native_api_full_paths = [ |
| + input_api.os_path.join(input_api.PresubmitLocalPath(), |
| + *path.split('/')) for path in NATIVE_API_DIRS] |
| + for path in native_api_full_paths: |
| + if not os.path.isdir(path): |
| + non_existing_paths.append(path) |
| + if non_existing_paths: |
| + return [output_api.PresubmitError( |
| + 'Directories to native API headers have changed which has made the ' |
| + 'list in PRESUBMIT.py outdated.\nPlease update it to the current ' |
| + 'location of our native APIs.', |
| + non_existing_paths)] |
| + return [] |
| + |
| + |
| +def _CheckNativeApiHeaderChanges(input_api, output_api): |
| + """Checks to remind proper changing of native APIs.""" |
| + files = [] |
| + for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): |
| + if f.LocalPath().endswith('.h'): |
| + for path in NATIVE_API_DIRS: |
| + if os.path.dirname(f.LocalPath()) == path: |
| + files.append(f) |
| + |
| + if files: |
| + return [output_api.PresubmitPromptWarning( |
| + 'You seem to be changing native API header files. Please make sure ' |
| + 'you:\n' |
| + ' 1. Make compatible changes that doesn\'t break existing clients.\n' |
| + ' 2. Mark the old APIs as deprecated.\n' |
| + ' 3. Create a timeline and plan for when the deprecated method will ' |
| + 'be removed.\n' |
| + ' 4. Update/inform existing clients to update their code to the new ' |
|
phoglund
2015/11/26 09:52:07
There is really no way for anyone to know what the
Andrew MacDonald
2015/11/26 17:13:20
And probably webrtc-users, since I doubt many Goog
kjellander_webrtc
2015/11/27 07:06:59
Right, I guess externals cannot post to this list
|
| + 'API.\n' |
| + ' 5. (much later) remove the deprecated API.\n' |
| + 'Related files:', |
| + files)] |
| + return [] |
| + |
| + |
| def _CheckNoIOStreamInHeaders(input_api, output_api): |
| """Checks to make sure no .h files include <iostream>.""" |
| files = [] |
| @@ -299,6 +366,7 @@ def _CommonChecks(input_api, output_api): |
| results.extend(input_api.canned_checks.CheckChangeTodoHasOwner( |
| input_api, output_api)) |
| results.extend(_CheckApprovedFilesLintClean(input_api, output_api)) |
| + results.extend(_CheckNativeApiHeaderChanges(input_api, output_api)) |
| results.extend(_CheckNoIOStreamInHeaders(input_api, output_api)) |
| results.extend(_CheckNoFRIEND_TEST(input_api, output_api)) |
| results.extend(_CheckGypChanges(input_api, output_api)) |
| @@ -318,6 +386,7 @@ def CheckChangeOnUpload(input_api, output_api): |
| def CheckChangeOnCommit(input_api, output_api): |
| results = [] |
| results.extend(_CommonChecks(input_api, output_api)) |
| + results.extend(_VerifyNativeApiHeadersListIsValid(input_api, output_api)) |
| results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) |
| results.extend(input_api.canned_checks.CheckChangeWasUploaded( |
| input_api, output_api)) |