-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align dependency handling with Bazel best practices (#9165)
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.
- Loading branch information
Showing
5 changed files
with
92 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,33 +11,34 @@ java_library( | |
]), | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//external:error_prone_annotations", | ||
"//external:j2objc_annotations", | ||
"//external:gson", | ||
"//external:jsr305", | ||
"//external:guava", | ||
"//java/core", | ||
"//java/lite", | ||
"@maven//:com_google_code_findbugs_jsr305", | ||
"@maven//:com_google_code_gson_gson", | ||
"@maven//:com_google_errorprone_error_prone_annotations", | ||
"@maven//:com_google_guava_guava", | ||
"@maven//:com_google_j2objc_j2objc_annotations", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
suztomo
Contributor
|
||
], | ||
) | ||
|
||
# Bazel users, don't depend on this target, use :util. | ||
java_export( | ||
name = "util_mvn", | ||
maven_coordinates = "com.google.protobuf:protobuf-java-util:%s" % PROTOBUF_VERSION, | ||
pom_template = "pom_template.xml", | ||
runtime_deps = [":util"], | ||
visibility = ["//java:__pkg__"], | ||
runtime_deps = [":util"], | ||
) | ||
|
||
filegroup( | ||
name = "release", | ||
visibility = ["//java:__pkg__"], | ||
srcs = [ | ||
":util_mvn-pom", | ||
":util_mvn-maven-source", | ||
":util_mvn-docs", | ||
":util_mvn-maven-source", | ||
":util_mvn-pom", | ||
":util_mvn-project", | ||
] | ||
], | ||
visibility = ["//java:__pkg__"], | ||
) | ||
|
||
proto_library( | ||
|
@@ -60,15 +61,15 @@ java_proto_library( | |
|
||
junit_tests( | ||
name = "tests", | ||
srcs = glob(["src/test/java/**/*.java"]), | ||
package_name = "com.google.protobuf.util", | ||
srcs = glob(["src/test/java/**/*.java"]), | ||
deps = [ | ||
":test_protos_java_proto", | ||
":util", | ||
"//external:guava", | ||
"//external:junit", | ||
"//external:truth", | ||
"//java/core", | ||
"//java/core:generic_test_protos_java_proto", | ||
"@maven//:com_google_guava_guava", | ||
"@maven//:com_google_truth_truth", | ||
"@maven//:junit_junit", | ||
], | ||
) |
Oops, something went wrong.
@acozzette GAX repository fails to resolve this
@maven
. Would you guide us how to upgrade the dependency here?googleapis/gax-java#1571 (comment)