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

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

Issue 1544373002: Use relative include path to gen-dir to include multiple-stage-generated header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_individual.py
diff --git a/third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_individual.py b/third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_individual.py
index fe9095850bf63afe8383b82e1de14e90feb35215..26af9fe7d95e27b252ed5da3649fe1f0ab22a212 100755
--- a/third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_individual.py
+++ b/third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_individual.py
@@ -54,6 +54,7 @@ from utilities import get_file_contents, read_file_to_list, idl_filename_to_inte
module_path = os.path.dirname(__file__)
source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir))
+gen_path = os.path.join('gen', 'blink')
class IdlBadFilenameError(Exception):
@@ -85,9 +86,9 @@ def parse_options():
# Computations
################################################################################
-def relative_dir_posix(idl_filename):
+def relative_dir_posix(idl_filename, base_path):
"""Returns relative path to the directory of idl_file in POSIX format."""
- relative_path_local = os.path.relpath(idl_filename, source_path)
+ relative_path_local = os.path.relpath(idl_filename, base_path)
relative_dir_local = os.path.dirname(relative_path_local)
return relative_dir_local.replace(os.path.sep, posixpath.sep)
@@ -98,7 +99,10 @@ def include_path(idl_filename, implemented_as=None):
POSIX format is used for consistency of output, so reference tests are
platform-independent.
"""
- relative_dir = relative_dir_posix(idl_filename)
+ if idl_filename.startswith(gen_path):
+ relative_dir = relative_dir_posix(idl_filename, gen_path)
+ else:
+ relative_dir = relative_dir_posix(idl_filename, source_path)
# IDL file basename is used even if only a partial interface file
cpp_class_name = implemented_as or idl_filename_to_interface_name(idl_filename)
@@ -300,7 +304,7 @@ class InterfaceInfoCollector(object):
# 'implements': http://crbug.com/360435
'is_legacy_treat_as_partial_interface': 'LegacyTreatAsPartialInterface' in extended_attributes,
'parent': definition.parent,
- 'relative_dir': relative_dir_posix(idl_filename),
+ 'relative_dir': relative_dir_posix(idl_filename, source_path),
})
merge_dict_recursively(self.interfaces_info[definition.name], interface_info)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698