Commit 60902e70 authored by dmichael@chromium.org's avatar dmichael@chromium.org

PPAPI: Make API changes w/o IDL changes Warnings if generators have changed

We frequently run in to the situation where we change the generators
which causes some real (but usually minor) change in header files, even
though the IDL is unchanged. We should just warn in that situation, so that
developers can use the CQ for these kind of generator changes.

BUG=

Review URL: https://chromiumcodereview.appspot.com/23620032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222190 0039d316-1c4b-4281-b951-d872f2087c98
parent 4e5582e2
...@@ -159,6 +159,7 @@ def CheckChange(input_api, output_api): ...@@ -159,6 +159,7 @@ def CheckChange(input_api, output_api):
files = input_api.LocalPaths() files = input_api.LocalPaths()
h_files = [] h_files = []
idl_files = [] idl_files = []
generators_changed = False
# Find all relevant .h and .idl files. # Find all relevant .h and .idl files.
for filename in files: for filename in files:
...@@ -166,8 +167,10 @@ def CheckChange(input_api, output_api): ...@@ -166,8 +167,10 @@ def CheckChange(input_api, output_api):
name_parts = name.split(os.sep) name_parts = name.split(os.sep)
if name_parts[0:2] == ['ppapi', 'c'] and ext == '.h': if name_parts[0:2] == ['ppapi', 'c'] and ext == '.h':
h_files.append('/'.join(name_parts[2:])) h_files.append('/'.join(name_parts[2:]))
if name_parts[0:2] == ['ppapi', 'api'] and ext == '.idl': elif name_parts[0:2] == ['ppapi', 'api'] and ext == '.idl':
idl_files.append('/'.join(name_parts[2:])) idl_files.append('/'.join(name_parts[2:]))
elif name_parts[0:2] == ['ppapi', 'generators']:
generators_changed = True
# Generate a list of all appropriate *.h and *.idl changes in this CL. # Generate a list of all appropriate *.h and *.idl changes in this CL.
both = h_files + idl_files both = h_files + idl_files
...@@ -247,10 +250,20 @@ def CheckChange(input_api, output_api): ...@@ -247,10 +250,20 @@ def CheckChange(input_api, output_api):
long_text='\n'.join(missing_dev))) long_text='\n'.join(missing_dev)))
if missing_stable: if missing_stable:
results.append( # It might be okay that the header changed without a corresponding IDL
output_api.PresubmitError( # change. E.g., comment indenting may have been changed. Treat this as a
'Missing PPAPI IDL for stable interface:', # warning.
long_text='\n'.join(missing_stable))) if generators_changed:
results.append(
output_api.PresubmitPromptWarning(
'Missing PPAPI IDL for stable interface (due to change in ' +
'generators?):',
long_text='\n'.join(missing_stable)))
else:
results.append(
output_api.PresubmitError(
'Missing PPAPI IDL for stable interface:',
long_text='\n'.join(missing_stable)))
# Verify all *.h files match *.idl definitions, use: # Verify all *.h files match *.idl definitions, use:
# --test to prevent output to disk # --test to prevent output to disk
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment