Bazel: move patching of rules_kotlin to a registry override

This commit is contained in:
Paolo Tranquilli
2024-04-09 18:03:41 +02:00
parent c9565b3657
commit 5bdd724221
9 changed files with 78 additions and 8 deletions

View File

@@ -1,32 +0,0 @@
diff --git a/src/main/starlark/core/options/opts.kotlinc.bzl b/src/main/starlark/core/options/opts.kotlinc.bzl
index 9b15fb8..c0ac2cd 100644
--- a/src/main/starlark/core/options/opts.kotlinc.bzl
+++ b/src/main/starlark/core/options/opts.kotlinc.bzl
@@ -28,6 +28,11 @@ def _map_jvm_target_to_flag(version):
return None
return ["-jvm-target=%s" % version]
+def _map_language_version_to_flag(version):
+ if not version:
+ return None
+ return ["-language-version=%s" % version, "-api-version=%s" % version]
+
_KOPTS_ALL = {
"warn": struct(
args = dict(
@@ -349,6 +354,15 @@ _KOPTS_ALL = {
value_to_flag = None,
map_value_to_flag = _map_jvm_target_to_flag,
),
+ "language_version": struct(
+ args = dict(
+ default = "1.9",
+ doc = "-language-version",
+ ),
+ type = attr.string,
+ value_to_flag = None,
+ map_value_to_flag = _map_language_version_to_flag,
+ ),
}
# Filters out options that are not available in current compiler release