c7dfd0d6b9
This commit removes the use of bind() since that function goes against Bazel best practices: https://docs.bazel.build/versions/main/external.html#repository-rules-1 The bind() function basically maps a dependency into //external, but there is no good reason to do this. By mapping dependencies into //external and relying on this in our own BUILD files, we're forcing projects that depend on us to do the same. The one bind() call that I did leave in place was //:python_headers. This one seems to be doing something complicated I don't fully understand, and I don't want to risk breaking it. This change also moves our list of required Maven artifacts into a constant in protobuf_deps.bzl. This way, projects that depend on us can refer to this list when they invoke maven_install() and automatically pull in all the necesary dependencies. This fixes #9132.
59 lines
1.7 KiB
Python
59 lines
1.7 KiB
Python
workspace(name = "com_google_protobuf")
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
local_repository(
|
|
name = "com_google_protobuf_examples",
|
|
path = "examples",
|
|
)
|
|
|
|
http_archive(
|
|
name = "com_google_googletest",
|
|
sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb",
|
|
strip_prefix = "googletest-release-1.10.0",
|
|
urls = [
|
|
"https://mirror.bazel.build/github.com/google/googletest/archive/release-1.10.0.tar.gz",
|
|
"https://github.com/google/googletest/archive/release-1.10.0.tar.gz",
|
|
],
|
|
)
|
|
|
|
http_archive(
|
|
name = "com_github_google_benchmark",
|
|
sha256 = "2a778d821997df7d8646c9c59b8edb9a573a6e04c534c01892a40aa524a7b68c",
|
|
strip_prefix = "benchmark-bf585a2789e30585b4e3ce6baf11ef2750b54677",
|
|
urls = [
|
|
"https://github.com/google/benchmark/archive/bf585a2789e30585b4e3ce6baf11ef2750b54677.zip",
|
|
],
|
|
)
|
|
|
|
# Load common dependencies.
|
|
load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
|
|
protobuf_deps()
|
|
|
|
bind(
|
|
name = "python_headers",
|
|
actual = "//util/python:python_headers",
|
|
)
|
|
|
|
load("@rules_jvm_external//:defs.bzl", "maven_install")
|
|
|
|
maven_install(
|
|
artifacts = PROTOBUF_MAVEN_ARTIFACTS,
|
|
# For updating instructions, see:
|
|
# https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson
|
|
maven_install_json = "//:maven_install.json",
|
|
repositories = [
|
|
"https://repo1.maven.org/maven2",
|
|
"https://repo.maven.apache.org/maven2",
|
|
],
|
|
)
|
|
|
|
load("@maven//:defs.bzl", "pinned_maven_install")
|
|
|
|
pinned_maven_install()
|
|
|
|
# For `cc_proto_blacklist_test` and `build_test`.
|
|
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
|
|
|
bazel_skylib_workspace()
|