Skip to content

Commit

Permalink
Update version of Error Prone annotations used in bazel
Browse files Browse the repository at this point in the history
This is achieved by directly importing the error prone annotations
package from maven so that we can specify the exact version.

Also put an `@InlineMe` annotation inside FeatureSet to validate that
the update works.

PiperOrigin-RevId: 471560801
  • Loading branch information
blickly authored and copybara-github committed Sep 1, 2022
1 parent 3be8977 commit b2a6968
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.1
5.3.0
4 changes: 2 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ oss_java_library(
"//src/com/google/javascript/rhino/typed_ast:typed_ast_java_proto",
"@args4j_args4j",
"@com_google_code_gson_gson",
"@com_google_errorprone_error_prone_annotations",
"@com_google_guava_failureaccess//jar",
"@com_google_guava_guava//jar",
"@com_google_protobuf//:protobuf_java",
"@com_google_re2j_re2j",
"@google_bazel_common//third_party/java/auto:value",
"@google_bazel_common//third_party/java/error_prone:annotations",
"@google_bazel_common//third_party/java/jsr305_annotations",
"@org_apache_ant_ant",
"@org_jspecify_jspecify",
Expand Down Expand Up @@ -234,6 +234,7 @@ gen_java_tests(
"//src/com/google/javascript/rhino/typed_ast:typed_ast_java_proto",
"@args4j_args4j",
"@com_google_code_gson_gson",
"@com_google_errorprone_error_prone_annotations",
"@com_google_guava_failureaccess//jar",
"@com_google_guava_guava//jar",
"@com_google_guava_guava_testlib//jar",
Expand All @@ -243,7 +244,6 @@ gen_java_tests(
"@com_google_truth_extensions_truth_liteproto_extension",
"@com_google_truth_extensions_truth_proto_extension",
"@google_bazel_common//third_party/java/auto:value",
"@google_bazel_common//third_party/java/error_prone:annotations",
"@google_bazel_common//third_party/java/jsr305_annotations",
"@google_bazel_common//third_party/java/junit",
"@google_bazel_common//third_party/java/mockito",
Expand Down
16 changes: 11 additions & 5 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ maven_import(
licenses = ["notice"],
)

maven_import(
# annotations from https://github.com/google/error-prone
group_id = "com.google.errorprone",
artifact_id = "error_prone_annotations",
version = "2.15.0",
sha256 = "067047714349e7789a5bdbfad9d1c0af9f3a1eb28c55a0ee3f68e682f905c4eb",
licenses = ["notice"],
)

maven_import(
# https://truth.dev/protobufs
group_id = "com.google.truth.extensions",
Expand Down Expand Up @@ -132,11 +141,8 @@ rules_proto_toolchains()
# From https://github.com/bazelbuild/rules_java/releases/
http_archive(
name = "rules_java",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/5.0.0/rules_java-5.0.0.tar.gz",
"https://github.com/bazelbuild/rules_java/releases/download/5.0.0/rules_java-5.0.0.tar.gz",
],
sha256 = "8c376f1e4ab7d7d8b1880e4ef8fc170862be91b7c683af97ca2768df546bb073",
url = "https://github.com/bazelbuild/rules_java/releases/download/5.1.0/rules_java-5.1.0.tar.gz",
sha256 = "d974a2d6e1a534856d1b60ad6a15e57f3970d8596fbb0bb17b9ee26ca209332a",
)
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet;
import com.google.errorprone.annotations.Immutable;
import com.google.errorprone.annotations.InlineMe;
import java.io.Serializable;
import java.util.EnumSet;
import java.util.Set;
Expand Down Expand Up @@ -326,6 +327,7 @@ public String version() {
* @deprecated Please use {@link #version()} instead.
*/
@Deprecated
@InlineMe(replacement = "this.version()")
public String versionForDebugging() {
return version();
}
Expand Down

0 comments on commit b2a6968

Please sign in to comment.