You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new "bootstrap" toolchain and compile with 2.1.0 (#1244)
* Create a new "bootstrap" toolchain.
Given that Kotlin 2.1.0 now has a version metadata check during compilation, the idea of bootstrapping kotlin by using the previous is pretty much dead. Probably not the worst thing, as bzlmod did not enjoy the shennanigans necessary to make it work.
This adds a new "cli" toolchain that invokes kotlinc via the established command line interface. Additionally, it sketches out a simpler, more contained toolchain api to build the more complex usecases (such as multiplex workers, jdeps, compiler plugins, etc.) on top of. the end goal is a more agile rule approach -- with the performance optimization (jdeps, class path reductions, etc) tucked behindthe simple api.Compiler plugins, linting, and the like should be able to live comfortably in the "production" rule and toolchain combinations.
It also introduces new "core" rules, while limited in scope, should be IDE friendly and generally easier to work with than the previous bootstrapping effort -- and since they use the common providers, they will interoperate with the existing rules.
Includes myriad of small fixes to get everything running on 2.1.
| <aid="kt_kotlinc_options-name"></a>name | A unique name for this target. | <ahref="https://bazel.build/concepts/labels#target-names">Name</a> | required ||
399
398
| <aid="kt_kotlinc_options-include_stdlibs"></a>include_stdlibs | Don't automatically include the Kotlin standard libraries into the classpath (stdlib and reflect). | String | optional |`"all"`|
400
399
| <aid="kt_kotlinc_options-java_parameters"></a>java_parameters | Generate metadata for Java 1.8+ reflection on method parameters. | Boolean | optional |`False`|
401
-
| <aid="kt_kotlinc_options-jvm_target"></a>jvm_target | The -jvm_target flag. This is only tested at 1.8.| String | optional |`""`|
400
+
| <aid="kt_kotlinc_options-jvm_target"></a>jvm_target | The target version of the generated JVM bytecode| String | optional |`""`|
| <aid="kt_kotlinc_options-x_allow_result_return_type"></a>x_allow_result_return_type | Enable kotlin.Result as a return type | Boolean | optional |`False`|
404
402
| <aid="kt_kotlinc_options-x_assertions"></a>x_assertions | Configures how assertions are handled. The 'jvm' option enables assertions in JVM code. | String | optional |`""`|
405
403
| <aid="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`|
406
404
| <aid="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`|
| <aid="kt_kotlinc_options-x_jdk_release"></a>x_jdk_release |The -jvm_target flag. This is only tested at 1.8. | String | optional |`""`|
410
+
| <aid="kt_kotlinc_options-x_jdk_release"></a>x_jdk_release |Compile against the specified JDK API version, similarly to javac's '-release'. This requires JDK 9 or newer. The supported versions depend on the JDK used; for JDK 17+, the supported versions are 1.8 and 9â21. This also sets the value of '-jvm-target' to be equal to the selected JDK version. | String | optional |`""`|
413
411
| <aid="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 |`""`|
414
412
| <aid="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 |`""`|
415
413
| <aid="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"`|
| <aid="kt_kotlinc_options-x_multi_platform"></a>x_multi_platform | Enable experimental language support for multi-platform projects | Boolean | optional |`False`|
418
416
| <aid="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`|
| <aid="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
418
| <aid="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
419
| <aid="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`|
423
420
| <aid="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`|
@@ -579,8 +576,8 @@ Call this in the WORKSPACE file to setup the Kotlin rules.
0 commit comments