rules_kotlin
rules_kotlin copied to clipboard
How to add kotlin compiler option ?
Hello,
I'm trying to add the -Xuse-experimental=kotlin.contracts.ExperimentalContracts option to the compiler and I really don't understand how to manage that.
Is it with the kt_compiler_plugin ?
/plugins/BUILD.bazel:
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_compiler_plugin")
package(default_visibility = ["//visibility:public"])
kt_compiler_plugin(
name = "experimental_contracts",
options = {
"use-experimental": "kotlin.contracts.ExperimentalContracts", # -X... and X... don't work too
},
)
/my-lib/BUILD.bazel:
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
package(default_visibility = ["//visibility:public"])
kt_jvm_library(
name = "lib",
srcs = glob(["src/**/*.kt"]),
plugins = [
"//plugins:experimental_contracts"
],
deps = [
"...",
]
)
Thanks,
@scorsi did you ever figure this out?
I never success to manage this and to be honnest I dis stop using the Kotlin rule. But I am sure to not be the only looking for a solution to that issue.
This sounds like #23