Skip to content

Commit e06ba90

Browse files
authored
Support Kotlin 2.0 target and language levels (#1086)
* Support Kotlin 2.0 target and language levels * 2.0
1 parent a82b996 commit e06ba90

File tree

3 files changed

+143
-0
lines changed

3 files changed

+143
-0
lines changed

kotlin/internal/toolchains.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ _kt_toolchain = rule(
135135
"1.7",
136136
"1.8",
137137
"1.9",
138+
"2.0",
138139
],
139140
),
140141
"api_version": attr.string(
@@ -150,6 +151,7 @@ _kt_toolchain = rule(
150151
"1.7",
151152
"1.8",
152153
"1.9",
154+
"2.0",
153155
],
154156
),
155157
"debug": attr.string_list(

src/main/starlark/core/repositories/compiler.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ _CAPABILITIES_TEMPLATES = {
4242
"1.7": "//src/main/starlark/core/repositories/kotlin:capabilities_1.7.bzl.com_github_jetbrains_kotlin.bazel",
4343
"1.8": "//src/main/starlark/core/repositories/kotlin:capabilities_1.8.bzl.com_github_jetbrains_kotlin.bazel",
4444
"1.9": "//src/main/starlark/core/repositories/kotlin:capabilities_1.9.bzl.com_github_jetbrains_kotlin.bazel",
45+
"2.0": "//src/main/starlark/core/repositories/kotlin:capabilities_2.0.bzl.com_github_jetbrains_kotlin.bazel",
4546
}
4647

4748
kotlin_compiler_repository = repository_rule(
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Copyright 2023 The Bazel Authors. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
KOTLIN_OPTS = [
15+
"-Werror",
16+
"-Xabi-stability",
17+
"-Xadd-modules",
18+
"-Xallow-any-scripts-in-source-roots",
19+
"-Xallow-kotlin-package",
20+
"-Xallow-no-source-files",
21+
"-Xallow-result-return-type",
22+
"-Xallow-unstable-dependencies",
23+
"-Xassertions",
24+
"-Xbackend-threads",
25+
"-Xbuiltins-from-sources",
26+
"-Xcheck-phase-conditions",
27+
"-Xcheck-sticky-phase-conditions",
28+
"-Xcommon-sources",
29+
"-Xcompile-java",
30+
"-Xcontext-receivers",
31+
"-Xdebug",
32+
"-Xdefault-script-extension",
33+
"-Xdisable-default-scripting-plugin",
34+
"-Xdisable-phases",
35+
"-Xdisable-standard-script",
36+
"-Xdisable-ultra-light-classes",
37+
"-Xeffect-system",
38+
"-Xemit-jvm-type-annotations",
39+
"-Xenable-builder-inference",
40+
"-Xenable-incremental-compilation",
41+
"-Xenhance-type-parameter-types-to-def-not-null",
42+
"-Xexpect-actual-linker",
43+
"-Xexplicit-api",
44+
"-Xextended-compiler-checks",
45+
"-Xfriend-paths",
46+
"-Xgenerate-strict-metadata-version",
47+
"-Xignore-const-optimization-errors",
48+
"-Xinference-compatibility",
49+
"-Xinline-classes",
50+
"-Xir-do-not-clear-binding-context",
51+
"-Xjava-package-prefix",
52+
"-Xjava-source-roots",
53+
"-Xjavac-arguments",
54+
"-Xjdk-release",
55+
"-Xjspecify-annotations",
56+
"-Xjsr305",
57+
"-Xjvm-default",
58+
"-Xjvm-enable-preview",
59+
"-Xklib",
60+
"-Xklib-enable-signature-clash-checks",
61+
"-Xklib-normalize-absolute-path",
62+
"-Xklib-relative-path-base",
63+
"-Xlambdas",
64+
"-Xlegacy-smart-cast-after-try",
65+
"-Xlink-via-signatures",
66+
"-Xlist-phases",
67+
"-Xmetadata-version",
68+
"-Xmodule-path",
69+
"-Xmulti-platform",
70+
"-Xmultifile-parts-inherit",
71+
"-Xnew-inference",
72+
"-Xno-call-assertions",
73+
"-Xno-check-actual",
74+
"-Xno-inline",
75+
"-Xno-kotlin-nothing-value-exception",
76+
"-Xno-new-java-annotation-targets",
77+
"-Xno-optimize",
78+
"-Xno-optimized-callable-references",
79+
"-Xno-param-assertions",
80+
"-Xno-receiver-assertions",
81+
"-Xno-reset-jar-timestamps",
82+
"-Xno-source-debug-extension",
83+
"-Xno-unified-null-checks",
84+
"-Xnullability-annotations",
85+
"-Xphases-to-dump",
86+
"-Xphases-to-dump-after",
87+
"-Xphases-to-dump-before",
88+
"-Xphases-to-validate",
89+
"-Xphases-to-validate-after",
90+
"-Xphases-to-validate-before",
91+
"-Xprofile",
92+
"-Xprofile-phases",
93+
"-Xproper-ieee754-comparisons",
94+
"-Xread-deserialized-contracts",
95+
"-Xrender-internal-diagnostic-names",
96+
"-Xrepeat",
97+
"-Xreport-output-files",
98+
"-Xreport-perf",
99+
"-Xsam-conversions",
100+
"-Xsanitize-parentheses",
101+
"-Xscript-resolver-environment",
102+
"-Xself-upper-bound-inference",
103+
"-Xserialize-ir",
104+
"-Xskip-metadata-version-check",
105+
"-Xskip-prerelease-check",
106+
"-Xstring-concat",
107+
"-Xsupport-compatqual-checker-framework-annotations",
108+
"-Xsuppress-deprecated-jvm-target-warning",
109+
"-Xsuppress-missing-builtins-error",
110+
"-Xsuppress-version-warnings",
111+
"-Xtype-enhancement-improvements-strict-mode",
112+
"-Xunrestricted-builder-inference",
113+
"-Xuse-14-inline-classes-mangling-scheme",
114+
"-Xuse-fast-jar-file-system",
115+
"-Xuse-fir-extended-checkers",
116+
"-Xuse-fir-ic",
117+
"-Xuse-fir-lt",
118+
"-Xuse-ir",
119+
"-Xuse-javac",
120+
"-Xuse-k2",
121+
"-Xuse-mixed-named-arguments",
122+
"-Xuse-old-backend",
123+
"-Xuse-old-class-files-reading",
124+
"-Xuse-old-innerclasses-logic",
125+
"-Xuse-type-table",
126+
"-Xvalidate-bytecode",
127+
"-Xvalidate-ir",
128+
"-Xvalue-classes",
129+
"-Xverbose-phases",
130+
"-api-version",
131+
"-java-parameters",
132+
"-jvm-target",
133+
"-language-version",
134+
"-no-reflect",
135+
"-nowarn",
136+
"-opt-in",
137+
"-progressive",
138+
"-verbose",
139+
"-version",
140+
]

0 commit comments

Comments
 (0)