PRESUBMIT: Exclude overrides paths from source above GYP check.

Since base.gyp contains a couple of those.

BUG=4185
TESTED=Ran git cl presubmit with a modified base.gyp without this patch - got errors about overrides. Ran another time with this patch applied - no errors.
TBR=pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/44529004

Cr-Commit-Position: refs/heads/master@{#8586}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8586 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org 2015-03-04 07:08:11 +00:00
parent fc2f146af2
commit c98f6f368a

View File

@ -134,10 +134,13 @@ def _CheckNoSourcesAboveGyp(input_api, gyp_files, output_api):
for gyp_file in gyp_files:
contents = input_api.ReadFile(gyp_file)
for source_block_match in source_pattern.finditer(contents):
# Find all source list entries starting with ../ in the source block.
# Find all source list entries starting with ../ in the source block
# (exclude overrides entries).
for file_list_match in file_pattern.finditer(source_block_match.group(0)):
violating_source_entries.append(file_list_match.group(0))
violating_gyp_files.add(gyp_file)
source_file = file_list_match.group(0)
if 'overrides/' not in source_file:
violating_source_entries.append(source_file)
violating_gyp_files.add(gyp_file)
if violating_gyp_files:
return [output_api.PresubmitError(
'Referencing source files above the directory of the GYP file is not '