-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
rules_java.patch
68 lines (64 loc) · 3.16 KB
/
rules_java.patch
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
diff --git a/java/repositories.bzl b/java/repositories.bzl
index 27f4f85..15b5306 100644
--- a/java/repositories.bzl
+++ b/java/repositories.bzl
@@ -333,7 +333,7 @@ def _remote_jdk_repos_for_version(version):
maybe(
remote_java_repository,
name = item.name,
- target_compatible_with = item.target_compatible_with,
+ exec_compatible_with = item.target_compatible_with,
sha256 = item.sha256,
strip_prefix = item.strip_prefix,
urls = item.urls,
diff --git a/toolchains/remote_java_repository.bzl b/toolchains/remote_java_repository.bzl
index 65bbe48..3501e69 100644
--- a/toolchains/remote_java_repository.bzl
+++ b/toolchains/remote_java_repository.bzl
@@ -32,20 +32,20 @@ _toolchain_config = repository_rule(
},
)
-def remote_java_repository(name, version, target_compatible_with = None, prefix = "remotejdk", **kwargs):
+def remote_java_repository(name, version, exec_compatible_with = None, prefix = "remotejdk", **kwargs):
"""Imports a JDK from a http archive and creates runtime toolchain definitions for it.
Register the toolchains defined by this macro via `register_toolchains("@<name>//:all")`, where
`<name>` is the value of the `name` parameter.
- Toolchain resolution is determined with target_compatible_with
+ Toolchain resolution is determined with exec_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.
- target_compatible_with: Target platform constraints (CPU and OS) for this JDK.
+ exec_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
"""
@@ -77,7 +77,7 @@ alias(
)
toolchain(
name = "toolchain",
- target_compatible_with = {target_compatible_with},
+ exec_compatible_with = {exec_compatible_with},
target_settings = [":version_or_prefix_version_setting"],
toolchain_type = "@bazel_tools//tools/jdk:runtime_toolchain_type",
toolchain = "{toolchain}",
@@ -87,7 +87,7 @@ toolchain(
# These constraints are not required for correctness, but prevent fetches of remote JDK for
# different architectures. As every Java compilation toolchain depends on a bootstrap runtime in
# the same configuration, this constraint will not result in toolchain resolution failures.
- exec_compatible_with = {target_compatible_with},
+ exec_compatible_with = {exec_compatible_with},
target_settings = [":version_or_prefix_version_setting"],
toolchain_type = "@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type",
toolchain = "{toolchain}",
@@ -95,7 +95,7 @@ toolchain(
""".format(
prefix = prefix,
version = version,
- target_compatible_with = target_compatible_with,
+ exec_compatible_with = exec_compatible_with,
toolchain = "@{repo}//:jdk".format(repo = name),
),
)