OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//third_party/WebKit/Source/config.gni") | 5 import("//third_party/WebKit/Source/config.gni") |
6 | 6 |
7 # All paths in this file should be absolute so targets in any directory can use | 7 # All paths in this file should be absolute so targets in any directory can use |
8 # them without worrying about the current directory. | 8 # them without worrying about the current directory. |
9 _scripts_dir = "//third_party/WebKit/Source/build/scripts" | 9 _scripts_dir = "//third_party/WebKit/Source/build/scripts" |
10 | 10 |
11 scripts_for_in_files = [ | 11 scripts_for_in_files = [ |
12 # jinja2/__init__.py contains version string, so sufficient as | 12 # jinja2/__init__.py contains version string, so sufficient as |
13 # dependency for whole jinja2 package | 13 # dependency for whole jinja2 package |
14 "//third_party/jinja2/__init__.py", | 14 "//third_party/jinja2/__init__.py", |
15 "//third_party/markupsafe/__init__.py", # jinja2 dep | 15 "//third_party/markupsafe/__init__.py", # jinja2 dep |
16 "$_scripts_dir/hasher.py", | 16 "$_scripts_dir/hasher.py", |
17 "$_scripts_dir/in_file.py", | 17 "$_scripts_dir/in_file.py", |
18 "$_scripts_dir/in_generator.py", | 18 "$_scripts_dir/in_generator.py", |
19 "$_scripts_dir/license.py", | 19 "$_scripts_dir/license.py", |
20 "$_scripts_dir/name_utilities.py", | 20 "$_scripts_dir/name_utilities.py", |
21 "$_scripts_dir/template_expander.py", | 21 "$_scripts_dir/template_expander.py", |
22 "$_scripts_dir/templates/macros.tmpl", | 22 "$_scripts_dir/templates/macros.tmpl", |
23 ] | 23 ] |
24 | 24 |
25 css_properties_files = scripts_for_in_files + [ | 25 css_properties_files = |
26 "$_scripts_dir/css_properties.py", | 26 scripts_for_in_files + [ "$_scripts_dir/css_properties.py" ] |
27 ] | |
28 | 27 |
29 make_event_factory_files = scripts_for_in_files + [ | 28 make_event_factory_files = scripts_for_in_files + [ |
30 "$_scripts_dir/make_event_factory.py", | 29 "$_scripts_dir/make_event_factory.py", |
31 "$_scripts_dir/templates/EventFactory.cpp.tmpl", | 30 "$_scripts_dir/templates/EventFactory.cpp.tmpl", |
32 ] | 31 ] |
33 | 32 |
34 make_names_files = scripts_for_in_files + [ | 33 make_names_files = scripts_for_in_files + [ |
35 "$_scripts_dir/make_names.py", | 34 "$_scripts_dir/make_names.py", |
36 "$_scripts_dir/templates/MakeNames.cpp.tmpl", | 35 "$_scripts_dir/templates/MakeNames.cpp.tmpl", |
37 "$_scripts_dir/templates/MakeNames.h.tmpl", | 36 "$_scripts_dir/templates/MakeNames.h.tmpl", |
38 ] | 37 ] |
39 | 38 |
40 make_qualified_names_files = scripts_for_in_files + [ | 39 make_qualified_names_files = |
41 "$_scripts_dir/make_qualified_names.py", | 40 scripts_for_in_files + [ |
42 "$_scripts_dir/templates/MakeQualifiedNames.cpp.tmpl", | 41 "$_scripts_dir/make_qualified_names.py", |
43 "$_scripts_dir/templates/MakeQualifiedNames.h.tmpl", | 42 "$_scripts_dir/templates/MakeQualifiedNames.cpp.tmpl", |
44 ] | 43 "$_scripts_dir/templates/MakeQualifiedNames.h.tmpl", |
| 44 ] |
45 | 45 |
46 make_element_factory_files = make_qualified_names_files + [ | 46 make_element_factory_files = |
47 "$_scripts_dir/make_element_factory.py", | 47 make_qualified_names_files + [ |
48 "$_scripts_dir/templates/ElementFactory.cpp.tmpl", | 48 "$_scripts_dir/make_element_factory.py", |
49 "$_scripts_dir/templates/ElementFactory.h.tmpl", | 49 "$_scripts_dir/templates/ElementFactory.cpp.tmpl", |
50 ] | 50 "$_scripts_dir/templates/ElementFactory.h.tmpl", |
| 51 ] |
51 | 52 |
52 make_element_type_helpers_files = make_qualified_names_files + [ | 53 make_element_type_helpers_files = |
53 "$_scripts_dir/make_element_type_helpers.py", | 54 make_qualified_names_files + [ |
54 "$_scripts_dir/templates/ElementTypeHelpers.h.tmpl", | 55 "$_scripts_dir/make_element_type_helpers.py", |
55 ] | 56 "$_scripts_dir/templates/ElementTypeHelpers.h.tmpl", |
| 57 ] |
56 | 58 |
57 # The executables are relative to the build directory. Don't rebase it because | 59 # The executables are relative to the build directory. Don't rebase it because |
58 # on Posix we want to run the system one on the path. | 60 # on Posix we want to run the system one on the path. |
59 if (is_win) { | 61 if (is_win) { |
60 gperf_exe = rebase_path("//third_party/gperf/bin/gperf.exe", root_build_dir) | 62 gperf_exe = rebase_path("//third_party/gperf/bin/gperf.exe", root_build_dir) |
61 bison_exe = rebase_path("//third_party/bison/bin/bison.exe", root_build_dir) | 63 bison_exe = rebase_path("//third_party/bison/bin/bison.exe", root_build_dir) |
62 } else { | 64 } else { |
63 gperf_exe = "gperf" | 65 gperf_exe = "gperf" |
64 bison_exe = "bison" | 66 bison_exe = "bison" |
65 } | 67 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 inputs += invoker.other_inputs | 101 inputs += invoker.other_inputs |
100 } else { | 102 } else { |
101 inputs += scripts_for_in_files | 103 inputs += scripts_for_in_files |
102 } | 104 } |
103 outputs = invoker.outputs | 105 outputs = invoker.outputs |
104 | 106 |
105 # Extract the directory to write files to. | 107 # Extract the directory to write files to. |
106 output_dir = get_path_info(outputs[0], "dir") | 108 output_dir = get_path_info(outputs[0], "dir") |
107 | 109 |
108 args = rebase_path(invoker.in_files, root_build_dir) + [ | 110 args = rebase_path(invoker.in_files, root_build_dir) + [ |
109 "--output_dir", rebase_path(output_dir, root_build_dir), | 111 "--output_dir", |
110 ] | 112 rebase_path(output_dir, root_build_dir), |
| 113 ] |
111 if (defined(invoker.other_args)) { | 114 if (defined(invoker.other_args)) { |
112 args += invoker.other_args | 115 args += invoker.other_args |
113 } | 116 } |
114 | 117 |
115 deps = make_core_generated_deps | 118 deps = make_core_generated_deps |
116 if (defined(invoker.deps)) { | 119 if (defined(invoker.deps)) { |
117 deps += invoker.deps | 120 deps += invoker.deps |
118 } | 121 } |
119 } | 122 } |
120 } | 123 } |
121 | 124 |
122 # Template for scripts using css_properties.py. This is a special case of | 125 # Template for scripts using css_properties.py. This is a special case of |
123 # process_in_files. | 126 # process_in_files. |
124 # outputs: expected results | 127 # outputs: expected results |
125 template("css_properties") { | 128 template("css_properties") { |
126 process_in_files(target_name) { | 129 process_in_files(target_name) { |
127 script = invoker.script | 130 script = invoker.script |
128 in_files = ["css/CSSProperties.in"] | 131 in_files = [ "css/CSSProperties.in" ] |
129 other_inputs = css_properties_files | 132 other_inputs = css_properties_files |
130 if (defined(invoker.other_inputs)) { | 133 if (defined(invoker.other_inputs)) { |
131 other_inputs += invoker.other_inputs | 134 other_inputs += invoker.other_inputs |
132 } | 135 } |
133 other_args = [ | 136 other_args = [ |
134 "--gperf", gperf_exe, | 137 "--gperf", |
| 138 gperf_exe, |
135 ] | 139 ] |
136 outputs = invoker.outputs | 140 outputs = invoker.outputs |
137 } | 141 } |
138 } | 142 } |
139 | 143 |
140 # Template to run the make_names script. This is a special case of | 144 # Template to run the make_names script. This is a special case of |
141 # process_in_files. | 145 # process_in_files. |
142 # in_files: files to pass to the script | 146 # in_files: files to pass to the script |
143 # outputs: expected results | 147 # outputs: expected results |
144 # deps [optional]: additional dependencies | 148 # deps [optional]: additional dependencies |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 189 } |
186 | 190 |
187 # Calls the make_token_matcher script. | 191 # Calls the make_token_matcher script. |
188 # input_file: The "*-in.cpp" file | 192 # input_file: The "*-in.cpp" file |
189 # output_file: The output file | 193 # output_file: The output file |
190 template("make_token_matcher") { | 194 template("make_token_matcher") { |
191 action(target_name) { | 195 action(target_name) { |
192 script = "//third_party/WebKit/Source/build/scripts/make_token_matcher.py" | 196 script = "//third_party/WebKit/Source/build/scripts/make_token_matcher.py" |
193 | 197 |
194 inputs = scripts_for_in_files + [ invoker.input_file ] | 198 inputs = scripts_for_in_files + [ invoker.input_file ] |
195 outputs = [ invoker.output_file ] | 199 outputs = [ |
| 200 invoker.output_file, |
| 201 ] |
196 | 202 |
197 args = [ | 203 args = [ |
198 rebase_path(invoker.input_file, root_build_dir), | 204 rebase_path(invoker.input_file, root_build_dir), |
199 rebase_path(invoker.output_file, root_build_dir), | 205 rebase_path(invoker.output_file, root_build_dir), |
200 ] | 206 ] |
201 | 207 |
202 deps = make_core_generated_deps | 208 deps = make_core_generated_deps |
203 } | 209 } |
204 } | 210 } |
OLD | NEW |