Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: PRESUBMIT.py

Issue 1513483006: PRESUBMIT: Split NATIVE_API_DIRS into two lists. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased, addressed comments and added webrtc/api, webrtc/media and webrtc/pc Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 'webrtc/video', 31 'webrtc/video',
32 ] 32 ]
33 33
34 # List of directories of "supported" native APIs. That means changes to headers 34 # List of directories of "supported" native APIs. That means changes to headers
35 # will be done in a compatible way following this scheme: 35 # will be done in a compatible way following this scheme:
36 # 1. Non-breaking changes are made. 36 # 1. Non-breaking changes are made.
37 # 2. The old APIs as marked as deprecated (with comments). 37 # 2. The old APIs as marked as deprecated (with comments).
38 # 3. Deprecation is announced to discuss-webrtc@googlegroups.com and 38 # 3. Deprecation is announced to discuss-webrtc@googlegroups.com and
39 # webrtc-users@google.com (internal list). 39 # webrtc-users@google.com (internal list).
40 # 4. (later) The deprecated APIs are removed. 40 # 4. (later) The deprecated APIs are removed.
41 # Directories marked as DEPRECATED should not be used. They're only present in
42 # the list to support legacy downstream code.
43 NATIVE_API_DIRS = ( 41 NATIVE_API_DIRS = (
42 'webrtc',
43 'webrtc/api',
44 'webrtc/media',
45 'webrtc/modules/audio_device/include',
46 'webrtc/pc',
47 )
48 # These directories should not be used but are maintained only to avoid breaking
49 # some legacy downstream code.
pthatcher1 2016/05/12 03:43:13 We should point out that if something in the NATIV
the sun 2016/05/12 12:42:41 I don't think we need to point that out at this ti
50 LEGACY_API_DIRS = (
44 'talk/app/webrtc', 51 'talk/app/webrtc',
45 'webrtc', 52 'webrtc/base',
46 'webrtc/base', # DEPRECATED. 53 'webrtc/common_audio/include',
47 'webrtc/common_audio/include', # DEPRECATED.
48 'webrtc/modules/audio_coding/include', 54 'webrtc/modules/audio_coding/include',
49 'webrtc/modules/audio_conference_mixer/include', # DEPRECATED. 55 'webrtc/modules/audio_conference_mixer/include',
50 'webrtc/modules/audio_device/include',
51 'webrtc/modules/audio_processing/include', 56 'webrtc/modules/audio_processing/include',
52 'webrtc/modules/bitrate_controller/include', 57 'webrtc/modules/bitrate_controller/include',
53 'webrtc/modules/include', 58 'webrtc/modules/include',
54 'webrtc/modules/remote_bitrate_estimator/include', 59 'webrtc/modules/remote_bitrate_estimator/include',
55 'webrtc/modules/rtp_rtcp/include', 60 'webrtc/modules/rtp_rtcp/include',
56 'webrtc/modules/rtp_rtcp/source', # DEPRECATED. 61 'webrtc/modules/rtp_rtcp/source',
57 'webrtc/modules/utility/include', 62 'webrtc/modules/utility/include',
58 'webrtc/modules/video_coding/codecs/h264/include', 63 'webrtc/modules/video_coding/codecs/h264/include',
59 'webrtc/modules/video_coding/codecs/i420/include', 64 'webrtc/modules/video_coding/codecs/i420/include',
60 'webrtc/modules/video_coding/codecs/vp8/include', 65 'webrtc/modules/video_coding/codecs/vp8/include',
61 'webrtc/modules/video_coding/codecs/vp9/include', 66 'webrtc/modules/video_coding/codecs/vp9/include',
62 'webrtc/modules/video_coding/include', 67 'webrtc/modules/video_coding/include',
63 'webrtc/system_wrappers/include', # DEPRECATED. 68 'webrtc/system_wrappers/include',
64 'webrtc/voice_engine/include', 69 'webrtc/voice_engine/include',
65 ) 70 )
71 API_DIRS = NATIVE_API_DIRS[:] + LEGACY_API_DIRS[:]
66 72
67 73
68 def _VerifyNativeApiHeadersListIsValid(input_api, output_api): 74 def _VerifyNativeApiHeadersListIsValid(input_api, output_api):
69 """Ensures the list of native API header directories is up to date.""" 75 """Ensures the list of native API header directories is up to date."""
70 non_existing_paths = [] 76 non_existing_paths = []
71 native_api_full_paths = [ 77 native_api_full_paths = [
72 input_api.os_path.join(input_api.PresubmitLocalPath(), 78 input_api.os_path.join(input_api.PresubmitLocalPath(),
73 *path.split('/')) for path in NATIVE_API_DIRS] 79 *path.split('/')) for path in API_DIRS]
74 for path in native_api_full_paths: 80 for path in native_api_full_paths:
75 if not os.path.isdir(path): 81 if not os.path.isdir(path):
76 non_existing_paths.append(path) 82 non_existing_paths.append(path)
77 if non_existing_paths: 83 if non_existing_paths:
78 return [output_api.PresubmitError( 84 return [output_api.PresubmitError(
79 'Directories to native API headers have changed which has made the ' 85 'Directories to native API headers have changed which has made the '
80 'list in PRESUBMIT.py outdated.\nPlease update it to the current ' 86 'list in PRESUBMIT.py outdated.\nPlease update it to the current '
81 'location of our native APIs.', 87 'location of our native APIs.',
82 non_existing_paths)] 88 non_existing_paths)]
83 return [] 89 return []
84 90
85 91
86 def _CheckNativeApiHeaderChanges(input_api, output_api): 92 def _CheckNativeApiHeaderChanges(input_api, output_api):
87 """Checks to remind proper changing of native APIs.""" 93 """Checks to remind proper changing of native APIs."""
88 files = [] 94 files = []
89 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): 95 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
90 if f.LocalPath().endswith('.h'): 96 if f.LocalPath().endswith('.h'):
91 for path in NATIVE_API_DIRS: 97 for path in API_DIRS:
92 if os.path.dirname(f.LocalPath()) == path: 98 if os.path.dirname(f.LocalPath()) == path:
93 files.append(f) 99 files.append(f)
94 100
95 if files: 101 if files:
96 return [output_api.PresubmitNotifyResult( 102 return [output_api.PresubmitNotifyResult(
97 'You seem to be changing native API header files. Please make sure ' 103 'You seem to be changing native API header files. Please make sure '
98 'you:\n' 104 'you:\n'
99 ' 1. Make compatible changes that don\'t break existing clients.\n' 105 ' 1. Make compatible changes that don\'t break existing clients.\n'
100 ' 2. Mark the old APIs as deprecated.\n' 106 ' 2. Mark the old APIs as deprecated.\n'
101 ' 3. Create a timeline and plan for when the deprecated method will ' 107 ' 3. Create a timeline and plan for when the deprecated method will '
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 for builder in masters[master]: 501 for builder in masters[master]:
496 if 'presubmit' in builder: 502 if 'presubmit' in builder:
497 # Do not trigger presubmit builders, since they're likely to fail 503 # Do not trigger presubmit builders, since they're likely to fail
498 # (e.g. OWNERS checks before finished code review), and we're running 504 # (e.g. OWNERS checks before finished code review), and we're running
499 # local presubmit anyway. 505 # local presubmit anyway.
500 pass 506 pass
501 else: 507 else:
502 try_config[master][builder] = ['defaulttests'] 508 try_config[master][builder] = ['defaulttests']
503 509
504 return try_config 510 return try_config
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698