Skip to content

Commit 2ea9a15

Browse files
committed
Update docs, add provider to the release
1 parent e2c7fc0 commit 2ea9a15

File tree

8 files changed

+61
-27
lines changed

8 files changed

+61
-27
lines changed

docs/kotlin.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,10 @@ Define java compiler options for `kt_jvm_*` rules with java sources.
377377
load("@rules_kotlin//kotlin:core.bzl", "kt_kotlinc_options")
378378

379379
kt_kotlinc_options(<a href="#kt_kotlinc_options-name">name</a>, <a href="#kt_kotlinc_options-include_stdlibs">include_stdlibs</a>, <a href="#kt_kotlinc_options-java_parameters">java_parameters</a>, <a href="#kt_kotlinc_options-jvm_target">jvm_target</a>, <a href="#kt_kotlinc_options-warn">warn</a>,
380-
<a href="#kt_kotlinc_options-x_allow_result_return_type">x_allow_result_return_type</a>, <a href="#kt_kotlinc_options-x_assertions">x_assertions</a>, <a href="#kt_kotlinc_options-x_backend_threads">x_backend_threads</a>,
381-
<a href="#kt_kotlinc_options-x_consistent_data_class_copy_visibility">x_consistent_data_class_copy_visibility</a>, <a href="#kt_kotlinc_options-x_context_receivers">x_context_receivers</a>,
382-
<a href="#kt_kotlinc_options-x_emit_jvm_type_annotations">x_emit_jvm_type_annotations</a>, <a href="#kt_kotlinc_options-x_enable_incremental_compilation">x_enable_incremental_compilation</a>, <a href="#kt_kotlinc_options-x_explicit_api_mode">x_explicit_api_mode</a>,
383-
<a href="#kt_kotlinc_options-x_inline_classes">x_inline_classes</a>, <a href="#kt_kotlinc_options-x_jdk_release">x_jdk_release</a>, <a href="#kt_kotlinc_options-x_jspecify_annotations">x_jspecify_annotations</a>, <a href="#kt_kotlinc_options-x_jsr_305">x_jsr_305</a>, <a href="#kt_kotlinc_options-x_jvm_default">x_jvm_default</a>,
384-
<a href="#kt_kotlinc_options-x_lambdas">x_lambdas</a>, <a href="#kt_kotlinc_options-x_multi_platform">x_multi_platform</a>, <a href="#kt_kotlinc_options-x_no_call_assertions">x_no_call_assertions</a>, <a href="#kt_kotlinc_options-x_no_optimize">x_no_optimize</a>,
385-
<a href="#kt_kotlinc_options-x_no_optimized_callable_references">x_no_optimized_callable_references</a>, <a href="#kt_kotlinc_options-x_no_param_assertions">x_no_param_assertions</a>,
386-
<a href="#kt_kotlinc_options-x_no_receiver_assertions">x_no_receiver_assertions</a>, <a href="#kt_kotlinc_options-x_no_source_debug_extension">x_no_source_debug_extension</a>, <a href="#kt_kotlinc_options-x_optin">x_optin</a>, <a href="#kt_kotlinc_options-x_report_perf">x_report_perf</a>,
387-
<a href="#kt_kotlinc_options-x_sam_conversions">x_sam_conversions</a>, <a href="#kt_kotlinc_options-x_skip_prerelease_check">x_skip_prerelease_check</a>, <a href="#kt_kotlinc_options-x_suppress_version_warnings">x_suppress_version_warnings</a>,
388-
<a href="#kt_kotlinc_options-x_type_enhancement_improvements_strict_mode">x_type_enhancement_improvements_strict_mode</a>, <a href="#kt_kotlinc_options-x_use_fir_lt">x_use_fir_lt</a>, <a href="#kt_kotlinc_options-x_use_k2">x_use_k2</a>)
380+
<a href="#kt_kotlinc_options-x_allow_result_return_type">x_allow_result_return_type</a>, <a href="#kt_kotlinc_options-x_assertions">x_assertions</a>, <a href="#kt_kotlinc_options-x_consistent_data_class_copy_visibility">x_consistent_data_class_copy_visibility</a>,
381+
<a href="#kt_kotlinc_options-x_enable_incremental_compilation">x_enable_incremental_compilation</a>, <a href="#kt_kotlinc_options-x_jdk_release">x_jdk_release</a>, <a href="#kt_kotlinc_options-x_jspecify_annotations">x_jspecify_annotations</a>, <a href="#kt_kotlinc_options-x_jsr_305">x_jsr_305</a>,
382+
<a href="#kt_kotlinc_options-x_jvm_default">x_jvm_default</a>, <a href="#kt_kotlinc_options-x_multi_platform">x_multi_platform</a>, <a href="#kt_kotlinc_options-x_no_source_debug_extension">x_no_source_debug_extension</a>, <a href="#kt_kotlinc_options-x_optin">x_optin</a>,
383+
<a href="#kt_kotlinc_options-x_type_enhancement_improvements_strict_mode">x_type_enhancement_improvements_strict_mode</a>, <a href="#kt_kotlinc_options-x_use_fir_lt">x_use_fir_lt</a>)
389384
</pre>
390385

