blob: cc04bfe66b62cd91fb68e24a97c8b0ea867dfea2 [file] [log] [blame]
# External dependencies for the java_* rules.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
new_local_repository(
name = "local_jdk",
build_file = __embedded_dir__ + "/jdk.BUILD",
path = DEFAULT_SYSTEM_JAVABASE,
)
bind(
name = "bootclasspath",
actual = "@local_jdk//:bootclasspath",
)
# TODO(cushon): migrate to extclasspath and delete
bind(
name = "extdir",
actual = "@local_jdk//:extdir",
)
bind(
name = "extclasspath",
actual = "@local_jdk//:extdir",
)
bind(
name = "jni_header",
actual = "@local_jdk//:jni_header",
)
bind(
name = "jni_md_header-darwin",
actual = "@local_jdk//:jni_md_header-darwin",
)
bind(
name = "jni_md_header-linux",
actual = "@local_jdk//:jni_md_header-linux",
)
bind(
name = "jni_md_header-freebsd",
actual = "@local_jdk//:jni_md_header-freebsd",
)
bind(
name = "jni_md_header-openbsd",
actual = "@local_jdk//:jni_md_header-openbsd",
)
bind(
name = "java",
actual = "@local_jdk//:java",
)
bind(
name = "jar",
actual = "@local_jdk//:jar",
)
bind(
name = "javac",
actual = "@local_jdk//:javac",
)
bind(
name = "jre",
actual = "@local_jdk//:jre",
)
bind(
name = "jdk",
actual = "@local_jdk//:jdk",
)
# TODO: Remove these two rules after we've migrated. In order to properly look
# up Jdks/Jres for cross-platform builds, the lookup needs to happen in the Jdk
# repository. For now, use an alias rule that redirects to //external:{jre,jdk}.
bind(
name = "jre-default",
actual = "@local_jdk//:jre",
)
bind(
name = "jdk-default",
actual = "@local_jdk//:jdk",
)
# OpenJDK distributions that should only be downloaded on demand (e.g. when
# building a java_library or a genrule that uses java make variables).
# This will allow us to stop bundling the full JDK with Bazel.
# Note that while these are currently the same as the openjdk_* rules in
# Bazel's WORKSPACE file, but they don't have to be the same.
# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remotejdk11_linux",
build_file = "@local_jdk//:BUILD.bazel",
sha256 = "360626cc19063bc411bfed2914301b908a8f77a7919aaea007a977fa8fb3cde1",
strip_prefix = "zulu11.37.17-ca-jdk11.0.6-linux_x64",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remotejdk11_linux_aarch64",
build_file = "@local_jdk//:BUILD.bazel",
sha256 = "a452f1b9682d9f83c1c14e54d1446e1c51b5173a3a05dcb013d380f9508562e4",
strip_prefix = "zulu11.37.48-ca-jdk11.0.6-linux_aarch64",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu11.37.48-ca-jdk11.0.6/zulu11.37.48-ca-jdk11.0.6-linux_aarch64.tar.gz",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remotejdk11_macos",
build_file = "@local_jdk//:BUILD.bazel",
sha256 = "e1fe56769f32e2aaac95e0a8f86b5a323da5af3a3b4bba73f3086391a6cc056f",
strip_prefix = "zulu11.37.17-ca-jdk11.0.6-macosx_x64",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-macosx_x64.tar.gz",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remotejdk11_win",
build_file = "@local_jdk//:BUILD.bazel",
sha256 = "a9695617b8374bfa171f166951214965b1d1d08f43218db9a2a780b71c665c18",
strip_prefix = "zulu11.37.17-ca-jdk11.0.6-win_x64",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-win_x64.zip",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remote_java_tools_linux",
sha256 = "3ff465e82954a70f49982610dd63f6f651beaa83c707dd637870b0e41cdcd2f0",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac11/v7.0/java_tools_javac11_linux-v7.0.zip",
"https://github.com/bazelbuild/java_tools/releases/download/javac11-v7.0/java_tools_javac11_linux-v7.0.zip",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remote_java_tools_windows",
sha256 = "11d90a147919e74d11870cdd58c4ee5de3062c08d11b16aa72d3f3bbfa9497a0",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac11/v7.0/java_tools_javac11_windows-v7.0.zip",
"https://github.com/bazelbuild/java_tools/releases/download/javac11-v7.0/java_tools_javac11_windows-v7.0.zip",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remote_java_tools_darwin",
sha256 = "373a4226906ae9ba908550da16e133c4cd1f01b8973af82b9a2eb6903cb4d645",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac11/v7.0/java_tools_javac11_darwin-v7.0.zip",
"https://github.com/bazelbuild/java_tools/releases/download/javac11-v7.0/java_tools_javac11_darwin-v7.0.zip",
],
)
maybe(
http_archive,
"rules_java",
sha256 = "bc81f1ba47ef5cc68ad32225c3d0e70b8c6f6077663835438da8d5733f917598",
strip_prefix = "rules_java-7cf3cefd652008d0a64a419c34c13bdca6c8f178",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip",
"https://github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip",
],
)
# Needed only because of java_tools.
maybe(
http_archive,
"rules_cc",
sha256 = "1d4dbbd1e1e9b57d40bb0ade51c9e882da7658d5bfbf22bbd15b68e7879d761f",
strip_prefix = "rules_cc-8bd6cd75d03c01bb82561a96d9c1f9f7157b13d0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/8bd6cd75d03c01bb82561a96d9c1f9f7157b13d0.zip",
"https://github.com/bazelbuild/rules_cc/archive/8bd6cd75d03c01bb82561a96d9c1f9f7157b13d0.zip",
],
)
# Needed only because of java_tools.
maybe(
http_archive,
"rules_proto",
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
)
register_toolchains("@bazel_tools//tools/jdk:all")