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 38749edd5febefa01cc533ced1a438e6e5c31575..2537f7a85e73cfd647d016754c2c381b17b1c383 100644 |
--- a/Source/build/scripts/make_private_script_source.py |
+++ b/Source/build/scripts/make_private_script_source.py |
@@ -6,7 +6,7 @@ |
FIXME: We don't want to add more build scripts. Rewrite this script in grit. crbug.com/388121 |
Usage: |
-python make_private_script.py DESTINATION_FILE SOURCE_FILES |
+python make_private_script_source.py DESTINATION_FILE SOURCE_FILES |
""" |
import os |
@@ -16,6 +16,8 @@ import sys |
def main(): |
output_filename = sys.argv[1] |
input_filenames = sys.argv[2:] |
+ source_name, ext = os.path.splitext(os.path.basename(output_filename)) |
+ |
contents = [] |
for input_filename in input_filenames: |
class_name, ext = os.path.splitext(os.path.basename(input_filename)) |
@@ -24,15 +26,15 @@ def main(): |
hex_values = ['0x{0:02x}'.format(ord(char)) for char in input_text] |
contents.append('const unsigned char kSourceOf%s[] = {\n %s\n};\n' % ( |
class_name, ', '.join(hex_values))) |
+ contents.append('struct %s {' % source_name) |
contents.append(""" |
-struct PrivateScriptSources { |
const char* name; |
const unsigned char* source; |
size_t size; |
}; |
""") |
- contents.append('struct PrivateScriptSources kPrivateScriptSources[] = {\n') |
+ contents.append('struct %s k%s[] = {\n' % (source_name, source_name)) |
for input_filename in input_filenames: |
class_name, ext = os.path.splitext(os.path.basename(input_filename)) |
contents.append(' { "%s", kSourceOf%s, sizeof(kSourceOf%s) },\n' % (class_name, class_name, class_name)) |