forked from bazel-contrib/rules_jvm_external
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepositories.bzl
72 lines (65 loc) · 2.83 KB
/
repositories.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
# Minimise the risk of accidentally depending on something that's not already loaded
load("//private/rules:maven_install.bzl", "maven_install")
_DEFAULT_REPOSITORIES = [
"https://repo1.maven.org/maven2",
]
def rules_jvm_external_deps(repositories = _DEFAULT_REPOSITORIES):
maybe(
http_archive,
name = "bazel_skylib",
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
],
)
# The `rules_java` major version is tied to the major version of Bazel that it supports,
# so this is different from the version in the MODULE file.
major_version = native.bazel_version.partition(".")[0]
if major_version == "5":
maybe(
http_archive,
name = "rules_java",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/5.5.1/rules_java-5.5.1.tar.gz",
],
sha256 = "73b88f34dc251bce7bc6c472eb386a6c2b312ed5b473c81fe46855c248f792e0",
)
elif major_version == "6":
maybe(
http_archive,
name = "rules_java",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/6.5.2/rules_java-6.5.2.tar.gz",
],
sha256 = "16bc94b1a3c64f2c36ceecddc9e09a643e80937076b97e934b96a8f715ed1eaa",
)
else:
maybe(
http_archive,
name = "rules_java",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/7.3.2/rules_java-7.3.2.tar.gz",
],
sha256 = "3121a00588b1581bd7c1f9b550599629e5adcc11ba9c65f482bbd5cfe47fdf30",
)
maven_install(
name = "rules_jvm_external_deps",
artifacts = [
"com.google.auth:google-auth-library-credentials:1.19.0",
"com.google.auth:google-auth-library-oauth2-http:1.19.0",
"com.google.cloud:google-cloud-core:2.22.0",
"com.google.cloud:google-cloud-storage:2.26.1",
"com.google.code.gson:gson:2.10.1",
"com.google.googlejavaformat:google-java-format:1.17.0",
"com.google.guava:guava:32.1.2-jre",
"org.apache.maven:maven-artifact:3.9.4",
"software.amazon.awssdk:s3:2.20.128",
],
maven_install_json = "@rules_jvm_external//:rules_jvm_external_deps_install.json",
fail_if_repin_required = True,
strict_visibility = True,
repositories = repositories,
)