Skip to content

Commit 6bf2448

Browse files
committed
Update to bazel 2
1 parent e679785 commit 6bf2448

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed
Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1-
maven_jar(
2-
name = "com_google_guava_guava",
3-
artifact = "com.google.guava:guava:18.0",
4-
sha1 = "cce0823396aa693798f8882e64213b1772032b09",
5-
sha1_src = "ad97fe8faaf01a3d3faacecd58e8fa6e78a973ca",
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2+
3+
RULES_JVM_EXTERNAL_TAG = "2.8"
4+
RULES_JVM_EXTERNAL_SHA = "79c9850690d7614ecdb72d68394f994fef7534b292c4867ce5e7dec0aa7bdfad"
5+
6+
http_archive(
7+
name = "rules_jvm_external",
8+
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
9+
sha256 = RULES_JVM_EXTERNAL_SHA,
10+
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
11+
)
12+
13+
load("@rules_jvm_external//:defs.bzl", "maven_install")
14+
15+
maven_install(
16+
artifacts = [
17+
"com.google.guava:guava:18.0",
18+
],
19+
repositories = [
20+
"https://jcenter.bintray.com/",
21+
"https://repo1.maven.org/maven2",
22+
],
23+
fetch_sources = True,
624
)

src/test/examples/bazel-project/hello/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ java_binary(
44
main_class = "Hello",
55
visibility = ["//visibility:public"],
66
deps = [
7-
"@com_google_guava_guava//jar",
7+
"@maven//:com_google_guava_guava",
88
],
99
)

src/test/java/org/javacs/InferBazelConfigTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ public class InferBazelConfigTest {
1010
@Test
1111
public void bazelClassPath() {
1212
var bazel = new InferConfig(Paths.get("src/test/examples/bazel-project"));
13-
assertThat(bazel.classPath(), contains(hasToString(endsWith("guava-18.0-ijar.jar"))));
13+
assertThat(bazel.classPath(), contains(hasToString(endsWith("guava-18.0.jar"))));
1414
}
1515

1616
@Test
1717
public void bazelClassPathInSubdir() {
1818
var bazel = new InferConfig(Paths.get("src/test/examples/bazel-project/hello"));
19-
assertThat(bazel.classPath(), contains(hasToString(endsWith("guava-18.0-ijar.jar"))));
19+
assertThat(bazel.classPath(), contains(hasToString(endsWith("guava-18.0.jar"))));
2020
}
2121

2222
@Test

0 commit comments

Comments
 (0)