Commit 05b1e920 authored by gavinp@chromium.org's avatar gavinp@chromium.org

Move Source/web/scripts/make-file-arrays.py and add namespace option.

I'm about to use this useful script in Source/modules, so a common
denominator location seemed like a good idea. As well, I added a
namespace option as the upcoming use in modules/serviceworkers will be
in WebCore not blink.

R=jochen@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/311343002

git-svn-id: svn://svn.chromium.org/blink/trunk@175575 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bc23069a
......@@ -85,7 +85,7 @@ def process_file(file_name):
return variable_name, content
def write_header_file(header_file_name, flag, names_and_contents, namespace='blink'):
def write_header_file(header_file_name, flag, names_and_contents, namespace):
with open(header_file_name, 'w') as header_file:
if flag:
header_file.write('#if ' + flag + '\n')
......@@ -98,7 +98,7 @@ def write_header_file(header_file_name, flag, names_and_contents, namespace='bli
header_file.write('#endif\n')
def write_cpp_file(cpp_file_name, flag, names_and_contents, header_file_name, namespace='blink'):
def write_cpp_file(cpp_file_name, flag, names_and_contents, header_file_name, namespace):
with open(cpp_file_name, 'w') as cpp_file:
cpp_file.write('#include "config.h"\n')
cpp_file.write('#include "%s"\n' % os.path.basename(header_file_name))
......@@ -134,6 +134,7 @@ def main():
parser.add_option('--out-h', dest='out_header')
parser.add_option('--out-cpp', dest='out_cpp')
parser.add_option('--condition', dest='flag')
parser.add_option('--namespace', dest='namespace', default='blink')
(options, args) = parser.parse_args()
if len(args) < 1:
parser.error('Need one or more input files')
......@@ -149,8 +150,8 @@ def main():
names_and_contents = [process_file(file_name) for file_name in args]
if options.out_header:
write_header_file(options.out_header, options.flag, names_and_contents)
write_cpp_file(options.out_cpp, options.flag, names_and_contents, options.out_header)
write_header_file(options.out_header, options.flag, names_and_contents, options.namespace)
write_cpp_file(options.out_cpp, options.flag, names_and_contents, options.out_header, options.namespace)
if __name__ == '__main__':
......
......@@ -212,7 +212,7 @@
],
},
'inputs': [
'scripts/make-file-arrays.py',
'../build/scripts/make-file-arrays.py',
'<@(resources)',
],
'outputs': [
......@@ -221,7 +221,7 @@
],
'action': [
'python',
'scripts/make-file-arrays.py',
'../build/scripts/make-file-arrays.py',
'--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
'--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
'<@(resources)',
......@@ -240,7 +240,7 @@
],
},
'inputs': [
'scripts/make-file-arrays.py',
'../build/scripts/make-file-arrays.py',
'<@(resources)'
],
'outputs': [
......@@ -249,7 +249,7 @@
],
'action': [
'python',
'scripts/make-file-arrays.py',
'../build/scripts/make-file-arrays.py',
'--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
'--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
'<@(resources)',
......@@ -265,7 +265,7 @@
],
},
'inputs': [
'scripts/make-file-arrays.py',
'../build/scripts/make-file-arrays.py',
'<@(resources)',
],
'outputs': [
......@@ -274,7 +274,7 @@
],
'action': [
'python',
'scripts/make-file-arrays.py',
'../build/scripts/make-file-arrays.py',
'--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
'--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
'<@(resources)',
......
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