diff --git a/java/repositories.bzl b/java/repositories.bzl index 07f7e0e3..eba6a7aa 100644 --- a/java/repositories.bzl +++ b/java/repositories.bzl @@ -85,7 +85,7 @@ def remote_jdk8_repos(name = ""): maybe( remote_java_repository, name = "remote_jdk8_linux_aarch64", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:aarch64", ], @@ -100,7 +100,7 @@ def remote_jdk8_repos(name = ""): maybe( remote_java_repository, name = "remote_jdk8_linux", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:x86_64", ], @@ -115,7 +115,7 @@ def remote_jdk8_repos(name = ""): maybe( remote_java_repository, name = "remote_jdk8_macos", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:x86_64", ], @@ -130,7 +130,7 @@ def remote_jdk8_repos(name = ""): maybe( remote_java_repository, name = "remote_jdk8_windows", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:windows", "@platforms//cpu:x86_64", ], @@ -156,7 +156,7 @@ def remote_jdk11_repos(): maybe( remote_java_repository, name = "remotejdk11_linux", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:x86_64", ], @@ -171,7 +171,7 @@ def remote_jdk11_repos(): maybe( remote_java_repository, name = "remotejdk11_linux_aarch64", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:aarch64", ], @@ -186,7 +186,7 @@ def remote_jdk11_repos(): maybe( remote_java_repository, name = "remotejdk11_linux_ppc64le", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:ppc", ], @@ -202,7 +202,7 @@ def remote_jdk11_repos(): maybe( remote_java_repository, name = "remotejdk11_linux_s390x", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:s390x", ], @@ -218,7 +218,7 @@ def remote_jdk11_repos(): maybe( remote_java_repository, name = "remotejdk11_macos", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:x86_64", ], @@ -233,7 +233,7 @@ def remote_jdk11_repos(): maybe( remote_java_repository, name = "remotejdk11_macos_aarch64", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:aarch64", ], @@ -249,7 +249,7 @@ def remote_jdk11_repos(): maybe( remote_java_repository, name = "remotejdk11_win", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:windows", "@platforms//cpu:x86_64", ], @@ -266,7 +266,7 @@ def remote_jdk15_repos(): maybe( remote_java_repository, name = "remotejdk15_linux", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:x86_64", ], @@ -282,7 +282,7 @@ def remote_jdk15_repos(): maybe( remote_java_repository, name = "remotejdk15_macos", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:x86_64", ], @@ -298,7 +298,7 @@ def remote_jdk15_repos(): maybe( remote_java_repository, name = "remotejdk15_macos_aarch64", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:aarch64", ], @@ -314,7 +314,7 @@ def remote_jdk15_repos(): maybe( remote_java_repository, name = "remotejdk15_win", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:windows", "@platforms//cpu:x86_64", ], @@ -332,7 +332,7 @@ def remote_jdk16_repos(): maybe( remote_java_repository, name = "remotejdk16_linux", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:x86_64", ], @@ -348,7 +348,7 @@ def remote_jdk16_repos(): maybe( remote_java_repository, name = "remotejdk16_macos", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:x86_64", ], @@ -364,7 +364,7 @@ def remote_jdk16_repos(): maybe( remote_java_repository, name = "remotejdk16_macos_aarch64", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:aarch64", ], @@ -380,7 +380,7 @@ def remote_jdk16_repos(): maybe( remote_java_repository, name = "remotejdk16_win", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:windows", "@platforms//cpu:x86_64", ], @@ -398,7 +398,7 @@ def remote_jdk17_repos(): maybe( remote_java_repository, name = "remotejdk17_linux", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:linux", "@platforms//cpu:x86_64", ], @@ -414,7 +414,7 @@ def remote_jdk17_repos(): maybe( remote_java_repository, name = "remotejdk17_macos", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:x86_64", ], @@ -430,7 +430,7 @@ def remote_jdk17_repos(): maybe( remote_java_repository, name = "remotejdk17_macos_aarch64", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:macos", "@platforms//cpu:aarch64", ], @@ -446,7 +446,7 @@ def remote_jdk17_repos(): maybe( remote_java_repository, name = "remotejdk17_win", - exec_compatible_with = [ + target_compatible_with = [ "@platforms//os:windows", "@platforms//cpu:x86_64", ], diff --git a/toolchains/remote_java_repository.bzl b/toolchains/remote_java_repository.bzl index 33c0d6ec..31b93b8c 100644 --- a/toolchains/remote_java_repository.bzl +++ b/toolchains/remote_java_repository.bzl @@ -31,17 +31,17 @@ _toolchain_config = repository_rule( }, ) -def remote_java_repository(name, version, exec_compatible_with, prefix = "remotejdk", **kwargs): +def remote_java_repository(name, version, target_compatible_with = None, prefix = "remotejdk", **kwargs): """Imports and registers a JDK from a http archive. - Toolchain resolution is determined with exec_compatible_with + Toolchain resolution is determined with target_compatible_with parameter and constrained with --java_runtime_version flag either having value of "version" or "{prefix}_{version}" parameters. Args: name: A unique name for this rule. version: Version of the JDK imported. - exec_compatible_with: Platform constraints (CPU and OS) for this JDK. + target_compatible_with: Target platform constraints (CPU and OS) for this JDK. prefix: Optional alternative prefix for configuration flag value used to determine this JDK. **kwargs: Refer to http_archive documentation """ @@ -73,7 +73,7 @@ alias( ) toolchain( name = "toolchain", - exec_compatible_with = {exec_compatible_with}, + target_compatible_with = {target_compatible_with}, target_settings = [":version_or_prefix_version_setting"], toolchain_type = "@bazel_tools//tools/jdk:runtime_toolchain_type", toolchain = "{toolchain}", @@ -81,7 +81,7 @@ toolchain( """.format( prefix = prefix, version = version, - exec_compatible_with = exec_compatible_with, + target_compatible_with = target_compatible_with, toolchain = "@{repo}//:jdk".format(repo = name), ), )