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

Unified Diff: third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py

Issue 2259463002: [Bindings] Specify if we aggregate partial interfaces by arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
diff --git a/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py b/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
index 19c7d43282152b6fa5e224c2af611d0aa7f36342..0e4b036352758b086072c3da39346f5b6df9832a 100755
--- a/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
+++ b/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
@@ -54,7 +54,10 @@ import os
import re
import sys
-from utilities import should_generate_impl_file_from_idl, get_file_contents, idl_filename_to_component, idl_filename_to_interface_name, read_idl_files_list_from_file
+from utilities import (should_generate_impl_file_from_idl,
+ get_file_contents,
+ idl_filename_to_interface_name,
+ read_idl_files_list_from_file)
COPYRIGHT_TEMPLATE = """/*
* THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
@@ -121,11 +124,9 @@ def generate_content(component_dir, aggregate_partial_interfaces, files_meta_dat
# List all includes.
files_meta_data_this_partition.sort()
+ suffix = 'Partial' if aggregate_partial_interfaces else ''
for meta_data in files_meta_data_this_partition:
- if aggregate_partial_interfaces:
- cpp_filename = 'V8%sPartial.cpp' % meta_data['name']
- else:
- cpp_filename = 'V8%s.cpp' % meta_data['name']
+ cpp_filename = 'V8%s%s.cpp' % (meta_data['name'], suffix)
output.append('#include "bindings/%s/v8/%s"\n' %
(component_dir, cpp_filename))
@@ -148,6 +149,11 @@ def parse_options():
parser.add_option('--input-file',
help='A file name which lists up target IDL file names.',
type='string')
+ parser.add_option('--partial',
+ help='To parse partial IDLs, add this option.',
+ action='store_true',
+ dest='partial',
+ default=False)
options, output_file_names = parser.parse_args()
if len(output_file_names) == 0:
@@ -162,14 +168,9 @@ def main():
options, output_file_names = parse_options()
component_dir = options.component_directory
input_file_name = options.input_file
-
+ aggregate_partial_interfaces = options.partial
idl_file_names = read_idl_files_list_from_file(input_file_name,
is_gyp_format=True)
- components = set([idl_filename_to_component(filename)
- for filename in idl_file_names])
- if len(components) != 1:
- raise Exception('Cannot aggregate generated codes in different components')
- aggregate_partial_interfaces = component_dir not in components
files_meta_data = extract_meta_data(idl_file_names)
total_partitions = len(output_file_names)
« no previous file with comments | « third_party/WebKit/Source/bindings/modules/v8/generated.gyp ('k') | third_party/WebKit/Source/bindings/scripts/scripts.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698