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

Unified Diff: Source/bindings/scripts/compute_interfaces_info_individual.py

Issue 429853002: IDL: Add build target for IDL dictionary impl generation in core (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: gyp fix (depends on gyp r1964) Created 6 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: Source/bindings/scripts/compute_interfaces_info_individual.py
diff --git a/Source/bindings/scripts/compute_interfaces_info_individual.py b/Source/bindings/scripts/compute_interfaces_info_individual.py
index d7b58e14352c10360c1ba40f4f5bf3ee0597ef82..512b0fb00f8910f4a6529912c41bf451fce94a88 100755
--- a/Source/bindings/scripts/compute_interfaces_info_individual.py
+++ b/Source/bindings/scripts/compute_interfaces_info_individual.py
@@ -85,21 +85,25 @@ def parse_options():
# Computations
################################################################################
+def relative_dir_posix(idl_filename):
+ """Returns relative path to the directory of idl_file in POSIX format."""
+ relative_path_local = os.path.relpath(idl_filename, source_path)
+ relative_dir_local = os.path.dirname(relative_path_local)
+ return relative_dir_local.replace(os.path.sep, posixpath.sep)
+
Jens Widell 2014/08/12 15:18:00 Two blank lines between functions.
bashi 2014/08/13 00:51:20 Done.
def include_path(idl_filename, implemented_as=None):
"""Returns relative path to header file in POSIX format; used in includes.
POSIX format is used for consistency of output, so reference tests are
platform-independent.
"""
- relative_path_local = os.path.relpath(idl_filename, source_path)
- relative_dir_local = os.path.dirname(relative_path_local)
- relative_dir_posix = relative_dir_local.replace(os.path.sep, posixpath.sep)
+ relative_dir = relative_dir_posix(idl_filename)
# IDL file basename is used even if only a partial interface file
idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
cpp_class_name = implemented_as or idl_file_basename
- return posixpath.join(relative_dir_posix, cpp_class_name + '.h')
+ return posixpath.join(relative_dir, cpp_class_name + '.h')
def add_paths_to_partials_dict(partial_interface_name, full_path, this_include_path=None):
@@ -116,6 +120,7 @@ def compute_info_individual(idl_filename, component_dir):
extended_attributes = get_interface_extended_attributes_from_idl(idl_file_contents)
implemented_as = extended_attributes.get('ImplementedAs')
this_include_path = include_path(idl_filename, implemented_as)
+ relative_dir = relative_dir_posix(idl_filename)
# Handle partial interfaces
partial_interface_name = get_partial_interface_name_from_idl(idl_file_contents)
@@ -153,6 +158,7 @@ def compute_info_individual(idl_filename, component_dir):
# These cause rebuilds of referrers, due to the dependency, so these
# should be minimized; currently only targets of [PutForwards].
'referenced_interfaces': get_put_forward_interfaces_from_idl(idl_file_contents),
+ 'relative_dir': relative_dir,
}

Powered by Google App Engine
This is Rietveld 408576698