diff options
-rw-r--r-- | ppapi/PRESUBMIT.py | 2 | ||||
-rwxr-xr-x | ppapi/generators/generator.py | 2 | ||||
-rw-r--r-- | ppapi/generators/idl_generator.py | 11 |
3 files changed, 12 insertions, 3 deletions
diff --git a/ppapi/PRESUBMIT.py b/ppapi/PRESUBMIT.py index 61b1da0..90b809c 100644 --- a/ppapi/PRESUBMIT.py +++ b/ppapi/PRESUBMIT.py @@ -47,7 +47,7 @@ def CheckChange(input_api, output_api): # --out to pick which files to examine (only the ones in the CL) ppapi_dir = input_api.PresubmitLocalPath() cmd = [ sys.executable, 'generator.py', - '--wnone', '--diff', '--test','--cgen', '--range=M13,M16'] + '--wnone', '--diff', '--test','--cgen', '--range=start,end'] # Only generate output for IDL files references (as *.h or *.idl) in this CL cmd.append('--out=' + ','.join([name + '.idl' for name in both])) diff --git a/ppapi/generators/generator.py b/ppapi/generators/generator.py index 00e85ac..a6065cd 100755 --- a/ppapi/generators/generator.py +++ b/ppapi/generators/generator.py @@ -26,7 +26,7 @@ if __name__ == '__main__': # If no arguments are provided, assume we are tring to rebuild the # C headers with warnings off. - if not args: args = ['--wnone', '--cgen', '--range=M13,M16'] + if not args: args = ['--wnone', '--cgen', '--range=start,end'] sys.exit(Main(args)) diff --git a/ppapi/generators/idl_generator.py b/ppapi/generators/idl_generator.py index d438808..e6149ec 100644 --- a/ppapi/generators/idl_generator.py +++ b/ppapi/generators/idl_generator.py @@ -12,7 +12,7 @@ from idl_option import GetOption, Option, ParseOptions GeneratorList = [] Option('release', 'Which release to generate.', default='') -Option('range', 'Which ranges in the form of MIN,MAX.', default='M13,M16') +Option('range', 'Which ranges in the form of MIN,MAX.', default='start,end') # @@ -66,6 +66,8 @@ class Generator(object): rangestr = GetOption('range') releasestr = GetOption('release') + print "Found releases: %s" % ast.releases + # Check for a range option which over-rides a release option if not releasestr and rangestr: range_list = rangestr.split(',') @@ -75,6 +77,13 @@ class Generator(object): else: vmin = range_list[0] vmax = range_list[1] + + # Generate 'start' and 'end' represent first and last found. + if vmin == 'start': + vmin = ast.releases[0] + if vmax == 'end': + vmax = ast.releases[-1] + vmin = ast.releases.index(vmin) vmax = ast.releases.index(vmax) + 1 range = ast.releases[vmin:vmax] |