aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2017-11-14 16:48:45 -0800
committerGravatar GitHub <noreply@github.com>2017-11-14 16:48:45 -0800
commit4fdb08ad6214f10982e843accd9d25897b598a61 (patch)
tree7e24d3605440544650c56ad66ad3d09419ecff2a
parent0d5e24d690af33284e76ed3a8fb7c4697bdb3701 (diff)
Revert "Restructure plugin builds to avoid building more than needed"
-rw-r--r--BUILD88
-rw-r--r--bazel/grpc_build_system.bzl4
-rw-r--r--src/compiler/protobuf_plugin.h1
-rw-r--r--src/compiler/python_generator_helpers.h2
4 files changed, 36 insertions, 59 deletions
diff --git a/BUILD b/BUILD
index 6e8191af16..6a514496f6 100644
--- a/BUILD
+++ b/BUILD
@@ -316,12 +316,36 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_plugin_support",
+ srcs = [
+ "src/compiler/cpp_generator.cc",
+ "src/compiler/csharp_generator.cc",
+ "src/compiler/node_generator.cc",
+ "src/compiler/objective_c_generator.cc",
+ "src/compiler/php_generator.cc",
+ "src/compiler/python_generator.cc",
+ "src/compiler/ruby_generator.cc",
+ ],
hdrs = [
"src/compiler/config.h",
+ "src/compiler/cpp_generator.h",
"src/compiler/cpp_generator_helpers.h",
+ "src/compiler/csharp_generator.h",
+ "src/compiler/csharp_generator_helpers.h",
"src/compiler/generator_helpers.h",
+ "src/compiler/node_generator.h",
+ "src/compiler/node_generator_helpers.h",
+ "src/compiler/objective_c_generator.h",
+ "src/compiler/objective_c_generator_helpers.h",
+ "src/compiler/php_generator.h",
+ "src/compiler/php_generator_helpers.h",
"src/compiler/protobuf_plugin.h",
+ "src/compiler/python_generator.h",
"src/compiler/python_generator_helpers.h",
+ "src/compiler/python_private_generator.h",
+ "src/compiler/ruby_generator.h",
+ "src/compiler/ruby_generator_helpers-inl.h",
+ "src/compiler/ruby_generator_map-inl.h",
+ "src/compiler/ruby_generator_string-inl.h",
"src/compiler/schema_interface.h",
],
external_deps = [
@@ -335,93 +359,43 @@ grpc_cc_library(
grpc_proto_plugin(
name = "grpc_cpp_plugin",
- srcs = [
- "src/compiler/cpp_generator.cc",
- "src/compiler/cpp_plugin.cc",
- ],
- hdrs = [
- "src/compiler/cpp_generator.h",
- ],
+ srcs = ["src/compiler/cpp_plugin.cc"],
deps = [":grpc_plugin_support"],
)
grpc_proto_plugin(
name = "grpc_csharp_plugin",
- srcs = [
- "src/compiler/csharp_generator.cc",
- "src/compiler/csharp_plugin.cc",
- ],
- hdrs = [
- "src/compiler/csharp_generator.h",
- "src/compiler/csharp_generator_helpers.h",
- ],
+ srcs = ["src/compiler/csharp_plugin.cc"],
deps = [":grpc_plugin_support"],
)
grpc_proto_plugin(
name = "grpc_node_plugin",
- srcs = [
- "src/compiler/node_generator.cc",
- "src/compiler/node_plugin.cc",
- ],
- hdrs = [
- "src/compiler/node_generator.h",
- "src/compiler/node_generator_helpers.h",
- ],
+ srcs = ["src/compiler/node_plugin.cc"],
deps = [":grpc_plugin_support"],
)
grpc_proto_plugin(
name = "grpc_objective_c_plugin",
- srcs = [
- "src/compiler/objective_c_generator.cc",
- "src/compiler/objective_c_plugin.cc",
- ],
- hdrs = [
- "src/compiler/objective_c_generator.h",
- "src/compiler/objective_c_generator_helpers.h",
- ],
+ srcs = ["src/compiler/objective_c_plugin.cc"],
deps = [":grpc_plugin_support"],
)
grpc_proto_plugin(
name = "grpc_php_plugin",
- srcs = [
- "src/compiler/php_generator.cc",
- "src/compiler/php_plugin.cc",
- ],
- hdrs = [
- "src/compiler/php_generator.h",
- "src/compiler/php_generator_helpers.h",
- ],
+ srcs = ["src/compiler/php_plugin.cc"],
deps = [":grpc_plugin_support"],
)
grpc_proto_plugin(
name = "grpc_python_plugin",
- srcs = [
- "src/compiler/python_generator.cc",
- "src/compiler/python_plugin.cc",
- ],
- hdrs = [
- "src/compiler/python_generator.h",
- "src/compiler/python_private_generator.h",
- ],
+ srcs = ["src/compiler/python_plugin.cc"],
deps = [":grpc_plugin_support"],
)
grpc_proto_plugin(
name = "grpc_ruby_plugin",
- srcs = [
- "src/compiler/ruby_generator.cc",
- "src/compiler/ruby_plugin.cc",
- ],
- hdrs = [
- "src/compiler/ruby_generator.h",
- "src/compiler/ruby_generator_helpers-inl.h",
- "src/compiler/ruby_generator_map-inl.h",
- "src/compiler/ruby_generator_string-inl.h",
- ],
+ srcs = ["src/compiler/ruby_plugin.cc"],
deps = [":grpc_plugin_support"],
)
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index 8a8ec9bc84..b35ca73745 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -49,10 +49,10 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
alwayslink = alwayslink,
)
-def grpc_proto_plugin(name, srcs = [], hdrs = [], deps = []):
+def grpc_proto_plugin(name, srcs = [], deps = []):
native.cc_binary(
name = name,
- srcs = srcs + hdrs,
+ srcs = srcs,
deps = deps,
)
diff --git a/src/compiler/protobuf_plugin.h b/src/compiler/protobuf_plugin.h
index 0f22dd4f33..1551908156 100644
--- a/src/compiler/protobuf_plugin.h
+++ b/src/compiler/protobuf_plugin.h
@@ -22,6 +22,7 @@
#include "src/compiler/config.h"
#include "src/compiler/cpp_generator_helpers.h"
#include "src/compiler/python_generator_helpers.h"
+#include "src/compiler/python_private_generator.h"
#include "src/compiler/schema_interface.h"
#include <vector>
diff --git a/src/compiler/python_generator_helpers.h b/src/compiler/python_generator_helpers.h
index 5ecd192163..b1b58befdf 100644
--- a/src/compiler/python_generator_helpers.h
+++ b/src/compiler/python_generator_helpers.h
@@ -26,6 +26,8 @@
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
+#include "src/compiler/python_generator.h"
+#include "src/compiler/python_private_generator.h"
using grpc::protobuf::Descriptor;
using grpc::protobuf::FileDescriptor;