Skip to content

Commit 5cf9605

Browse files
gunancopybara-github
authored andcommitted
Remove dependency on maven_import, in favor of rules_jvm_external.
maven_import is deprecated and unsupported. PiperOrigin-RevId: 561685453
1 parent 4fbcc71 commit 5cf9605

File tree

3 files changed

+43
-116
lines changed

3 files changed

+43
-116
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ build --strategy=J2cl=worker
88
build --strategy=Closure=worker
99
build --experimental_persistent_javac
1010

11+
# Avoid the problem where build fails with:
12+
# //:compiler_unshaded.publish: $(COMPILER_VERSION) not defined.
13+
build --define=COMPILER_VERSION=1.0-SNAPSHOT
14+
1115
# Setting for running in remote CI
1216
build --color=yes

BUILD.bazel

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,16 @@ oss_java_library(
180180
"//src/com/google/javascript/jscomp/conformance:conformance_java_proto",
181181
"//src/com/google/javascript/jscomp/instrumentation/reporter/proto:profile_java_proto",
182182
"//src/com/google/javascript/rhino/typed_ast:typed_ast_java_proto",
183-
"@args4j_args4j",
184-
"@com_google_code_gson_gson",
185-
"@com_google_errorprone_error_prone_annotations",
186-
"@com_google_guava_failureaccess//jar",
187-
"@com_google_guava_guava//jar",
188-
"@com_google_re2j_re2j",
189183
"@google_bazel_common//third_party/java/auto:value",
184+
"@maven//:args4j_args4j",
185+
"@maven//:com_google_code_gson_gson",
186+
"@maven//:com_google_errorprone_error_prone_annotations",
187+
"@maven//:com_google_guava_failureaccess",
188+
"@maven//:com_google_guava_guava",
190189
"@maven//:com_google_protobuf_protobuf_java",
191-
"@org_apache_ant_ant",
192-
"@org_jspecify_jspecify",
190+
"@maven//:com_google_re2j_re2j",
191+
"@maven//:org_apache_ant_ant",
192+
"@maven//:org_jspecify_jspecify",
193193
],
194194
),
195195
)
@@ -247,23 +247,23 @@ gen_java_tests(
247247
"//src/com/google/javascript/jscomp/conformance:conformance_java_proto",
248248
"//src/com/google/javascript/jscomp/instrumentation/reporter/proto:profile_java_proto",
249249
"//src/com/google/javascript/rhino/typed_ast:typed_ast_java_proto",
250-
"@args4j_args4j",
251-
"@com_google_code_gson_gson",
252-
"@com_google_errorprone_error_prone_annotations",
253-
"@com_google_guava_failureaccess//jar",
254-
"@com_google_guava_guava//jar",
255-
"@com_google_guava_guava_testlib//jar",
256-
"@com_google_jimfs_jimfs",
257-
"@com_google_re2j_re2j",
258-
"@com_google_truth_extensions_truth_liteproto_extension",
259-
"@com_google_truth_extensions_truth_proto_extension",
260250
"@google_bazel_common//third_party/java/auto:value",
261251
"@google_bazel_common//third_party/java/junit",
262252
"@google_bazel_common//third_party/java/mockito",
263253
"@google_bazel_common//third_party/java/truth",
264-
"@io_github_java_diff_utils_java_diff_utils",
254+
"@maven//:args4j_args4j",
255+
"@maven//:com_google_code_gson_gson",
256+
"@maven//:com_google_errorprone_error_prone_annotations",
257+
"@maven//:com_google_guava_failureaccess",
258+
"@maven//:com_google_guava_guava",
259+
"@maven//:com_google_guava_guava_testlib",
260+
"@maven//:com_google_jimfs_jimfs",
265261
"@maven//:com_google_protobuf_protobuf_java",
266-
"@org_jspecify_jspecify",
262+
"@maven//:com_google_re2j_re2j",
263+
"@maven//:com_google_truth_extensions_truth_liteproto_extension",
264+
"@maven//:com_google_truth_extensions_truth_proto_extension",
265+
"@maven//:io_github_java_diff_utils_java_diff_utils",
266+
"@maven//:org_jspecify_jspecify",
267267
],
268268
)
269269

WORKSPACE.bazel

Lines changed: 19 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ workspace(name = "com_google_javascript_jscomp")
22

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

5-
RULES_JVM_EXTERNAL_TAG = "4.5"
6-
RULES_JVM_EXTERNAL_SHA = "b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6"
5+
RULES_JVM_EXTERNAL_TAG = "5.3"
6+
RULES_JVM_EXTERNAL_SHA = "d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac"
77

88
http_archive(
99
name = "rules_jvm_external",
1010
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
1111
sha256 = RULES_JVM_EXTERNAL_SHA,
12-
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
12+
url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG)
1313
)
1414

1515
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
@@ -35,100 +35,10 @@ http_archive(
3535
],
3636
)
3737

38-
load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules", "maven_import")
38+
load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules")
3939

4040
google_common_workspace_rules()
4141

