Commit 4bafa509 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

bindings: Fix generate_v8_context_snapshot_external_references.py for the great Blink mv.

- Pass -snake-case-generated-files flag if snake_case_source_files
- Apply to_snake_case to pre-defined INCLUDES too.

Bug: 760462
Change-Id: Iacb84b7fb895160cf4791c4570c31d1bd0c62cbc
Reviewed-on: https://chromium-review.googlesource.com/672027Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502960}
parent 848001c9
...@@ -143,6 +143,9 @@ action("generate_v8_context_snapshot_external_references") { ...@@ -143,6 +143,9 @@ action("generate_v8_context_snapshot_external_references") {
"--target-component", "--target-component",
"modules", "modules",
] ]
if (snake_case_source_files) {
args += [ "--snake-case-generated-files" ]
}
deps = [ deps = [
"//third_party/WebKit/Source/bindings/core:interfaces_info_individual_core", "//third_party/WebKit/Source/bindings/core:interfaces_info_individual_core",
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
import argparse import argparse
import os import os
import posixpath
from code_generator import initialize_jinja_env from code_generator import initialize_jinja_env
from idl_reader import IdlReader from idl_reader import IdlReader
...@@ -197,10 +198,20 @@ class ExternalReferenceTableGenerator(object): ...@@ -197,10 +198,20 @@ class ExternalReferenceTableGenerator(object):
header_name = 'V8ContextSnapshotExternalReferences.h' header_name = 'V8ContextSnapshotExternalReferences.h'
if self._opts.snake_case_generated_files: if self._opts.snake_case_generated_files:
header_name = 'v8_context_snapshot_external_references.h' header_name = 'v8_context_snapshot_external_references.h'
include_files = list(self._include_files)
# TODO(tkent): Update INCLUDES after the great mv, and remove the
# following block. crbug.com/760462
if self._opts.snake_case_generated_files:
include_files = []
for include in self._include_files:
dirname, basename = posixpath.split(include)
name, ext = posixpath.splitext(basename)
include_files.append(posixpath.join(
dirname, utilities.to_snake_case(name) + ext))
return { return {
'class': 'V8ContextSnapshotExternalReferences', 'class': 'V8ContextSnapshotExternalReferences',
'interfaces': interfaces, 'interfaces': interfaces,
'include_files': sorted(list(self._include_files)), 'include_files': sorted(include_files),
'this_include_header_name': header_name, 'this_include_header_name': header_name,
} }
......
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