391386
Define kotlin compiler options.
@@ -402,33 +397,17 @@ Define kotlin compiler options.
402397
| <a id="kt_kotlinc_options-warn"></a>warn | Control warning behaviour. | String | optional | `"report"` |
403398
| <a id="kt_kotlinc_options-x_allow_result_return_type"></a>x_allow_result_return_type | Enable kotlin.Result as a return type | Boolean | optional | `False` |
404399
| <a id="kt_kotlinc_options-x_assertions"></a>x_assertions | Configures how assertions are handled. The 'jvm' option enables assertions in JVM code. | String | optional | `""` |
405-
| <a id="kt_kotlinc_options-x_backend_threads"></a>x_backend_threads | When using the IR backend, run lowerings by file in N parallel threads. 0 means use a thread per processor core. Default value is 1. | Integer | optional | `1` |
406400
| <a id="kt_kotlinc_options-x_consistent_data_class_copy_visibility"></a>x_consistent_data_class_copy_visibility | The effect of this compiler flag is the same as applying @ConsistentCopyVisibility annotation to all data classes in the module. See https://youtrack.jetbrains.com/issue/KT-11914 | Boolean | optional | `False` |
407-
| <a id="kt_kotlinc_options-x_context_receivers"></a>x_context_receivers | Enable experimental context receivers. | Boolean | optional | `False` |
408-
| <a id="kt_kotlinc_options-x_emit_jvm_type_annotations"></a>x_emit_jvm_type_annotations | Basic support for type annotations in JVM bytecode. | Boolean | optional | `False` |
409401
| <a id="kt_kotlinc_options-x_enable_incremental_compilation"></a>x_enable_incremental_compilation | Enable incremental compilation | Boolean | optional | `False` |
410-
| <a id="kt_kotlinc_options-x_explicit_api_mode"></a>x_explicit_api_mode | Enable explicit API mode for Kotlin libraries. | String | optional | `"off"` |
411-
| <a id="kt_kotlinc_options-x_inline_classes"></a>x_inline_classes | Enable experimental inline classes | Boolean | optional | `False` |
412402
| <a id="kt_kotlinc_options-x_jdk_release"></a>x_jdk_release | The -jvm_target flag. This is only tested at 1.8. | String | optional | `""` |
413403
| <a id="kt_kotlinc_options-x_jspecify_annotations"></a>x_jspecify_annotations | Controls how JSpecify annotations are treated. Options are 'default', 'ignore', 'warn', and 'strict'. | String | optional | `""` |
414404
| <a id="kt_kotlinc_options-x_jsr_305"></a>x_jsr_305 | Specifies how to handle JSR-305 annotations in Kotlin code. Options are 'default', 'ignore', 'warn', and 'strict'. | String | optional | `""` |
415405
| <a id="kt_kotlinc_options-x_jvm_default"></a>x_jvm_default | Specifies that a JVM default method should be generated for non-abstract Kotlin interface member. | String | optional | `"off"` |
416-
| <a id="kt_kotlinc_options-x_lambdas"></a>x_lambdas | Change codegen behavior of lambdas | String | optional | `"class"` |
417406
| <a id="kt_kotlinc_options-x_multi_platform"></a>x_multi_platform | Enable experimental language support for multi-platform projects | Boolean | optional | `False` |
418-
| <a id="kt_kotlinc_options-x_no_call_assertions"></a>x_no_call_assertions | Don't generate not-null assertions for arguments of platform types | Boolean | optional | `False` |
419-
| <a id="kt_kotlinc_options-x_no_optimize"></a>x_no_optimize | Disable optimizations | Boolean | optional | `False` |
420-
| <a id="kt_kotlinc_options-x_no_optimized_callable_references"></a>x_no_optimized_callable_references | Do not use optimized callable reference superclasses. Available from 1.4. | Boolean | optional | `False` |
421-
| <a id="kt_kotlinc_options-x_no_param_assertions"></a>x_no_param_assertions | Don't generate not-null assertions on parameters of methods accessible from Java | Boolean | optional | `False` |
422-
| <a id="kt_kotlinc_options-x_no_receiver_assertions"></a>x_no_receiver_assertions | Don't generate not-null assertion for extension receiver arguments of platform types | Boolean | optional | `False` |
423407
| <a id="kt_kotlinc_options-x_no_source_debug_extension"></a>x_no_source_debug_extension | Do not generate @kotlin.jvm.internal.SourceDebugExtension annotation on a class with the copy of SMAP | Boolean | optional | `False` |
424408
| <a id="kt_kotlinc_options-x_optin"></a>x_optin | Define APIs to opt-in to. | List of strings | optional | `[]` |
425-
| <a id="kt_kotlinc_options-x_report_perf"></a>x_report_perf | Report detailed performance statistics | Boolean | optional | `False` |
426-
| <a id="kt_kotlinc_options-x_sam_conversions"></a>x_sam_conversions | Change codegen behavior of SAM/functional interfaces | String | optional | `"class"` |
427-
| <a id="kt_kotlinc_options-x_skip_prerelease_check"></a>x_skip_prerelease_check | Suppress errors thrown when using pre-release classes. | Boolean | optional | `False` |
428-
| <a id="kt_kotlinc_options-x_suppress_version_warnings"></a>x_suppress_version_warnings | Suppress warnings about outdated, inconsistent, or experimental language or API versions. | Boolean | optional | `False` |
429409
| <a id="kt_kotlinc_options-x_type_enhancement_improvements_strict_mode"></a>x_type_enhancement_improvements_strict_mode | Enables strict mode for type enhancement improvements, enforcing stricter type checking and enhancements. | Boolean | optional | `False` |
430410
| <a id="kt_kotlinc_options-x_use_fir_lt"></a>x_use_fir_lt | Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready | Boolean | optional | `False` |
431-
| <a id="kt_kotlinc_options-x_use_k2"></a>x_use_k2 | Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided | Boolean | optional | `False` |
432411

