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

Side by Side Diff: Source/bindings/generated_bindings.gyp

Issue 173803006: Split generate_global_constructors.py out of compute_dependencies.py (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleaner Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/scripts/compute_dependencies.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 1 #
2 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 10 matching lines...) Expand all
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 # 29 #
30 30
31 # Generate IDL bindings, together with auxiliary files
32 # (constructors on global objects, aggregate bindings files).
33 #
34 # Design doc:
35 # https://sites.google.com/a/chromium.org/dev/developers/design-documents/idl-bu ild
36
31 { 37 {
32 'includes': [ 38 'includes': [
33 '../build/scripts/scripts.gypi', 39 '../build/scripts/scripts.gypi',
34 '../build/win/precompile.gypi', 40 '../build/win/precompile.gypi',
35 '../build/scripts/scripts.gypi', 41 '../build/scripts/scripts.gypi',
36 '../core/core.gypi', 42 '../core/core.gypi',
37 '../modules/modules.gypi', 43 '../modules/modules.gypi',
38 'bindings.gypi', 44 'bindings.gypi',
39 ], 45 ],
40 46
41 'variables': { 47 'variables': {
42 # For details, see: http://www.chromium.org/developers/web-idl-interfaces 48 # For details, see: http://www.chromium.org/developers/web-idl-interfaces
43 # 49 #
44 # Interface IDL files / Dependency IDL files 50 # Interface IDL files / Dependency IDL files
45 # Interface IDL files: generate individual bindings (includes testing) 51 # Interface IDL files: generate individual bindings (includes testing)
46 'interface_idl_files': [ 52 'interface_idl_files': [
47 '<@(static_interface_idl_files)', 53 '<@(static_interface_idl_files)',
48 '<@(generated_interface_idl_files)', 54 '<@(generated_interface_idl_files)',
49 ], 55 ],
50 # Dependency IDL files: don't generate individual bindings, but do process 56 # Dependency IDL files: don't generate individual bindings, but do process
51 # in IDL dependency computation, and count as build dependencies 57 # in IDL dependency computation, and count as build dependencies
52 'dependency_idl_files': [ 58 'dependency_idl_files': [
53 '<@(static_dependency_idl_files)', 59 '<@(static_dependency_idl_files)',
54 '<@(generated_dependency_idl_files)', 60 '<@(generated_dependency_idl_files)',
55 ], 61 ],
56 # Include in aggregate bindings (exclude testing) 62 # Main interface IDL files (excluding dependencies and testing)
57 # The only differences for testing files are: 63 # are included as properties on global objects, and in aggregate bindings
58 # * They are not included in aggregate bindings (excluded from below list)
59 # * They do not appear as a property on the global object (Window):
60 # specify [NoInterfaceObject] on the interface in the .idl file
61 'main_interface_idl_files': [ 64 'main_interface_idl_files': [
62 '<@(core_idl_files)', 65 '<@(core_idl_files)',
63 '<@(modules_idl_files)', 66 '<@(modules_idl_files)',
64 ], 67 ],
65 68
66 # Static IDL files / Generated IDL files 69 # Static IDL files / Generated IDL files
67 # Paths need to be passed separately for static and generated files, as 70 # Paths need to be passed separately for static and generated files, as
68 # static files are listed in a temporary file (b/c too long for command 71 # static files are listed in a temporary file (b/c too long for command
69 # line), but generated files must be passed at the command line, as they are 72 # line), but generated files must be passed at the command line, as they are
70 # not present at GYP time, when the temporary file is generated 73 # not present at GYP time, when the temporary file is generated
71 'static_idl_files': [ 74 'static_idl_files': [
72 '<@(static_interface_idl_files)', 75 '<@(static_interface_idl_files)',
73 '<@(static_dependency_idl_files)', 76 '<@(static_dependency_idl_files)',
74 ], 77 ],
75 'generated_idl_files': [ 78 'generated_idl_files': [
76 '<@(generated_interface_idl_files)', 79 '<@(generated_interface_idl_files)',
77 # FIXME: generate global constructors *before* computing dependencies 80 '<@(generated_dependency_idl_files)',
78 # '<@(generated_dependency_idl_files)',
79 ], 81 ],
80 82
81 # Static IDL files 83 # Static IDL files
82 'static_interface_idl_files': [ 84 'static_interface_idl_files': [
83 '<@(core_idl_files)', 85 '<@(core_idl_files)',
84 '<@(webcore_testing_idl_files)', 86 '<@(webcore_testing_idl_files)',
85 '<@(modules_idl_files)', 87 '<@(modules_idl_files)',
86 ], 88 ],
87 'static_dependency_idl_files': [ 89 'static_dependency_idl_files': [
88 '<@(core_dependency_idl_files)', 90 '<@(core_dependency_idl_files)',
89 '<@(modules_dependency_idl_files)', 91 '<@(modules_dependency_idl_files)',
90 '<@(modules_testing_dependency_idl_files)', 92 '<@(modules_testing_dependency_idl_files)',
91 ], 93 ],
92 94
93 # Generated IDL files 95 # Generated IDL files
94 'generated_interface_idl_files': [ 96 'generated_interface_idl_files': [
95 '<@(generated_webcore_testing_idl_files)', # interfaces 97 '<@(generated_webcore_testing_idl_files)', # interfaces
96 ], 98 ],
97 'generated_dependency_idl_files': [ 99 'generated_dependency_idl_files': [
98 '<@(generated_global_constructors_idl_files)', # partial interfaces 100 '<@(generated_global_constructors_idl_files)', # partial interfaces
99 ], 101 ],
100 102
101 'generated_global_constructors_idl_files': [ 103 'generated_global_constructors_idl_files': [
102 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl', 104 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl',
103 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl', 105 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl',
104 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.idl ', 106 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.idl' ,
105 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors. idl', 107 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors.i dl',
106 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl', 108 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl',
107 ], 109 ],
108 110
109 'compiler_module_files': [ 111 'compiler_module_files': [
110 'scripts/unstable/idl_compiler.py', 112 'scripts/unstable/idl_compiler.py',
111 '<(DEPTH)/third_party/ply/lex.py', 113 '<(DEPTH)/third_party/ply/lex.py',
112 '<(DEPTH)/third_party/ply/yacc.py', 114 '<(DEPTH)/third_party/ply/yacc.py',
113 # jinja2/__init__.py contains version string, so sufficient for package 115 # jinja2/__init__.py contains version string, so sufficient for package
114 '<(DEPTH)/third_party/jinja2/__init__.py', 116 '<(DEPTH)/third_party/jinja2/__init__.py',
115 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep 117 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
116 '<(DEPTH)/tools/idl_parser/idl_lexer.py', 118 '<(DEPTH)/tools/idl_parser/idl_lexer.py',
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 # depending on what the user has locally it could be. So, don't use on 165 # depending on what the user has locally it could be. So, don't use on
164 # Windows is the simplest solution. 166 # Windows is the simplest solution.
165 'json_perl_module_include_path': '-I<(DEPTH)/third_party/JSON/out/lib/pe rl5', 167 'json_perl_module_include_path': '-I<(DEPTH)/third_party/JSON/out/lib/pe rl5',
166 }, { 168 }, {
167 'json_perl_module_include_path': '', 169 'json_perl_module_include_path': '',
168 }], 170 }],
169 ], 171 ],
170 }, 172 },
171 173
172 'targets': [{ 174 'targets': [{
173 'target_name': 'interface_dependencies', 175 'target_name': 'global_constructors_idls',
176 'type': 'none',
177 'actions': [{
178 'action_name': 'generate_global_constructors_idls',
179 'variables': {
180 # Write list of IDL files to a file, so that the command line doesn't
181 # exceed OS length limits.
182 # Only includes main IDL files (exclude dependencies and testing,
183 # which should not appear on global objects).
184 'main_interface_idl_files_list': '<|(main_interface_idl_files_list.tmp < @(main_interface_idl_files))',
185 },
186 'inputs': [
187 'scripts/generate_global_constructors.py',
188 'scripts/utilities.py',
189 '<(main_interface_idl_files_list)',
190 '<@(main_interface_idl_files)',
191 ],
192 'outputs': [
193 '<@(generated_global_constructors_idl_files)',
194 ],
195 'action': [
196 'python',
197 'scripts/generate_global_constructors.py',
198 '--idl-files-list',
199 '<(main_interface_idl_files_list)',
200 '<@(write_file_only_if_changed)',
201 '--',
202 'Window',
203 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl',
204 'WorkerGlobalScope',
205 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl',
206 'SharedWorkerGlobalScope',
207 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.id l',
208 'DedicatedWorkerGlobalScope',
209 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors .idl',
210 'ServiceWorkerGlobalScope',
211 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl',
212 ],
213 'message': 'Generating IDL files for interface properties on global objec ts',
214 }]
215 },
216 {
217 'target_name': 'interfaces_info',
174 'type': 'none', 218 'type': 'none',
175 'dependencies': [ 219 'dependencies': [
220 'global_constructors_idls',
176 '../core/core_generated.gyp:generated_testing_idls', 221 '../core/core_generated.gyp:generated_testing_idls',
177 ], 222 ],
178 'actions': [{ 223 'actions': [{
179 'action_name': 'compute_interface_dependencies', 224 'action_name': 'compute_interfaces_info',
180 'variables': { 225 'variables': {
181 # Write list of static IDL files to a file, so that the command line 226 # Write list of static IDL files to a file, so that the command line
182 # doesn't exceed OS length limits. 227 # doesn't exceed OS length limits.
183 # Generated IDL files cannot be included, as their path depends on the 228 # Generated IDL files cannot be included, as their path depends on the
184 # build directory, and must instead be passed as command line arguments. 229 # build directory, and must instead be passed as command line arguments.
185 'idl_files_list': '<|(idl_files_list.tmp <@(static_idl_files))', 230 'idl_files_list': '<|(idl_files_list.tmp <@(static_idl_files))',
186 }, 231 },
187 'inputs': [ 232 'inputs': [
188 'scripts/compute_dependencies.py', 233 'scripts/compute_interfaces_info.py',
234 'scripts/utilities.py',
189 '<(idl_files_list)', 235 '<(idl_files_list)',
190 '<@(static_idl_files)', 236 '<@(static_idl_files)',
191 '<@(generated_idl_files)', 237 '<@(generated_idl_files)',
192 ], 238 ],
193 'outputs': [ 239 'outputs': [
194 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt', 240 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt',
195 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', 241 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle',
196 '<@(generated_global_constructors_idl_files)', 242 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in',
197 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in', 243 ],
198 ], 244 'action': [
199 'action': [ 245 'python',
200 'python', 246 'scripts/compute_interfaces_info.py',
201 'scripts/compute_dependencies.py', 247 '--idl-files-list',
202 '--idl-files-list', 248 '<(idl_files_list)',
203 '<(idl_files_list)', 249 '--interface-dependencies-file',
204 '--interface-dependencies-file', 250 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt',
205 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt', 251 '--interfaces-info-file',
206 '--interfaces-info-file', 252 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle',
207 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', 253 '--event-names-file',
208 '--window-constructors-file', 254 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in',
209 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl', 255 '<@(write_file_only_if_changed)',
210 '--workerglobalscope-constructors-file', 256 '--',
211 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl', 257 '<@(generated_idl_files)',
212 '--sharedworkerglobalscope-constructors-file', 258 ],
213 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.i dl', 259 'message': 'Computing global information about IDL files, and generating l ist of Event interfaces',
214 '--dedicatedworkerglobalscope-constructors-file',
215 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructor s.idl',
216 '--serviceworkerglobalscope-constructors-file',
217 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl',
218 '--event-names-file',
219 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in',
220 '<@(write_file_only_if_changed)',
221 '--',
222 '<@(generated_idl_files)',
223 ],
224 'message': 'Computing dependencies between IDL files, and generating glob al scope constructor IDLs files and list of Event interfaces',
225 }] 260 }]
226 }, 261 },
227 { 262 {
228 'target_name': 'individual_generated_bindings', 263 'target_name': 'individual_generated_bindings',
229 'type': 'none', 264 'type': 'none',
230 # The 'binding' rule generates .h files, so mark as hard_dependency, per: 265 # The 'binding' rule generates .h files, so mark as hard_dependency, per:
231 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependen cies 266 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependen cies
232 'hard_dependency': 1, 267 'hard_dependency': 1,
233 'dependencies': [ 268 'dependencies': [
234 'interface_dependencies', 269 'interfaces_info',
235 '../core/core_generated.gyp:generated_testing_idls', 270 '../core/core_generated.gyp:generated_testing_idls',
236 ], 271 ],
237 'sources': [ 272 'sources': [
238 '<@(interface_idl_files)', 273 '<@(interface_idl_files)',
239 ], 274 ],
240 'rules': [{ 275 'rules': [{
241 'rule_name': 'binding', 276 'rule_name': 'binding',
242 'extension': 'idl', 277 'extension': 'idl',
243 'msvs_external_rule': 1, 278 'msvs_external_rule': 1,
244 'inputs': [ 279 'inputs': [
245 'scripts/generate_bindings.pl', 280 'scripts/generate_bindings.pl',
246 'scripts/code_generator_v8.pm', 281 'scripts/code_generator_v8.pm',
247 'scripts/idl_parser.pm', 282 'scripts/idl_parser.pm',
248 'scripts/idl_serializer.pm', 283 'scripts/idl_serializer.pm',
249 '../build/scripts/preprocessor.pm', 284 '../build/scripts/preprocessor.pm',
250 'IDLExtendedAttributes.txt', 285 'IDLExtendedAttributes.txt',
251 # If the dependency structure or public interface info (e.g., 286 # If the dependency structure or public interface info (e.g.,
252 # [ImplementedAs]) changes, we rebuild all files, since we're not 287 # [ImplementedAs]) changes, we rebuild all files, since we're not
253 # computing dependencies file-by-file in the build. 288 # computing dependencies file-by-file in the build.
254 # This data is generally stable. 289 # This data is generally stable.
255 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt', 290 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt',
256 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', 291 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle',
257 # Further, if any dependency (partial interface or implemented 292 # Further, if any dependency (partial interface or implemented
258 # interface) changes, rebuild everything, since every IDL potentially 293 # interface) changes, rebuild everything, since every IDL potentially
259 # depends on them, because we're not computing dependencies 294 # depends on them, because we're not computing dependencies
260 # file-by-file. 295 # file-by-file.
261 # FIXME: This is too conservative, and causes excess rebuilds: 296 # FIXME: This is too conservative, and causes excess rebuilds:
262 # compute this file-by-file. 297 # compute this file-by-file. http://crbug.com/341748
263 '<@(dependency_idl_files)', 298 '<@(dependency_idl_files)',
264 ], 299 ],
265 'outputs': [ 300 'outputs': [
266 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp', 301 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp',
267 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h', 302 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h',
268 ], 303 ],
269 'variables': { 304 'variables': {
270 # IDL include paths. The generator will search recursively for IDL 305 # IDL include paths. The generator will search recursively for IDL
271 # files under these locations. 306 # files under these locations.
272 'generator_include_dirs': [ 307 'generator_include_dirs': [
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 { 367 {
333 'target_name': 'generated_bindings', 368 'target_name': 'generated_bindings',
334 'type': 'none', 369 'type': 'none',
335 'dependencies': [ 370 'dependencies': [
336 'aggregate_generated_bindings', 371 'aggregate_generated_bindings',
337 'individual_generated_bindings', 372 'individual_generated_bindings',
338 ], 373 ],
339 }, 374 },
340 ], 375 ],
341 } 376 }
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/compute_dependencies.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698