| 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/bindings/core/v8/generated.gni") | 5 import("//third_party/WebKit/Source/bindings/core/v8/generated.gni") |
| 6 import("//third_party/WebKit/Source/bindings/modules/idl.gni") | 6 import("//third_party/WebKit/Source/bindings/modules/idl.gni") |
| 7 import("//third_party/WebKit/Source/bindings/modules/modules.gni") | 7 import("//third_party/WebKit/Source/bindings/modules/modules.gni") |
| 8 | 8 |
| 9 bindings_scripts_dir = get_path_info(".", "abspath") | 9 bindings_scripts_dir = get_path_info(".", "abspath") |
| 10 bindings_scripts_output_dir = "$root_gen_dir/blink/bindings/scripts" | 10 bindings_scripts_output_dir = "$root_gen_dir/blink/bindings/scripts" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 idl_lexer_parser_files = get_path_info(_gypi.idl_lexer_parser_files, "abspath") | 21 idl_lexer_parser_files = get_path_info(_gypi.idl_lexer_parser_files, "abspath") |
| 22 idl_compiler_files = get_path_info(_gypi.idl_compiler_files, "abspath") | 22 idl_compiler_files = get_path_info(_gypi.idl_compiler_files, "abspath") |
| 23 | 23 |
| 24 # Calls the compute_interfaces_info_individual script. | 24 # Calls the compute_interfaces_info_individual script. |
| 25 # | 25 # |
| 26 # Parameters: | 26 # Parameters: |
| 27 # sources_static = list of IDL files to pass as inputs | 27 # sources_static = list of IDL files to pass as inputs |
| 28 # sources_generated = list of generated IDL files to pass as inputs | 28 # sources_generated = list of generated IDL files to pass as inputs |
| 29 # component_dir = name if subdirectory (one word, no slashes) of component. | 29 # component_dir = name if subdirectory (one word, no slashes) of component. |
| 30 # interfaces_info_file = output pickle file for interfaces info. | 30 # interfaces_info_file = output pickle file for interfaces info. |
| 31 # component_wide_info_file = output pickle file for component wide info. | 31 # component_info_file = output pickle file for component wide info. |
| 32 # deps = dependencies | 32 # deps = dependencies |
| 33 # | 33 # |
| 34 # FIXME: Note the static/generated split is for consistency with GYP. This | 34 # FIXME: Note the static/generated split is for consistency with GYP. This |
| 35 # split is not necessary in the GN build and could be combined into a single | 35 # split is not necessary in the GN build and could be combined into a single |
| 36 # "sources". | 36 # "sources". |
| 37 template("compute_interfaces_info_individual") { | 37 template("compute_interfaces_info_individual") { |
| 38 action(target_name) { | 38 action(target_name) { |
| 39 script = "$bindings_scripts_dir/compute_interfaces_info_individual.py" | 39 script = "$bindings_scripts_dir/compute_interfaces_info_individual.py" |
| 40 if (defined(invoker.visibility)) { | 40 if (defined(invoker.visibility)) { |
| 41 visibility = invoker.visibility | 41 visibility = invoker.visibility |
| 42 } | 42 } |
| 43 | 43 |
| 44 # Save static list to temp file to avoid blowing out command-line length | 44 # Save static list to temp file to avoid blowing out command-line length |
| 45 # limit. | 45 # limit. |
| 46 file_list = "$target_gen_dir/${target_name}_file_list.txt" | 46 file_list = "$target_gen_dir/${target_name}_file_list.txt" |
| 47 write_file(file_list, rebase_path(invoker.sources_static, root_build_dir)) | 47 write_file(file_list, rebase_path(invoker.sources_static, root_build_dir)) |
| 48 | 48 |
| 49 inputs = [ | 49 inputs = [ |
| 50 "$bindings_scripts_dir/utilities.py", | 50 "$bindings_scripts_dir/utilities.py", |
| 51 file_list, | 51 file_list, |
| 52 ] + invoker.sources_static + invoker.sources_generated | 52 ] + invoker.sources_static + invoker.sources_generated |
| 53 | 53 |
| 54 outputs = [ | 54 outputs = [ |
| 55 invoker.interfaces_info_file, | 55 invoker.interfaces_info_file, |
| 56 invoker.component_wide_info_file, | 56 invoker.component_info_file, |
| 57 ] | 57 ] |
| 58 | 58 |
| 59 args = [ | 59 args = [ |
| 60 "--cache-directory", | 60 "--cache-directory", |
| 61 rebase_path(bindings_scripts_output_dir, root_build_dir), | 61 rebase_path(bindings_scripts_output_dir, root_build_dir), |
| 62 "--idl-files-list", rebase_path(file_list, root_build_dir), | 62 "--idl-files-list", rebase_path(file_list, root_build_dir), |
| 63 "--interfaces-info-file", | 63 "--interfaces-info-file", |
| 64 rebase_path(invoker.interfaces_info_file, root_build_dir), | 64 rebase_path(invoker.interfaces_info_file, root_build_dir), |
| 65 "--component-info-file", | 65 "--component-info-file", |
| 66 rebase_path(invoker.component_wide_info_file, root_build_dir), | 66 rebase_path(invoker.component_info_file, root_build_dir), |
| 67 "--write-file-only-if-changed=1", | 67 "--write-file-only-if-changed=1", |
| 68 "--", | 68 "--", |
| 69 ] + rebase_path(invoker.sources_generated, root_build_dir) | 69 ] + rebase_path(invoker.sources_generated, root_build_dir) |
| 70 | 70 |
| 71 deps = [ | 71 deps = [ |
| 72 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", | 72 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", |
| 73 ] + invoker.deps | 73 ] + invoker.deps |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 # Runs the idl_compiler script over a list of sources. | 114 # Runs the idl_compiler script over a list of sources. |
| 115 # | 115 # |
| 116 # Parameters: | 116 # Parameters: |
| 117 # sources = list of IDL files to compile | 117 # sources = list of IDL files to compile |
| 118 # output_dir = string containing the directory to put the output files. | 118 # output_dir = string containing the directory to put the output files. |
| 119 # output_name_suffix = a suffix after the basename of the output file names. | 119 # output_name_suffix = a suffix after the basename of the output file names. |
| 120 # target_component = component to generate code for. | 120 # target_component = component to generate code for. |
| 121 # component_info = a filename of pickle file which contains component |
| 122 # information |
| 121 template("idl_compiler") { | 123 template("idl_compiler") { |
| 122 output_dir = invoker.output_dir | 124 output_dir = invoker.output_dir |
| 123 output_name_suffix = invoker.output_name_suffix | 125 output_name_suffix = invoker.output_name_suffix |
| 124 | 126 |
| 125 action_foreach(target_name) { | 127 action_foreach(target_name) { |
| 126 # TODO(brettw) GYP adds a "-S before the script name to skip "import site" t
o | 128 # TODO(brettw) GYP adds a "-S before the script name to skip "import site" t
o |
| 127 # speed up startup. Figure out if we need this and do something similar (not | 129 # speed up startup. Figure out if we need this and do something similar (not |
| 128 # really expressible in GN now). | 130 # really expressible in GN now). |
| 129 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" | 131 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" |
| 130 | 132 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 158 ] | 160 ] |
| 159 | 161 |
| 160 args = [ | 162 args = [ |
| 161 "--cache-dir", | 163 "--cache-dir", |
| 162 rebase_path(bindings_scripts_output_dir, root_build_dir), | 164 rebase_path(bindings_scripts_output_dir, root_build_dir), |
| 163 "--output-dir", | 165 "--output-dir", |
| 164 rebase_path(output_dir, root_build_dir), | 166 rebase_path(output_dir, root_build_dir), |
| 165 "--interfaces-info", | 167 "--interfaces-info", |
| 166 rebase_path("$bindings_modules_output_dir/InterfacesInfoOverall.pickle", | 168 rebase_path("$bindings_modules_output_dir/InterfacesInfoOverall.pickle", |
| 167 root_build_dir), | 169 root_build_dir), |
| 170 "--component-info", |
| 171 rebase_path(invoker.component_info, root_build_dir), |
| 168 "--write-file-only-if-changed=1", # Always true for Ninja. | 172 "--write-file-only-if-changed=1", # Always true for Ninja. |
| 169 "--target-component", | 173 "--target-component", |
| 170 invoker.target_component, | 174 invoker.target_component, |
| 171 "{{source}}", | 175 "{{source}}", |
| 172 ] | 176 ] |
| 173 | 177 |
| 174 deps = [ | 178 deps = [ |
| 175 # FIXME: should be interfaces_info_core (w/o modules) | 179 # FIXME: should be interfaces_info_core (w/o modules) |
| 176 # http://crbug.com/358074 | 180 # http://crbug.com/358074 |
| 177 "//third_party/WebKit/Source/bindings/modules:interfaces_info", | 181 "//third_party/WebKit/Source/bindings/modules:interfaces_info", |
| 178 | 182 |
| 179 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", | 183 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", |
| 180 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", | 184 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", |
| 181 "//third_party/WebKit/Source/core:generated_testing_idls", | 185 "//third_party/WebKit/Source/core:generated_testing_idls", |
| 182 ] | 186 ] |
| 183 } | 187 } |
| 184 } | 188 } |
| 185 | 189 |
| 186 # Runs the idl_compiler to generate IDL dictionary and union impl files. | 190 # Runs the idl_compiler to generate IDL dictionary and union impl files. |
| 187 # | 191 # |
| 188 # Parameters: | 192 # Parameters: |
| 189 # sources = a list of IDL files to process | 193 # sources = a list of IDL files to process |
| 190 # outputs = a list of files to write to | 194 # outputs = a list of files to write to |
| 191 # output_dir = the directory to put the output files | 195 # output_dir = the directory to put the output files |
| 192 # component_wide_info = a filename of pickle file which contains component | 196 # component_info = a filename of pickle file which contains component |
| 193 # wide information | 197 # information |
| 194 # target_component = component to generate code for | 198 # target_component = component to generate code for |
| 195 template("idl_impl") { | 199 template("idl_impl") { |
| 196 dictionary_impl_output_dir = "$root_gen_dir/blink/" | 200 dictionary_impl_output_dir = "$root_gen_dir/blink/" |
| 197 | 201 |
| 198 action(target_name) { | 202 action(target_name) { |
| 199 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" | 203 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" |
| 200 idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" | 204 idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" |
| 201 write_file(idl_files_list, rebase_path(invoker.sources, root_build_dir)) | 205 write_file(idl_files_list, rebase_path(invoker.sources, root_build_dir)) |
| 202 | 206 |
| 203 inputs = [ idl_files_list ] + invoker.sources | 207 inputs = [ idl_files_list ] + invoker.sources |
| 204 outputs = invoker.outputs | 208 outputs = invoker.outputs |
| 205 | 209 |
| 206 args = [ | 210 args = [ |
| 207 "--cache-dir", | 211 "--cache-dir", |
| 208 rebase_path(bindings_scripts_output_dir, root_build_dir), | 212 rebase_path(bindings_scripts_output_dir, root_build_dir), |
| 209 "--output-dir", | 213 "--output-dir", |
| 210 rebase_path(invoker.output_dir, root_build_dir), | 214 rebase_path(invoker.output_dir, root_build_dir), |
| 211 "--impl-output-dir", | 215 "--impl-output-dir", |
| 212 rebase_path(dictionary_impl_output_dir, root_build_dir), | 216 rebase_path(dictionary_impl_output_dir, root_build_dir), |
| 213 "--interfaces-info", | 217 "--interfaces-info", |
| 214 rebase_path("$bindings_modules_output_dir/InterfacesInfoOverall.pickle", | 218 rebase_path("$bindings_modules_output_dir/InterfacesInfoOverall.pickle", |
| 215 root_build_dir), | 219 root_build_dir), |
| 216 "--component-info", | 220 "--component-info", |
| 217 rebase_path(invoker.component_wide_info, root_build_dir), | 221 rebase_path(invoker.component_info, root_build_dir), |
| 218 "--target-component", | 222 "--target-component", |
| 219 invoker.target_component, | 223 invoker.target_component, |
| 220 "--write-file-only-if-changed=1", | 224 "--write-file-only-if-changed=1", |
| 221 "--generate-impl", | 225 "--generate-impl", |
| 222 rebase_path(idl_files_list, root_build_dir), | 226 rebase_path(idl_files_list, root_build_dir), |
| 223 ] | 227 ] |
| 224 | 228 |
| 225 deps = [ | 229 deps = [ |
| 226 # FIXME: should be interfaces_info_core (w/o modules) | 230 # FIXME: should be interfaces_info_core (w/o modules) |
| 227 # http://crbug.com/358074 | 231 # http://crbug.com/358074 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 output_header_files += [ | 351 output_header_files += [ |
| 348 "$output_dir/${interface}${component}Constructors.h" | 352 "$output_dir/${interface}${component}Constructors.h" |
| 349 ] | 353 ] |
| 350 } | 354 } |
| 351 | 355 |
| 352 outputs = output_idl_files + output_header_files | 356 outputs = output_idl_files + output_header_files |
| 353 deps = invoker.deps | 357 deps = invoker.deps |
| 354 } | 358 } |
| 355 } | 359 } |
| 356 | 360 |
| OLD | NEW |