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

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

Issue 18190004: Add Python flow to bindings generation, move dummy-generating IDL files over (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak similarity Created 7 years, 5 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/build_ir.py » ('j') | Source/bindings/scripts/build_ir.py » ('J')
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 20 matching lines...) Expand all
31 { 31 {
32 'includes': [ 32 'includes': [
33 '../WebKit/chromium/WinPrecompile.gypi', 33 '../WebKit/chromium/WinPrecompile.gypi',
34 '../core/features.gypi', 34 '../core/features.gypi',
35 '../core/core.gypi', 35 '../core/core.gypi',
36 '../modules/modules.gypi', 36 '../modules/modules.gypi',
37 'bindings.gypi', 37 'bindings.gypi',
38 ], 38 ],
39 39
40 'variables': { 40 'variables': {
41 'idl_files': [ 41 'perl_idl_files': [
42 '<@(core_idl_files)', 42 '<@(perl_core_idl_files)',
43 '<@(modules_idl_files)', 43 '<@(perl_modules_idl_files)',
44 '<@(svg_idl_files)', 44 '<@(perl_svg_idl_files)',
45 ], 45 ],
46 'python_idl_files': [
47 '<@(python_core_idl_files)',
48 '<@(python_modules_idl_files)',
49 '<@(python_svg_idl_files)',
50 ],
51 'perl_and_python_idl_files': [
52 '<@(perl_idl_files)',
53 '<@(python_idl_files)',
54 ],
haraken 2013/07/08 06:06:29 Shall we rename: perl_idl_files => idl_files_fo
Nils Barth (inactive) 2013/07/09 08:48:16 That's pretty clear, done (here and throughout)!
55
56 'bindings_output_dir': '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
Nils Barth (inactive) 2013/07/08 05:24:38 (Added bindings_output_dir for clarity and consist
46 'generated_global_constructors_idl_files': [ 57 'generated_global_constructors_idl_files': [
47 '<(SHARED_INTERMEDIATE_DIR)/WindowConstructors.idl', 58 '<(SHARED_INTERMEDIATE_DIR)/WindowConstructors.idl',
48 '<(SHARED_INTERMEDIATE_DIR)/WorkerGlobalScopeConstructors.idl', 59 '<(SHARED_INTERMEDIATE_DIR)/WorkerGlobalScopeConstructors.idl',
49 '<(SHARED_INTERMEDIATE_DIR)/SharedWorkerGlobalScopeConstructors.idl', 60 '<(SHARED_INTERMEDIATE_DIR)/SharedWorkerGlobalScopeConstructors.idl',
50 '<(SHARED_INTERMEDIATE_DIR)/DedicatedWorkerGlobalScopeConstructors.idl' , 61 '<(SHARED_INTERMEDIATE_DIR)/DedicatedWorkerGlobalScopeConstructors.idl' ,
51 ], 62 ],
52 63
53 'conditions': [ 64 'conditions': [
54 ['OS=="win" and buildtype=="Official"', { 65 ['OS=="win" and buildtype=="Official"', {
55 # On windows official release builds, we try to preserve symbol space. 66 # On windows official release builds, we try to preserve symbol space.
56 'derived_sources_aggregate_files': [ 67 'derived_sources_aggregate_files': [
57 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSourcesAll.cpp', 68 '<(bindings_output_dir)/V8DerivedSourcesAll.cpp',
58 ], 69 ],
59 },{ 70 },{
60 'derived_sources_aggregate_files': [ 71 'derived_sources_aggregate_files': [
61 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources01.cpp', 72 '<(bindings_output_dir)/V8DerivedSources01.cpp',
62 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources02.cpp', 73 '<(bindings_output_dir)/V8DerivedSources02.cpp',
63 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources03.cpp', 74 '<(bindings_output_dir)/V8DerivedSources03.cpp',
64 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources04.cpp', 75 '<(bindings_output_dir)/V8DerivedSources04.cpp',
65 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources05.cpp', 76 '<(bindings_output_dir)/V8DerivedSources05.cpp',
66 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources06.cpp', 77 '<(bindings_output_dir)/V8DerivedSources06.cpp',
67 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources07.cpp', 78 '<(bindings_output_dir)/V8DerivedSources07.cpp',
68 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources08.cpp', 79 '<(bindings_output_dir)/V8DerivedSources08.cpp',
69 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources09.cpp', 80 '<(bindings_output_dir)/V8DerivedSources09.cpp',
70 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources10.cpp', 81 '<(bindings_output_dir)/V8DerivedSources10.cpp',
71 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources11.cpp', 82 '<(bindings_output_dir)/V8DerivedSources11.cpp',
72 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources12.cpp', 83 '<(bindings_output_dir)/V8DerivedSources12.cpp',
73 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources13.cpp', 84 '<(bindings_output_dir)/V8DerivedSources13.cpp',
74 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources14.cpp', 85 '<(bindings_output_dir)/V8DerivedSources14.cpp',
75 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources15.cpp', 86 '<(bindings_output_dir)/V8DerivedSources15.cpp',
76 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources16.cpp', 87 '<(bindings_output_dir)/V8DerivedSources16.cpp',
77 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources17.cpp', 88 '<(bindings_output_dir)/V8DerivedSources17.cpp',
78 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources18.cpp', 89 '<(bindings_output_dir)/V8DerivedSources18.cpp',
79 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources19.cpp', 90 '<(bindings_output_dir)/V8DerivedSources19.cpp',
80 ], 91 ],
81 }], 92 }],
82 # The bindings generator can not write generated files if they are identic al 93 # The bindings generator can not write generated files if they are identic al
83 # to the already existing file – that way they don't need to be recompiled . 94 # to the already existing file – that way they don't need to be recompiled .
84 # However, a reverse dependency having a newer timestamp than a 95 # However, a reverse dependency having a newer timestamp than a
85 # generated binding can confuse some build systems, so only use this on 96 # generated binding can confuse some build systems, so only use this on
86 # ninja which explicitly supports this use case (gyp turns all actions int o 97 # ninja which explicitly supports this use case (gyp turns all actions int o
87 # ninja restat rules). 98 # ninja restat rules).
88 ['"<(GENERATOR)"=="ninja"', { 99 ['"<(GENERATOR)"=="ninja"', {
89 'write_file_only_if_changed': '--write-file-only-if-changed 1', 100 'write_file_only_if_changed': '--write-file-only-if-changed 1',
(...skipping 10 matching lines...) Expand all
100 }, 111 },
101 112
102 'targets': [{ 113 'targets': [{
103 'target_name': 'supplemental_dependencies', 114 'target_name': 'supplemental_dependencies',
104 'type': 'none', 115 'type': 'none',
105 'actions': [{ 116 'actions': [{
106 'action_name': 'generatePartialInterfacesDependency', 117 'action_name': 'generatePartialInterfacesDependency',
107 'variables': { 118 'variables': {
108 # Write sources into a file, so that the action command line won't 119 # Write sources into a file, so that the action command line won't
109 # exceed OS limits. 120 # exceed OS limits.
110 'idl_files_list': '<|(idl_files_list.tmp <@(idl_files))', 121 'idl_files_list': '<|(idl_files_list.tmp <@(perl_and_python_idl_files))' ,
111 }, 122 },
112 'inputs': [ 123 'inputs': [
113 'scripts/preprocess_idls.py', 124 'scripts/preprocess_idls.py',
114 '<(idl_files_list)', 125 '<(idl_files_list)',
115 '<!@(cat <(idl_files_list))', 126 '<!@(cat <(idl_files_list))',
116 ], 127 ],
117 'outputs': [ 128 'outputs': [
118 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp', 129 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
119 '<@(generated_global_constructors_idl_files)', 130 '<@(generated_global_constructors_idl_files)',
120 '<(SHARED_INTERMEDIATE_DIR)/EventNames.in', 131 '<(SHARED_INTERMEDIATE_DIR)/EventNames.in',
(...skipping 15 matching lines...) Expand all
136 '--dedicatedworkerglobalscope-constructors-file', 147 '--dedicatedworkerglobalscope-constructors-file',
137 '<(SHARED_INTERMEDIATE_DIR)/DedicatedWorkerGlobalScopeConstructors.idl' , 148 '<(SHARED_INTERMEDIATE_DIR)/DedicatedWorkerGlobalScopeConstructors.idl' ,
138 '--event-names-file', 149 '--event-names-file',
139 '<(SHARED_INTERMEDIATE_DIR)/EventNames.in', 150 '<(SHARED_INTERMEDIATE_DIR)/EventNames.in',
140 '<@(write_file_only_if_changed)', 151 '<@(write_file_only_if_changed)',
141 ], 152 ],
142 'message': 'Resolving partial interfaces dependencies in all IDL files', 153 'message': 'Resolving partial interfaces dependencies in all IDL files',
143 }] 154 }]
144 }, 155 },
145 { 156 {
146 'target_name': 'bindings_sources', 157 'target_name': 'perl_bindings_sources',
147 'type': 'none', 158 'type': 'none',
148 # The 'binding' rule generates .h files, so mark as hard_dependency, per: 159 # The 'binding' rule generates .h files, so mark as hard_dependency, per:
149 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependen cies 160 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependen cies
150 'hard_dependency': 1, 161 'hard_dependency': 1,
151 'dependencies': [ 162 'dependencies': [
152 'supplemental_dependencies', 163 'supplemental_dependencies',
153 '../core/core_derived_sources.gyp:generate_test_support_idls', 164 '../core/core_derived_sources.gyp:generate_test_support_idls',
154 ], 165 ],
155 'sources': [ 166 'sources': [
156 '<@(idl_files)', 167 '<@(perl_idl_files)',
157 '<@(webcore_test_support_idl_files)', 168 '<@(perl_webcore_test_support_idl_files)',
158 ], 169 ],
159 'rules': [{ 170 'rules': [{
160 'rule_name': 'binding', 171 'rule_name': 'perl_binding',
161 'extension': 'idl', 172 'extension': 'idl',
162 'msvs_external_rule': 1, 173 'msvs_external_rule': 1,
163 'inputs': [ 174 'inputs': [
164 'scripts/generate-bindings.pl', 175 'scripts/generate-bindings.pl',
165 'scripts/CodeGeneratorV8.pm', 176 'scripts/CodeGeneratorV8.pm',
166 'scripts/IDLParser.pm', 177 'scripts/IDLParser.pm',
167 'scripts/IDLSerializer.pm', 178 'scripts/IDLSerializer.pm',
168 '../core/scripts/preprocessor.pm', 179 '../core/scripts/preprocessor.pm',
169 'scripts/IDLAttributes.txt', 180 'scripts/IDLAttributes.txt',
170 # FIXME: If the dependency structure changes, we rebuild all files, 181 # FIXME: If the dependency structure changes, we rebuild all files,
171 # since we're not computing dependencies file-by-file in the build. 182 # since we're not computing dependencies file-by-file in the build.
172 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp', 183 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
173 # FIXME: Similarly, if any partial interface changes, rebuild 184 # FIXME: Similarly, if any partial interface changes, rebuild
174 # everything, since every IDL potentially depends on them, because 185 # everything, since every IDL potentially depends on them, because
175 # we're not computing dependencies file-by-file. 186 # we're not computing dependencies file-by-file.
176 '<!@pymod_do_main(supplemental_idl_files <@(idl_files))', 187 '<!@pymod_do_main(supplemental_idl_files <@(perl_and_python_idl_files) )',
177 # Generated IDLs are all partial interfaces, hence everything 188 # Generated IDLs are all partial interfaces, hence everything
178 # potentially depends on them. 189 # potentially depends on them.
179 '<@(generated_global_constructors_idl_files)', 190 '<@(generated_global_constructors_idl_files)',
180 ], 191 ],
181 'outputs': [ 192 'outputs': [
182 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8<(RULE_INPUT_ROOT).cpp', 193 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp',
183 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8<(RULE_INPUT_ROOT).h', 194 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h',
184 ], 195 ],
185 'variables': { 196 'variables': {
186 # IDL include paths. The generator will search recursively for IDL 197 # IDL include paths. The generator will search recursively for IDL
187 # files under these locations. 198 # files under these locations.
188 'generator_include_dirs': [ 199 'generator_include_dirs': [
200 '--include', '../core',
189 '--include', '../modules', 201 '--include', '../modules',
190 '--include', '../core',
Nils Barth (inactive) 2013/07/08 05:24:38 (Consistent order with overall IDL lists.)
191 '--include', '<(SHARED_INTERMEDIATE_DIR)/webkit', 202 '--include', '<(SHARED_INTERMEDIATE_DIR)/webkit',
192 ], 203 ],
193 # Hook for embedders to specify extra directories to find IDL files. 204 # Hook for embedders to specify extra directories to find IDL files.
194 'extra_blink_generator_include_dirs%': [], 205 'extra_blink_generator_include_dirs%': [],
195 }, 206 },
196 'msvs_cygwin_shell': 0, 207 'msvs_cygwin_shell': 0,
197 # sanitize-win-build-log.sed uses a regex which matches this command 208 # sanitize-win-build-log.sed uses a regex which matches this command
198 # line (Perl script + .idl file being processed). 209 # line (Perl script + .idl file being processed).
199 # Update that regex if command line changes (other than changing flags) 210 # Update that regex if command line changes (other than changing flags)
200 'action': [ 211 'action': [
201 '<(perl_exe)', 212 '<(perl_exe)',
202 '-w', 213 '-w',
203 '-Iscripts', 214 '-Iscripts',
204 '-I../core/scripts', 215 '-I../core/scripts',
205 '-I../../../JSON/out/lib/perl5', 216 '-I../../../JSON/out/lib/perl5',
206 'scripts/generate-bindings.pl', 217 'scripts/generate-bindings.pl',
haraken 2013/07/08 06:06:29 Would you rename: generate-bindings.pl => depre
Nils Barth (inactive) 2013/07/09 08:48:16 Done.
207 '--outputDir', 218 '--outputDir',
208 '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings', 219 '<(bindings_output_dir)',
209 '--idlAttributesFile', 220 '--idlAttributesFile',
210 'scripts/IDLAttributes.txt', 221 'scripts/IDLAttributes.txt',
211 '--defines', 222 '--defines',
212 '<(feature_defines)', 223 '<(feature_defines)',
213 '<@(generator_include_dirs)', 224 '<@(generator_include_dirs)',
214 '<@(extra_blink_generator_include_dirs)', 225 '<@(extra_blink_generator_include_dirs)',
215 '--supplementalDependencyFile', 226 '--supplementalDependencyFile',
216 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp', 227 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
217 '--additionalIdlFiles', 228 '--additionalIdlFiles',
218 '<(webcore_test_support_idl_files)', 229 '<(perl_webcore_test_support_idl_files)',
219 '<@(preprocessor)', 230 '<@(preprocessor)',
220 '<@(write_file_only_if_changed)', 231 '<@(write_file_only_if_changed)',
221 '<(RULE_INPUT_PATH)', 232 '<(RULE_INPUT_PATH)',
222 ], 233 ],
223 'message': 'Generating binding from <(RULE_INPUT_PATH)', 234 'message': 'Generating binding from <(RULE_INPUT_PATH)',
224 }], 235 }],
225 }, 236 },
226 { 237 {
238 'target_name': 'python_bindings_sources',
239 'type': 'none',
240 # The 'binding' rule generates .h files, so mark as hard_dependency, per:
241 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependen cies
242 'hard_dependency': 1,
243 'dependencies': [
244 'supplemental_dependencies',
245 '../core/core_derived_sources.gyp:generate_test_support_idls',
246 ],
247 'sources': [
248 '<@(python_idl_files)',
249 '<@(python_webcore_test_support_idl_files)',
250 ],
251 'rules': [{
252 'rule_name': 'python_binding',
253 'extension': 'idl',
254 'msvs_external_rule': 1,
255 'inputs': [
256 'scripts/generate_bindings.py',
257 'scripts/build_ir.py',
258 'scripts/code_generator_v8.py',
259 'scripts/IDLAttributes.txt',
260 # FIXME: If the dependency structure changes, we rebuild all files,
261 # since we're not computing dependencies file-by-file in the build.
262 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
263 # FIXME: Similarly, if any partial interface changes, rebuild
264 # everything, since every IDL potentially depends on them, because
265 # we're not computing dependencies file-by-file.
266 '<!@pymod_do_main(supplemental_idl_files <@(perl_and_python_idl_files) )',
267 # Generated IDLs are all partial interfaces, hence everything
268 # potentially depends on them.
269 '<@(generated_global_constructors_idl_files)',
270 ],
271 'outputs': [
272 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp',
273 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h',
274 ],
275 'variables': {
276 # IDL include paths. The generator will search recursively for IDL
277 # files under these locations.
278 'generator_include_dirs': [
279 '--include', '../core',
280 '--include', '../modules',
281 '--include', '<(SHARED_INTERMEDIATE_DIR)/webkit',
282 ],
283 # Hook for embedders to specify extra directories to find IDL files.
284 'extra_blink_generator_include_dirs%': [],
285 },
286 'msvs_cygwin_shell': 0,
287 # sanitize-win-build-log.sed uses a regex which matches this command
288 # line (Python script + .idl file being processed).
289 # Update that regex if command line changes (other than changing flags)
290 'action': [
291 'python',
292 'scripts/generate_bindings.py',
293 '--output-dir',
294 '<(bindings_output_dir)',
295 '--idl-attributes-file',
296 'scripts/IDLAttributes.txt',
297 '--defines',
298 '<(feature_defines)',
299 '<@(generator_include_dirs)',
300 '<@(extra_blink_generator_include_dirs)',
301 '--supplemental-dependency-file',
302 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
303 '--additional-idl-files',
304 '<(python_webcore_test_support_idl_files)',
305 '<@(write_file_only_if_changed)',
306 '<(RULE_INPUT_PATH)',
307 ],
308 'message': 'Generating binding from <(RULE_INPUT_PATH)',
309 }],
310 },
311 {
227 'target_name': 'bindings_derived_sources', 312 'target_name': 'bindings_derived_sources',
228 'type': 'none', 313 'type': 'none',
229 'dependencies': [ 314 'dependencies': [
230 'supplemental_dependencies', 315 'supplemental_dependencies',
231 'bindings_sources', 316 'perl_bindings_sources',
317 'python_bindings_sources',
232 ], 318 ],
233 'actions': [{ 319 'actions': [{
234 'action_name': 'derived_sources_all_in_one', 320 'action_name': 'derived_sources_all_in_one',
235 'inputs': [ 321 'inputs': [
236 '../core/scripts/action_derivedsourcesallinone.py', 322 '../core/scripts/action_derivedsourcesallinone.py',
237 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp', 323 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
238 ], 324 ],
239 'outputs': [ 325 'outputs': [
240 '<@(derived_sources_aggregate_files)', 326 '<@(derived_sources_aggregate_files)',
241 ], 327 ],
242 'action': [ 328 'action': [
243 'python', 329 'python',
244 '../core/scripts/action_derivedsourcesallinone.py', 330 '../core/scripts/action_derivedsourcesallinone.py',
245 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp', 331 '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp',
246 '--', 332 '--',
247 '<@(derived_sources_aggregate_files)', 333 '<@(derived_sources_aggregate_files)',
248 ], 334 ],
249 'message': 'Generating bindings derived sources', 335 'message': 'Generating bindings derived sources',
250 }], 336 }],
251 }, 337 },
252 ], 338 ],
253 } 339 }
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/build_ir.py » ('j') | Source/bindings/scripts/build_ir.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698