Skip to content

Commit

Permalink
Support Kotlin 2.0 target and language levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Bencodes committed Dec 8, 2023
1 parent 83c3b5d commit 981505b
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kotlin/internal/toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ _kt_toolchain = rule(
"1.7",
"1.8",
"1.9",
"2.0",
],
),
"api_version": attr.string(
Expand All @@ -150,6 +151,7 @@ _kt_toolchain = rule(
"1.7",
"1.8",
"1.9",
"2.0",
],
),
"debug": attr.string_list(
Expand Down
1 change: 1 addition & 0 deletions src/main/starlark/core/repositories/compiler.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _CAPABILITIES_TEMPLATES = {
"1.7": "//src/main/starlark/core/repositories/kotlin:capabilities_1.7.bzl.com_github_jetbrains_kotlin.bazel",
"1.8": "//src/main/starlark/core/repositories/kotlin:capabilities_1.8.bzl.com_github_jetbrains_kotlin.bazel",
"1.9": "//src/main/starlark/core/repositories/kotlin:capabilities_1.9.bzl.com_github_jetbrains_kotlin.bazel",
"1.9": "//src/main/starlark/core/repositories/kotlin:capabilities_2.0.bzl.com_github_jetbrains_kotlin.bazel",
}

kotlin_compiler_repository = repository_rule(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Copyright 2023 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
KOTLIN_OPTS = [
"-Werror",
"-Xabi-stability",
"-Xadd-modules",
"-Xallow-any-scripts-in-source-roots",
"-Xallow-kotlin-package",
"-Xallow-no-source-files",
"-Xallow-result-return-type",
"-Xallow-unstable-dependencies",
"-Xassertions",
"-Xbackend-threads",
"-Xbuiltins-from-sources",
"-Xcheck-phase-conditions",
"-Xcheck-sticky-phase-conditions",
"-Xcommon-sources",
"-Xcompile-java",
"-Xcontext-receivers",
"-Xdebug",
"-Xdefault-script-extension",
"-Xdisable-default-scripting-plugin",
"-Xdisable-phases",
"-Xdisable-standard-script",
"-Xdisable-ultra-light-classes",
"-Xeffect-system",
"-Xemit-jvm-type-annotations",
"-Xenable-builder-inference",
"-Xenable-incremental-compilation",
"-Xenhance-type-parameter-types-to-def-not-null",
"-Xexpect-actual-linker",
"-Xexplicit-api",
"-Xextended-compiler-checks",
"-Xfriend-paths",
"-Xgenerate-strict-metadata-version",
"-Xignore-const-optimization-errors",
"-Xinference-compatibility",
"-Xinline-classes",
"-Xir-do-not-clear-binding-context",
"-Xjava-package-prefix",
"-Xjava-source-roots",
"-Xjavac-arguments",
"-Xjdk-release",
"-Xjspecify-annotations",
"-Xjsr305",
"-Xjvm-default",
"-Xjvm-enable-preview",
"-Xklib",
"-Xklib-enable-signature-clash-checks",
"-Xklib-normalize-absolute-path",
"-Xklib-relative-path-base",
"-Xlambdas",
"-Xlegacy-smart-cast-after-try",
"-Xlink-via-signatures",
"-Xlist-phases",
"-Xmetadata-version",
"-Xmodule-path",
"-Xmulti-platform",
"-Xmultifile-parts-inherit",
"-Xnew-inference",
"-Xno-call-assertions",
"-Xno-check-actual",
"-Xno-inline",
"-Xno-kotlin-nothing-value-exception",
"-Xno-new-java-annotation-targets",
"-Xno-optimize",
"-Xno-optimized-callable-references",
"-Xno-param-assertions",
"-Xno-receiver-assertions",
"-Xno-reset-jar-timestamps",
"-Xno-source-debug-extension",
"-Xno-unified-null-checks",
"-Xnullability-annotations",
"-Xphases-to-dump",
"-Xphases-to-dump-after",
"-Xphases-to-dump-before",
"-Xphases-to-validate",
"-Xphases-to-validate-after",
"-Xphases-to-validate-before",
"-Xprofile",
"-Xprofile-phases",
"-Xproper-ieee754-comparisons",
"-Xread-deserialized-contracts",
"-Xrender-internal-diagnostic-names",
"-Xrepeat",
"-Xreport-output-files",
"-Xreport-perf",
"-Xsam-conversions",
"-Xsanitize-parentheses",
"-Xscript-resolver-environment",
"-Xself-upper-bound-inference",
"-Xserialize-ir",
"-Xskip-metadata-version-check",
"-Xskip-prerelease-check",
"-Xstring-concat",
"-Xsupport-compatqual-checker-framework-annotations",
"-Xsuppress-deprecated-jvm-target-warning",
"-Xsuppress-missing-builtins-error",
"-Xsuppress-version-warnings",
"-Xtype-enhancement-improvements-strict-mode",
"-Xunrestricted-builder-inference",
"-Xuse-14-inline-classes-mangling-scheme",
"-Xuse-fast-jar-file-system",
"-Xuse-fir-extended-checkers",
"-Xuse-fir-ic",
"-Xuse-fir-lt",
"-Xuse-ir",
"-Xuse-javac",
"-Xuse-k2",
"-Xuse-mixed-named-arguments",
"-Xuse-old-backend",
"-Xuse-old-class-files-reading",
"-Xuse-old-innerclasses-logic",
"-Xuse-type-table",
"-Xvalidate-bytecode",
"-Xvalidate-ir",
"-Xvalue-classes",
"-Xverbose-phases",
"-api-version",
"-java-parameters",
"-jvm-target",
"-language-version",
"-no-reflect",
"-nowarn",
"-opt-in",
"-progressive",
"-verbose",
"-version",
]

0 comments on commit 981505b

Please sign in to comment.