433412

434413
<a id="kt_ksp_plugin"></a>
@@ -579,8 +558,8 @@ Call this in the WORKSPACE file to setup the Kotlin rules.
579558
| <a id="kotlin_repositories-is_bzlmod"></a>is_bzlmod | <p align="center"> - </p> | `False` |
580559
| <a id="kotlin_repositories-compiler_repository_name"></a>compiler_repository_name | for the kotlinc compiler repository. | `"com_github_jetbrains_kotlin"` |
581560
| <a id="kotlin_repositories-ksp_repository_name"></a>ksp_repository_name | <p align="center"> - </p> | `"com_github_google_ksp"` |
582-
| <a id="kotlin_repositories-compiler_release"></a>compiler_release | version provider from versions.bzl. | `struct(sha256 = "88d7d8bad362ae4e114a8b9668c6887b8c85f48e340883db0e317e47c8dc2f4f", url_templates = ["https://github.com/JetBrains/kotlin/releases/download/v{version}/kotlin-compiler-{version}.zip"], version = "2.0.10")` |
583-
| <a id="kotlin_repositories-ksp_compiler_release"></a>ksp_compiler_release | (internal) version provider from versions.bzl. | `struct(sha256 = "e6a79e649ee383b372fa982be89686c10ee42b25e60147b3271a70fd75a9eb19", url_templates = ["https://github.com/google/ksp/releases/download/{version}/artifacts.zip"], version = "2.0.10-1.0.24")` |
561+
| <a id="kotlin_repositories-compiler_release"></a>compiler_release | version provider from versions.bzl. | `struct(sha256 = "b6698d5728ad8f9edcdd01617d638073191d8a03139cc538a391b4e3759ad297", url_templates = ["https://github.com/JetBrains/kotlin/releases/download/v{version}/kotlin-compiler-{version}.zip"], version = "2.1.0")` |
562+
| <a id="kotlin_repositories-ksp_compiler_release"></a>ksp_compiler_release | (internal) version provider from versions.bzl. | `struct(sha256 = "fc27b08cadc061a4a989af01cbeccb613feef1995f4aad68f2be0f886a3ee251", url_templates = ["https://github.com/google/ksp/releases/download/{version}/artifacts.zip"], version = "2.1.0-1.0.28")` |
584563

