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

Unified Diff: third_party/WebKit/Source/bindings/scripts/scripts.gni

Issue 2970003002: Add code generation for ConditionalFeatures bindings code (Closed)
Patch Set: Move awkward dependency into scripts.gni with its counterpart Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/scripts/scripts.gni
diff --git a/third_party/WebKit/Source/bindings/scripts/scripts.gni b/third_party/WebKit/Source/bindings/scripts/scripts.gni
index 9fefa29e601331ce506918801092f702ddc707e1..fa2893634f17c75850a56a962e45b0b5e12662c0 100644
--- a/third_party/WebKit/Source/bindings/scripts/scripts.gni
+++ b/third_party/WebKit/Source/bindings/scripts/scripts.gni
@@ -434,3 +434,58 @@ template("generate_global_constructors") {
deps = invoker.deps
}
}
+
+# Calls the generate_conditional_features script.
+#
+# Parameters:
+# sources = a list of source IDL files.
+# global_objects_file = a global objects file generated by compute_global_objects
+# component = component to generate conditional feature bindings for ("Core" or "Modules")
+# output_dir = output directory to generate cpp file and header file.
+# deps = dependencies
+#
+template("generate_conditional_features") {
+ action(target_name) {
+ script = "//third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py"
+
+ # Write the file list to a unique temp file to avoid blowing out the
+ # command line length limit.
+ idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp"
+ write_file(idl_files_list, rebase_path(invoker.sources, root_build_dir))
+
+ inputs = [
+ "//third_party/WebKit/Source/bindings/scripts/utilities.py",
+ "//third_party/WebKit/Source/bindings/templates/ConditionalFeaturesFor${invoker.component}.cpp.tmpl",
+ "//third_party/WebKit/Source/bindings/templates/ConditionalFeaturesFor${invoker.component}.h.tmpl",
+ idl_files_list,
+ invoker.global_objects_file,
+ ] + invoker.sources
+
+ args = [
+ "--output-directory",
+ rebase_path(invoker.output_dir, root_build_dir),
+ "--info-dir",
+ "gen/blink/bindings",
+ "--cache-dir",
+ rebase_path(bindings_scripts_output_dir, root_build_dir),
+ "--target-component",
+ invoker.component,
+ "--idl-files-list",
+ rebase_path(idl_files_list, root_build_dir),
+ "--global-objects-file",
+ rebase_path(invoker.global_objects_file, root_build_dir),
+ ]
+
+ outputs = [
+ "${invoker.output_dir}/ConditionalFeaturesFor${invoker.component}.cpp",
+ "${invoker.output_dir}/ConditionalFeaturesFor${invoker.component}.h",
+ ]
+
+ # TODO: This should not always require modules; For core features, this
+ # should be interfaces_info_core (w/o modules). This is the same issue as
+ # above in the idl_compiler template.
+ # http://crbug.com/358074
haraken 2017/07/14 01:23:30 tasak, bashi: The question is whether this TODO is
bashi 2017/07/14 02:15:17 It depends on what information generate_conditiona
+ deps = invoker.deps +
+ [ "//third_party/WebKit/Source/bindings/modules:interfaces_info" ]
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698