Skip to content

Commit 0295479

Browse files
mmorel-35rodaine
andauthored
Replace deprecated rules (#1311)
#### Description Replace deprecated rules with their new versions. --------- Signed-off-by: Matthieu MOREL <[email protected]> Co-authored-by: Chris Roche <[email protected]>
1 parent 5d624d7 commit 0295479

File tree

18 files changed

+40
-34
lines changed

18 files changed

+40
-34
lines changed

bazel/dependency_imports.bzl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
22
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
33
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
4-
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
5-
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
64
load("@rules_python//python:pip.bzl", "pip_parse")
75

86
def _pgv_pip_dependencies():
@@ -29,7 +27,3 @@ def pgv_dependency_imports():
2927

3028
# Import rules for the Go compiler.
3129
_pgv_go_dependencies()
32-
33-
# Setup rules_proto.
34-
rules_proto_dependencies()
35-
rules_proto_toolchains()

bazel/protobuf.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
22
load("@bazel_tools//tools/jdk:toolchain_utils.bzl", "find_java_runtime_toolchain", "find_java_toolchain")
3-
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
3+
load("@com_google_protobuf//bazel/common:proto_info.bzl", "ProtoInfo")
44

55
# Borrowed from https://github.com/grpc/grpc-java/blob/v1.28.0/java_grpc_library.bzl#L59
66
# "repository" here is for Bazel builds that span multiple WORKSPACES.

bazel/repositories.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def pgv_dependencies(maven_repos = _DEFAULT_REPOSITORIES):
8787
url = "https://github.com/bazelbuild/rules_python/releases/download/0.32.2/rules_python-0.32.2.tar.gz",
8888
)
8989

90+
# Required by io_bazel_rules_go
9091
if not native.existing_rule("rules_proto"):
9192
http_archive(
9293
name = "rules_proto",
@@ -102,3 +103,11 @@ def pgv_dependencies(maven_repos = _DEFAULT_REPOSITORIES):
102103
strip_prefix = "rules_cc-0.0.9",
103104
url = "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz",
104105
)
106+
107+
if not native.existing_rule("bazel_features"):
108+
http_archive(
109+
name = "bazel_features",
110+
sha256 = "9390b391a68d3b24aef7966bce8556d28003fe3f022a5008efc7807e8acaaf1a",
111+
strip_prefix = "bazel_features-1.36.0",
112+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.36.0/bazel_features-v1.36.0.tar.gz",
113+
)

example-workspace/foo/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@com_envoyproxy_protoc_gen_validate//bazel:pgv_proto_library.bzl", "pgv_cc_proto_library")
2-
load("@rules_python//python:proto.bzl", "py_proto_library")
2+
load("@com_google_protobuf//bazel:py_proto_library.bzl", "py_proto_library")
33

44
package(
55
default_visibility = ["//visibility:public"],

java/pgv-java-grpc/src/test/proto/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
12
load("@io_bazel_rules_go//go:def.bzl", "go_library")
23
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
3-
load("@rules_proto//proto:defs.bzl", "proto_library")
44

55
proto_library(
66
name = "io_envoyproxy_pgv_grpc_proto",

java/pgv-java-stub/src/test/proto/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
12
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
2-
load("@rules_proto//proto:defs.bzl", "proto_library")
33

44
proto_library(
55
name = "io_envoyproxy_pvg_cases_proto",

templates/shared/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ go_library(
1313
importpath = "github.com/envoyproxy/protoc-gen-validate/templates/shared",
1414
visibility = ["//visibility:public"],
1515
deps = [
16+
"//validate:validate_go",
1617
"@com_github_lyft_protoc_gen_star_v2//:protoc-gen-star",
1718
"@org_golang_google_protobuf//proto",
18-
"//validate:validate_go",
1919
],
2020
)
2121

tests/generation/multi_file_java_test/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
12
load("@rules_cc//cc:defs.bzl", "cc_binary")
2-
load("@rules_proto//proto:defs.bzl", "proto_library")
33
load(
44
"//bazel:pgv_proto_library.bzl",
55
"pgv_cc_proto_library",

tests/harness/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
2+
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
3+
load("@com_google_protobuf//bazel:py_proto_library.bzl", "py_proto_library")
24
load("@io_bazel_rules_go//go:def.bzl", "go_library")
35
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
46
load("@rules_java//java:defs.bzl", "java_proto_library")
5-
load("@rules_proto//proto:defs.bzl", "proto_library")
6-
load("@rules_python//python:proto.bzl", "py_proto_library")
77

88
proto_library(
99
name = "harness_proto",

tests/harness/cases/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
2+
load("@com_google_protobuf//bazel:py_proto_library.bzl", "py_proto_library")
13
load("@rules_java//java:defs.bzl", "java_proto_library")
2-
load("@rules_proto//proto:defs.bzl", "proto_library")
3-
load("@rules_python//python:proto.bzl", "py_proto_library")
44
load(
55
"//bazel:pgv_proto_library.bzl",
66
"pgv_cc_proto_library",

0 commit comments

Comments
 (0)