.gn files in the API directories are part of the API too...

...since we can break users by changing the build targets they're
using.

BUG=webrtc:8445

Change-Id: Iaa549ce9802bd99639d8b966807ae2db43e7f14b
Reviewed-on: https://webrtc-review.googlesource.com/16460
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20471}
This commit is contained in:
Karl Wiberg 2017-10-27 15:14:20 +02:00 committed by Commit Bot
parent c7b18fef19
commit 6bfac0383f

View File

@ -157,18 +157,19 @@ Related files:
def CheckNativeApiHeaderChanges(input_api, output_api): def CheckNativeApiHeaderChanges(input_api, output_api):
"""Checks to remind proper changing of native APIs.""" """Checks to remind proper changing of native APIs."""
files = [] files = []
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): source_file_filter = lambda x: input_api.FilterSourceFile(
if f.LocalPath().endswith('.h'): x, white_list=[r'.+\.(gn|gni|h)$'])
for path in API_DIRS: for f in input_api.AffectedSourceFiles(source_file_filter):
dn = os.path.dirname(f.LocalPath()) for path in API_DIRS:
if path == 'api': dn = os.path.dirname(f.LocalPath())
# Special case: Subdirectories included. if path == 'api':
if dn == 'api' or dn.startswith('api/'): # Special case: Subdirectories included.
files.append(f) if dn == 'api' or dn.startswith('api/'):
else: files.append(f)
# Normal case: Subdirectories not included. else:
if dn == path: # Normal case: Subdirectories not included.
files.append(f) if dn == path:
files.append(f)
if files: if files:
return [output_api.PresubmitNotifyResult(API_CHANGE_MSG, files)] return [output_api.PresubmitNotifyResult(API_CHANGE_MSG, files)]