[WIP] Attempt at building grpc and p4runtime protocols with Bazel
STILL NOT WORKING AT RUNTIME
Change-Id: I1f9e60b12a12e09edad2a714ec2921a4f71c6d35
diff --git a/tools/build/bazel/grpc_workspace.bzl b/tools/build/bazel/grpc_workspace.bzl
index 826d304..331f0a4 100644
--- a/tools/build/bazel/grpc_workspace.bzl
+++ b/tools/build/bazel/grpc_workspace.bzl
@@ -1,92 +1,19 @@
-"""
- Copyright 2018-present Open Networking Foundation
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-"""
-
-
-"""
- Workspace to build GRPC java binaries. please see the injected bazel build file
- grpc_BUILD for additional information.
-"""
+GRPC_VER = "1.14.0"
+SHA = "657ee70cbbc7e8c5aa26d622329f5fc8bfa6ce5e960bcdbff802f785b0eba212"
def generate_grpc():
- native.new_http_archive(
- name = "grpc_src_zip_131",
- urls = ["https://github.com/grpc/grpc-java/archive/v1.3.1.zip"],
- sha256 = "c529b4c2d80a6df8ddc0aa25d7599e46ffcd155cb67122513f8fb536cd96eca4",
- build_file = "//tools/build/bazel:grpc_BUILD",
- strip_prefix = "grpc-java-1.3.1",
+ http_archive(
+ name = "io_grpc_grpc_java",
+ urls = ["https://github.com/grpc/grpc-java/archive/v%s.zip" % GRPC_VER],
+ sha256 = SHA,
+ strip_prefix = "grpc-java-" + GRPC_VER,
)
-
-def generated_maven_jars():
- native.maven_jar(
- name = "guava",
- artifact = "com.google.guava:guava:22.0",
- sha1 = "3564ef3803de51fb0530a8377ec6100b33b0d073",
- )
-
- native.maven_jar(
- name = "google_instrumentation_0_3_0",
- artifact = "com.google.instrumentation:instrumentation-api:0.3.0",
- sha1 = "a2e145e7a7567c6372738f5c5a6f3ba6407ac354",
- )
-
- native.maven_jar(
- name = "javax_annotation_api",
- artifact = "javax.annotation:javax.annotation-api:1.2",
- sha1 = "479c1e06db31c432330183f5cae684163f186146",
- )
-
- native.maven_jar(
- name = "jsr305",
- artifact = "com.google.code.findbugs:jsr305:3.0.1",
- sha1 = "f7be08ec23c21485b9b5a1cf1654c2ec8c58168d",
- )
-
- native.java_library(
- name = "google_errorprone_2_0_19",
- visibility = ["//visibility:public"],
- exports = ["@google_errorprone_2_0_19//jar"],
- )
-
-def generated_java_libraries():
- native.java_library(
- name = "guava",
- visibility = ["//visibility:public"],
- exports = ["@guava//jar"],
- )
-
- native.java_library(
- name = "google_instrumentation_0_3_0",
- visibility = ["//visibility:public"],
- exports = ["@google_instrumentation_0_3_0//jar"],
- )
-
- native.java_library(
- name = "javax_annotation_api",
- visibility = ["//visibility:public"],
- exports = ["@javax_annotation_api//jar"],
- )
-
- native.java_library(
- name = "jsr305",
- visibility = ["//visibility:public"],
- exports = ["@jsr305//jar"],
- )
-
- native.java_library(
- name = "google_errorprone_2_0_19",
- visibility = ["//visibility:public"],
- exports = ["@google_errorprone_2_0_19//jar"],
+ http_archive(
+ name = "io_grpc_grpc_java_core_repkg",
+ urls = ["https://github.com/grpc/grpc-java/archive/v%s.zip" % GRPC_VER],
+ sha256 = SHA,
+ strip_prefix = "grpc-java-%s/core" % GRPC_VER,
+ build_file = "//tools/build/bazel:grpc_core_repkg_BUILD",
)