585564

586565
<a id="versions.use_repository"></a>

kotlin/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ genrule(
6666
cat "$$md" >> $@
6767
done
6868
""",
69+
executable = True,
6970
visibility = [
7071
"//visibility:public",
7172
],

kotlin/internal/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ bzl_library(
4343
"//kotlin/internal/lint",
4444
"//kotlin/internal/utils",
4545
"//src/main/starlark",
46+
"//src/main/starlark/core/compile",
4647
"//src/main/starlark/core/options",
4748
"@rules_java//java:rules",
4849
],

src/main/starlark/core/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ release_archive(
1010
"BUILD.release.bazel": "BUILD.bazel",
1111
},
1212
deps = [
13+
"//src/main/starlark/core/compile:pkg",
1314
"//src/main/starlark/core/options:pkg",
1415
"//src/main/starlark/core/plugin:pkg",
1516
"//src/main/starlark/core/repositories:pkg",
@@ -21,6 +22,7 @@ bzl_library(
2122
srcs = glob(["*.bzl"]),
2223
visibility = ["//:__subpackages__"],
2324
deps = [
25+
"//src/main/starlark/core/compile",
2426
"//src/main/starlark/core/plugin",
2527
"//src/main/starlark/core/repositories",
2628
],

src/main/starlark/core/BUILD.release.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ bzl_library(
1919
srcs = glob(["*.bzl"]),
2020
visibility = ["//visibility:public"],
2121
deps = [
22+
"//src/main/starlark/core/compile",
2223
"//src/main/starlark/core/options",
2324
"//src/main/starlark/core/repositories",
2425
],
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
load("//src/main/starlark/release:packager.bzl", "release_archive")
3+
14
toolchain_type(
25
name = "toolchain_type",
36
visibility = [
47
"//visibility:public",
58
],
69
)
10+
11+
bzl_library(
12+
name = "compile",
13+
srcs = [
14+
"common.bzl",
15+
],
16+
visibility = [
17+
"//visibility:public",
18+
],
19+
)
20+
21+
release_archive(
22+
name = "pkg",
23+
srcs = glob(
24+
["common.bzl"],
25+
),
26+
src_map = {
27+
"BUILD.release.bazel": "BUILD.bazel",
28+
},
29+
deps = [],
30+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2020 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+
15+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16+
17+
bzl_library(
18+
name = "compile",
19+
srcs = [
20+
"common.bzl",
21+
],
22+
visiblity = [
23+
"//visibility:public",
24+
],
25+
)

src/main/starlark/core/compile/cli/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ cli_toolchain(
2626
"//kotlin/compiler:kotlin-stdlib-jdk7",
2727
"//kotlin/compiler:kotlin-stdlib-jdk8",
2828
"//kotlin/compiler:kotlinx-coroutines-core-jvm",
29+
"//kotlin/compiler:trove4j",
2930
],
3031
kotlinc = ":kotlinc",
3132
language_version = versions.KOTLIN_CURRENT_COMPILER_RELEASE.version,

0 commit comments

Comments
 (0)