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

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: better docs and dependency, format 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
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..f133de86012c1ceddac8167678ab6fd9beea51b0 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,19 @@ template("proto_library") {
if (defined(invoker.deps)) {
deps += invoker.deps
}
+
+ if (defined(invoker.json_converter)) {
+ args += [
+ "--plugin=protoc-gen-json_converter=" +
+ rebase_path(invoker.json_converter, root_build_dir),
+ "--json_converter_out=output_dir=:$rel_out_dir",
+ ]
+ 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"

Powered by Google App Engine
This is Rietveld 408576698