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

Unified Diff: third_party/protobuf/proto_library.gni

Issue 2034373002: Generate the proto JSON converter for DOM distiller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows-specific fixes Created 4 years, 4 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
« no previous file with comments | « third_party/dom_distiller_js/test_sample_json_converter.h.golden ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/proto_library.gni
diff --git a/third_party/protobuf/proto_library.gni b/third_party/protobuf/proto_library.gni
index 050154ce8cfbd559e01f24346ca22f7da88af1f5..8e8c130b95be64b66b124d8b0fe612b59ddf9b22 100644
--- a/third_party/protobuf/proto_library.gni
+++ b/third_party/protobuf/proto_library.gni
@@ -41,6 +41,9 @@
# generator_plugin_options (optional)
# Extra flags passed to the plugin. See cc_generator_options.
#
+# json_converter (optional)
+# The plugin executable to generate JSON converter.
+#
# cc_include (optional)
# String listing an extra include that should be passed.
# Example: cc_include = "foo/bar.h"
@@ -48,6 +51,9 @@
# deps (optional)
# Additional dependencies.
#
+# inputs (optional)
+# Additional inputs for dependency checking.
+#
# Parameters for compiling the generated code:
#
# component_build_force_source_set (Default=false)
@@ -103,6 +109,11 @@ template("proto_library") {
outputs = []
+ inputs = []
+ if (defined(invoker.inputs)) {
+ inputs += invoker.inputs
+ }
+
args = []
if (defined(invoker.cc_include)) {
args += [
@@ -209,11 +220,21 @@ template("proto_library") {
if (defined(invoker.deps)) {
deps += invoker.deps
}
+
+ if (defined(invoker.json_converter)) {
+ args += [
+ "--plugin=protoc-gen-json_converter=" +
+ # It is required to use backslash on Windows for .bat files.
+ rebase_path(invoker.json_converter),
+ "--json_converter_out=output_dir=:$rel_out_dir",
+ ]
+ inputs += [ invoker.json_converter ]
+ outputs += [ "$out_dir/{{source_name_part}}_json_converter.h" ]
+ }
}
if (defined(invoker.component_build_force_source_set) &&
- invoker.component_build_force_source_set &&
- is_component_build) {
+ invoker.component_build_force_source_set && is_component_build) {
link_target_type = "source_set"
} else {
link_target_type = "static_library"
« no previous file with comments | « third_party/dom_distiller_js/test_sample_json_converter.h.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698