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

Unified Diff: Source/build/scripts/make_private_script_source.py

Issue 559493002: Temporary revert: Introduce include directive to make_private_script_source.py (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« 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: Source/build/scripts/make_private_script_source.py
diff --git a/Source/build/scripts/make_private_script_source.py b/Source/build/scripts/make_private_script_source.py
index 465fe55394132948aef99602df92acff56561041..8064ae710121deaeadae34f7fbb517778f441e9b 100644
--- a/Source/build/scripts/make_private_script_source.py
+++ b/Source/build/scripts/make_private_script_source.py
@@ -14,8 +14,6 @@ import re
import sys
-RE_INCLUDE = re.compile('<include[^>]+src=[\'"]([^>]*)[\'"]>')
-
# We assume that X.js has a corresponding X.idl in the same directory.
# If X is a partial interface, this method extracts the base name of the partial interface from X.idl.
# Otherwise, this method returns None.
@@ -33,21 +31,6 @@ def extract_partial_interface_name(filename):
return match and match.group(1)
-# Expand <include src="file_name"> directives
-# FIXME: Expansion of include directive will be done by GRD resources building
-# system in the future.
-def process_input_file(filename):
- result_text = ''
- dirname = os.path.dirname(filename)
- with open(filename) as input_file:
- for line in input_file.readlines():
- match = re.search(RE_INCLUDE, line)
- if match:
- result_text += process_input_file(os.path.join(dirname, match.group(1)))
- else:
- result_text += line
- return result_text
-
def main():
output_filename = sys.argv[1]
input_filenames = sys.argv[2:]
@@ -56,10 +39,11 @@ def main():
contents = []
for input_filename in input_filenames:
class_name, ext = os.path.splitext(os.path.basename(input_filename))
- input_text = process_input_file(input_filename)
- hex_values = ['0x{0:02x}'.format(ord(char)) for char in input_text]
- contents.append('const unsigned char kSourceOf%s[] = {\n %s\n};\n\n' % (
- class_name, ', '.join(hex_values)))
+ with open(input_filename) as input_file:
+ input_text = input_file.read()
+ hex_values = ['0x{0:02x}'.format(ord(char)) for char in input_text]
+ contents.append('const unsigned char kSourceOf%s[] = {\n %s\n};\n\n' % (
+ class_name, ', '.join(hex_values)))
contents.append('struct %s {' % source_name)
contents.append("""
const char* scriptClassName;
« 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