aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOla Rozenfeld <olaola@google.com>2019-03-18 11:32:38 -0400
committerGitHub <noreply@github.com>2019-03-18 11:32:38 -0400
commit6a5a17b77bca5e70417746fd0616db3849731619 (patch)
tree7c1c138afbf9683aa7b27692da9d15df39086338
parentcfe8e540cbb424e3ebc649ddcbc91190f70e23a6 (diff)
downloadbazelbuild-remote-apis-6a5a17b77bca5e70417746fd0616db3849731619.tar.gz
Adding C++ gRPC libraries. Also fixing build for latest Bazel. (#64)
-rw-r--r--BUILD.googleapis35
-rw-r--r--WORKSPACE48
-rw-r--r--build/bazel/remote/execution/v2/BUILD17
-rw-r--r--build/bazel/semver/BUILD11
-rw-r--r--external/BUILD.googleapis78
5 files changed, 149 insertions, 40 deletions
diff --git a/BUILD.googleapis b/BUILD.googleapis
deleted file mode 100644
index 0998307..0000000
--- a/BUILD.googleapis
+++ /dev/null
@@ -1,35 +0,0 @@
-package(default_visibility = ["//visibility:public"])
-
-licenses(["notice"])
-
-proto_library(
- name = "google_api_annotations_proto",
- srcs = ["google/api/annotations.proto"],
- deps = [
- ":google_api_http_proto",
- "@com_google_protobuf//:descriptor_proto",
- ],
-)
-
-proto_library(
- name = "google_api_http_proto",
- srcs = ["google/api/http.proto"],
-)
-
-proto_library(
- name = "google_longrunning_operations_proto",
- srcs = ["google/longrunning/operations.proto"],
- deps = [
- ":google_api_annotations_proto",
- ":google_api_http_proto",
- ":google_rpc_status_proto",
- "@com_google_protobuf//:any_proto",
- "@com_google_protobuf//:empty_proto",
- ],
-)
-
-proto_library(
- name = "google_rpc_status_proto",
- srcs = ["google/rpc/status.proto"],
- deps = ["@com_google_protobuf//:any_proto"],
-)
diff --git a/WORKSPACE b/WORKSPACE
index 0611c4b..4bd4dfa 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,18 +1,56 @@
workspace(name = "bazel_remote_apis")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+# Needed for protobuf.
+http_archive(
+ name = "bazel_skylib",
+ # Commit f83cb8dd6f5658bc574ccd873e25197055265d1c of 2018-11-26
+ sha256 = "ba5d15ca230efca96320085d8e4d58da826d1f81b444ef8afccd8b23e0799b52",
+ strip_prefix = "bazel-skylib-f83cb8dd6f5658bc574ccd873e25197055265d1c",
+ urls = [
+ "https://github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
+ ],
+)
+
# Needed for "well-known protos" and protoc.
http_archive(
name = "com_google_protobuf",
- sha256 = "091d4263d9a55eccb6d3c8abde55c26eaaa933dea9ecabb185cdf3795f9b5ca2",
- strip_prefix = "protobuf-3.5.1.1",
- urls = ["https://github.com/google/protobuf/archive/v3.5.1.1.zip"],
+ sha256 = "3e933375ecc58d01e52705479b82f155aea2d02cc55d833f8773213e74f88363",
+ strip_prefix = "protobuf-3.7.0",
+ urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0/protobuf-all-3.7.0.tar.gz"],
)
# Needed for the googleapis protos.
-new_http_archive(
+http_archive(
name = "googleapis",
build_file = "BUILD.googleapis",
sha256 = "7b6ea252f0b8fb5cd722f45feb83e115b689909bbb6a393a873b6cbad4ceae1d",
strip_prefix = "googleapis-143084a2624b6591ee1f9d23e7f5241856642f4d",
- url = "https://github.com/googleapis/googleapis/archive/143084a2624b6591ee1f9d23e7f5241856642f4d.zip",
+ urls = ["https://github.com/googleapis/googleapis/archive/143084a2624b6591ee1f9d23e7f5241856642f4d.zip"],
+)
+
+# Needed for C++ gRPC.
+http_archive(
+ name = "com_github_grpc_grpc",
+ strip_prefix = "grpc-1.17.2",
+ urls = [
+ "https://github.com/grpc/grpc/archive/v1.17.2.tar.gz",
+ "https://mirror.bazel.build/github.com/grpc/grpc/archive/v1.17.2.tar.gz",
+ ],
+ sha256 = "34ed95b727e7c6fcbf85e5eb422e962788e21707b712fdb4caf931553c2c6dbc",
+)
+
+# Pull in all gRPC dependencies.
+load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
+grpc_deps()
+
+bind(
+ name = "grpc_cpp_plugin",
+ actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
+)
+
+bind(
+ name = "grpc_lib",
+ actual = "@com_github_grpc_grpc//:grpc++",
)
diff --git a/build/bazel/remote/execution/v2/BUILD b/build/bazel/remote/execution/v2/BUILD
index cd2b72a..34a509c 100644
--- a/build/bazel/remote/execution/v2/BUILD
+++ b/build/bazel/remote/execution/v2/BUILD
@@ -1,4 +1,5 @@
package(default_visibility = ["//visibility:public"])
+load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
licenses(["notice"])
@@ -20,3 +21,19 @@ java_proto_library(
name = "remote_execution_java_proto",
deps = [":remote_execution_proto"],
)
+
+cc_grpc_library(
+ name = "remote_execution_cc_proto",
+ srcs = ["remote_execution.proto"],
+ deps = [
+ "//build/bazel/semver:semver_cc_proto",
+ "@googleapis//:google_api_annotations_cc_proto",
+ "@googleapis//:google_api_http_cc_proto",
+ "@googleapis//:google_longrunning_operations_cc_proto",
+ "@googleapis//:google_rpc_status_cc_proto",
+ ],
+ proto_only = False,
+ well_known_protos = True,
+ use_external = False,
+)
+
diff --git a/build/bazel/semver/BUILD b/build/bazel/semver/BUILD
index ee2a98c..a3da887 100644
--- a/build/bazel/semver/BUILD
+++ b/build/bazel/semver/BUILD
@@ -1,4 +1,5 @@
package(default_visibility = ["//visibility:public"])
+load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
licenses(["notice"])
@@ -11,3 +12,13 @@ java_proto_library(
name = "semver_java_proto",
deps = [":semver_proto"],
)
+
+cc_grpc_library(
+ name = "semver_cc_proto",
+ srcs = ["semver.proto"],
+ deps = [],
+ proto_only = False,
+ well_known_protos = True,
+ use_external = False,
+)
+
diff --git a/external/BUILD.googleapis b/external/BUILD.googleapis
new file mode 100644
index 0000000..1cfef9f
--- /dev/null
+++ b/external/BUILD.googleapis
@@ -0,0 +1,78 @@
+package(default_visibility = ["//visibility:public"])
+
+load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
+
+licenses(["notice"])
+
+proto_library(
+ name = "google_api_annotations_proto",
+ srcs = ["google/api/annotations.proto"],
+ deps = [
+ ":google_api_http_proto",
+ "@com_google_protobuf//:descriptor_proto",
+ ],
+)
+
+cc_grpc_library(
+ name = "google_api_annotations_cc_proto",
+ srcs = ["google/api/annotations.proto"],
+ deps = [":google_api_http_cc_proto"],
+ proto_only = False,
+ well_known_protos = True,
+ use_external = False,
+)
+
+proto_library(
+ name = "google_api_http_proto",
+ srcs = ["google/api/http.proto"],
+)
+
+cc_grpc_library(
+ name = "google_api_http_cc_proto",
+ srcs = ["google/api/http.proto"],
+ deps = [],
+ proto_only = False,
+ well_known_protos = True,
+ use_external = False,
+)
+
+proto_library(
+ name = "google_longrunning_operations_proto",
+ srcs = ["google/longrunning/operations.proto"],
+ deps = [
+ ":google_api_annotations_proto",
+ ":google_api_http_proto",
+ ":google_rpc_status_proto",
+ "@com_google_protobuf//:any_proto",
+ "@com_google_protobuf//:empty_proto",
+ ],
+)
+
+cc_grpc_library(
+ name = "google_longrunning_operations_cc_proto",
+ srcs = ["google/longrunning/operations.proto"],
+ deps = [
+ ":google_api_annotations_cc_proto",
+ ":google_api_http_cc_proto",
+ ":google_rpc_status_cc_proto",
+ ],
+ proto_only = False,
+ well_known_protos = True,
+ use_external = False,
+)
+
+proto_library(
+ name = "google_rpc_status_proto",
+ srcs = ["google/rpc/status.proto"],
+ deps = ["@com_google_protobuf//:any_proto"],
+)
+
+cc_grpc_library(
+ name = "google_rpc_status_cc_proto",
+ srcs = ["google/rpc/status.proto"],
+ deps = [],
+ proto_only = False,
+ well_known_protos = True,
+ use_external = False,
+)
+