Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no change #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.0
6.4.0
71 changes: 23 additions & 48 deletions WORKSPACE → WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,10 @@ workspace(name = "com_github_openconfig_gnpsi")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

### Bazel rules for many languages to compile PROTO into gRPC libraries
# Note: any version of this which is less than 4.3.0 requires bazel version 5.4.0 (set in .bazelversion file)
http_archive(
name = "rules_proto_grpc",
sha256 = "c0d718f4d892c524025504e67a5bfe83360b3a982e654bc71fed7514eb8ac8ad",
strip_prefix = "rules_proto_grpc-4.6.0",
urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.6.0.tar.gz"],
)
# -- Load Dependencies ---------------------------------------------------------
load("gnpsi_deps.bzl", "gnpsi_deps")

# googleapis has not had a release since 2016 - take the master version as of 4-jan-23
http_archive(
name = "com_google_googleapis",
sha256 = "9fc03150d86501d7da35eefa989d5553bdd77a95cfe4373cdafe8eee92f6bfb1",
strip_prefix = "googleapis-870a5ed7e141b4faf70e2a0858854e9b5bb18612",
urls = ["https://github.com/googleapis/googleapis/archive/870a5ed7e141b4faf70e2a0858854e9b5bb18612.tar.gz"],
)
gnpsi_deps()

# -- Load GRPC Dependencies ----------------------------------------------------
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
Expand All @@ -43,50 +31,37 @@ switched_rules_by_language(
go = True,
)

load(
"@rules_proto_grpc//:repositories.bzl",
"bazel_gazelle",
"io_bazel_rules_go",
"rules_proto_grpc_repos",
"rules_proto_grpc_toolchains",
)
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

rules_proto_grpc_toolchains()
rules_proto_grpc_repos()
grpc_deps()

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")

rules_proto_dependencies()
rules_proto_toolchains()
grpc_extra_deps()

### Golang
io_bazel_rules_go()
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(go_version = "1.20")
# -- Load Protobuf -------------------------------------------------------------

# gazelle:repo bazel_gazelle
bazel_gazelle()
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

# -- Load Dependencies ---------------------------------------------------------
load("gnpsi_deps.bzl", "gnpsi_deps")
protobuf_deps()

gnpsi_deps()
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")

load("@rules_proto_grpc//go:repositories.bzl", rules_proto_grpc_go_repos = "go_repos")
rules_proto_dependencies()

rules_proto_grpc_go_repos()
rules_proto_toolchains()

### C++
load("@rules_proto_grpc//cpp:repositories.bzl", rules_proto_grpc_cpp_repos = "cpp_repos")

rules_proto_grpc_cpp_repos()

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
### Bazel rules for many languages to compile PROTO into gRPC libraries
http_archive(
name = "rules_proto_grpc",
sha256 = "bbe4db93499f5c9414926e46f9e35016999a4e9f6e3522482d3760dc61011070",
strip_prefix = "rules_proto_grpc-4.2.0",
urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.2.0.tar.gz"],
)

grpc_deps()
load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains")

# Load gazelle_dependencies last, so that the newer version of org_golang_google_grpc is used.
# see https://github.com/rules-proto-grpc/rules_proto_grpc/issues/160
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
rules_proto_grpc_toolchains()
rules_proto_grpc_repos()
29 changes: 0 additions & 29 deletions common.bzl

This file was deleted.

24 changes: 24 additions & 0 deletions compile_protos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright 2021 Google LLC All Rights Reserved.
#
# 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.
#

#!/bin/bash


# Cpp
PROTO_DIR="proto/gnpsi"
protoc -I $PROTO_DIR --grpc_out=$PROTO_DIR --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` $PROTO_DIR/gnpsi.proto
protoc -I $PROTO_DIR --cpp_out=$PROTO_DIR $PROTO_DIR/gnpsi.proto

24 changes: 2 additions & 22 deletions proto/gnpsi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//:common.bzl", "use_new_compilers")

# gnpsi defines a gRPC-based network packet sampling interface implemented on
# vendor network elements. It provides mechanisms for streaming packet
# samples/updates from the network element.
Expand All @@ -25,8 +23,6 @@ package(
licenses = ["notice"],
)

use_new_compilers()

proto_library(
name = "gnpsi_proto",
srcs = ["gnpsi.proto"],
Expand All @@ -48,19 +44,3 @@ cc_grpc_library(
grpc_only = ["True"],
deps = [":gnpsi_cc_proto"],
)

go_proto_library(
name = "gnpsi_go_proto",
compilers = [
"go_protoc_gen_go",
"go_protoc_gen_go_grpc",
],
importpath = "github.com/openconfig/gnpsi/proto/gnpsi",
proto = ":gnpsi_proto",
)

go_library(
name = "gnpsi",
embed = [":gnpsi_go_proto"],
importpath = "github.com/openconfig/gnpsi/proto/gnpsi",
)
Loading
Loading