42-
maven_import(
43-
# http://args4j.kohsuke.org/index.html
44-
group_id = "args4j",
45-
artifact_id = "args4j",
46-
version = "2.33",
47-
sha256 = "91ddeaba0b24adce72291c618c00bbdce1c884755f6c4dba9c5c46e871c69ed6",
48-
licenses = ["notice"],
49-
)
50-
51-
maven_import(
52-
# https://github.com/java-diff-utils/java-diff-utils
53-
group_id = "io.github.java-diff-utils",
54-
artifact_id = "java-diff-utils",
55-
version = "4.0",
56-
sha256 = "810232374e76a954949f0e2185cd7d9515addb918cf3da3481f77e07c356b49a",
57-
licenses = ["notice"],
58-
)
59-
60-
maven_import(
61-
# https://github.com/google/gson
62-
group_id = "com.google.code.gson",
63-
artifact_id = "gson",
64-
version = "2.9.1",
65-
sha256 = "378534e339e6e6d50b1736fb3abb76f1c15d1be3f4c13cec6d536412e23da603",
66-
licenses = ["notice"],
67-
)
68-
69-
maven_import(
70-
# https://github.com/google/re2j
71-
group_id ="com.google.re2j",
72-
artifact_id = "re2j",
73-
version ="1.3",
74-
sha256 = "d8040fa1c54c1ce208199015b6e599ec2ef37b7780f8f55a8b4b4b4299bade19",
75-
licenses = ["notice"],
76-
)
77-
78-
maven_import(
79-
# https://ant.apache.org/
80-
group_id ="org.apache.ant",
81-
artifact_id = "ant",
82-
version ="1.10.11",
83-
sha256 = "88c0b89bbbaae01e0d9fcae93be792f5abbe3409106f8eee858fdf365dbc0754",
84-
licenses = ["notice"],
85-
)
86-
87-
maven_import(
88-
# https://github.com/jspecify/jspecify/
89-
group_id ="org.jspecify",
90-
artifact_id = "jspecify",
91-
version ="0.2.0",
92-
sha256 = "7da399e8d2be9474406fe7c06904012880e8aa96833adab126119c8d10b7c0ae",
93-
licenses = ["notice"],
94-
)
95-
96-
maven_import(
97-
# annotations from https://github.com/google/error-prone
98-
group_id = "com.google.errorprone",
99-
artifact_id = "error_prone_annotations",
100-
version = "2.15.0",
101-
sha256 = "067047714349e7789a5bdbfad9d1c0af9f3a1eb28c55a0ee3f68e682f905c4eb",
102-
licenses = ["notice"],
103-
)
104-
105-
maven_import(
106-
# https://truth.dev/protobufs
107-
group_id = "com.google.truth.extensions",
108-
artifact_id = "truth-liteproto-extension",
109-
version = "1.1",
110-
sha256 = "f637de4743194a870316a55a1c50c89638355a2323d96b6ced363a22d6ced316",
111-
licenses = ["notice"],
112-
)
113-
114-
maven_import(
115-
# https://truth.dev/protobufs
116-
group_id = "com.google.truth.extensions",
117-
artifact_id = "truth-proto-extension",
118-
version = "1.1",
119-
sha256 = "d2fa8736dcb541813f8f4090ecc0d634b85cb82bd6d486f1af975458d0238afe",
120-
licenses = ["notice"],
121-
)
122-
123-
maven_import(
124-
# https://github.com/google/jimfs
125-
group_id = "com.google.jimfs",
126-
artifact_id = "jimfs",
127-
version = "1.2",
128-
sha256 = "de16d5c8489729a8512f1a02fbd81f58f89249b72066987da4cc5c87ecb9f72d",
129-
licenses = ["notice"],
130-
)
131-
13242
http_archive(
13343
name = "protobuf_proto_rules",
13444
# output from `sha256sum` on the downloaded tar.gz file
@@ -171,14 +81,27 @@ load("@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories")
17181

17282
jar_jar_repositories()
17383

174-
# Declare protobuf-java from maven central, so the unshaded maven jar can recognize external dependencies
17584
load("@rules_jvm_external//:defs.bzl", "maven_install")
85+
17686
maven_install(
17787
artifacts = [
88+
"args4j:args4j:2.33",
89+
"com.google.code.gson:gson:2.9.1",
90+
"com.google.errorprone:error_prone_annotations:2.15.0",
91+
"com.google.guava:failureaccess:1.0.1",
92+
"com.google.guava:guava:32.1.2-jre",
93+
"com.google.guava:guava-testlib:32.1.2-jre",
94+
"com.google.jimfs:jimfs:1.2",
17895
"com.google.protobuf:protobuf-java:3.21.12",
96+
"com.google.re2j:re2j:1.3",
97+
"com.google.truth.extensions:truth-liteproto-extension:1.1",
98+
"com.google.truth.extensions:truth-proto-extension:1.1",
99+
"io.github.java-diff-utils:java-diff-utils:4.0",
100+
"org.apache.ant:ant:1.10.11",
101+
"org.jspecify:jspecify:0.2.0",
179102
],
180103
repositories = [
104+
"https://maven.google.com",
181105
"https://repo1.maven.org/maven2",
182106
],
183-
strict_visibility = True,
184107
)

0 commit comments

Comments
 (0)