1module( 2 name = "rules_java", 3 version = "6.1.1", 4 compatibility_level = 1, 5) 6 7bazel_dep(name = "platforms", version = "0.0.4") 8bazel_dep(name = "rules_cc", version = "0.0.2") 9bazel_dep(name = "bazel_skylib", version = "1.2.0") 10 11# Required by @remote_java_tools, which is loaded via module extension. 12bazel_dep(name = "rules_proto", version = "4.0.0") 13bazel_dep(name = "rules_license", version = "0.0.3") 14 15register_toolchains("//toolchains:all") 16 17toolchains = use_extension("//java:extensions.bzl", "toolchains") 18 19# Declare remote java tools repos 20use_repo(toolchains, "remote_java_tools") 21use_repo(toolchains, "remote_java_tools_linux") 22use_repo(toolchains, "remote_java_tools_windows") 23use_repo(toolchains, "remote_java_tools_darwin_x86_64") 24use_repo(toolchains, "remote_java_tools_darwin_arm64") 25 26# Declare local jdk repo 27use_repo(toolchains, "local_jdk") 28 29register_toolchains("@local_jdk//:runtime_toolchain_definition") 30 31# Declare all remote jdk toolchain config repos 32JDKS = { 33 # Must match JDK repos defined in remote_jdk11_repos() 34 "11": [ 35 "linux", 36 "linux_aarch64", 37 "linux_ppc64le", 38 "linux_s390x", 39 "macos", 40 "macos_aarch64", 41 "win", 42 "win_arm64", 43 ], 44 # Must match JDK repos defined in remote_jdk17_repos() 45 "17": [ 46 "linux", 47 "linux_aarch64", 48 "linux_ppc64le", 49 "linux_s390x", 50 "macos", 51 "macos_aarch64", 52 "win", 53 "win_arm64", 54 ], 55 # Must match JDK repos defined in remote_jdk20_repos() 56 "20": [ 57 "linux", 58 "linux_aarch64", 59 "macos", 60 "macos_aarch64", 61 "win", 62 ], 63} 64 65REMOTE_JDK_REPOS = [("remotejdk" + version + "_" + platform) for version in JDKS for platform in JDKS[version]] 66 67[use_repo( 68 toolchains, 69 repo + "_toolchain_config_repo", 70) for repo in REMOTE_JDK_REPOS] 71 72[register_toolchains("@" + name + "_toolchain_config_repo//:toolchain") for name in REMOTE_JDK_REPOS] 73 74# Dev dependencies 75bazel_dep(name = "rules_pkg", version = "0.5.1", dev_dependency = True) 76