elect
05/10/2023, 10:48 AMnamed<KotlinCompilationTask<*>>("compileKotlin") {
compilerOptions { }
}
withType<KotlinCompile<*>>().all {
kotlinOptions { }
}
I'm looking to set things such as opt-in, language version, etcJavier
05/10/2023, 10:58 AMelect
05/10/2023, 10:59 AMJavier
05/10/2023, 10:59 AMJavier
05/10/2023, 10:59 AMJavier
05/10/2023, 10:59 AMJavier
05/10/2023, 11:00 AMtasks.compileKotlin { … }
tasks.compileKotlinTest { … }
Vampire
05/10/2023, 11:23 AMkotlinOptions
vs the new recommended compilerOptions
, and that by using withType<...>().all { ... }
like when using withType<...> { ... }
you are destroying task-configuration avoidance for those tasks and should instead do withType<...>().configureEach { ... }
.Javier
05/10/2023, 12:39 PMwithType<>{}
should use configureEach
under the hoodJavier
05/10/2023, 12:40 PMJavier
05/10/2023, 12:40 PMconfigureEach
some timesVampire
05/10/2023, 12:41 PMwithType<> {}
was there before the lazy APIs existed and thus cannot be changed backwards compatibly.Javier
05/10/2023, 12:42 PMVampire
05/10/2023, 1:04 PMVampire
05/10/2023, 1:05 PMtapchicoma
05/11/2023, 7:25 AMkotlinOptions
is semi-deprecated, better to use compilerOptions
. Actually in 1.9.0
it will expose optIn
and progressive
options while kotlinOptions
not.
And in 1.9.0
project level DSL for "org.jetbrains.kotlin.jvm" plugin is coming based on `compilerOptions`:
kotlin {
compilerOptions { ... }
}
elect
05/11/2023, 8:28 AMtapchicoma
05/11/2023, 8:29 AM@Deprecated
to ittapchicoma
05/11/2023, 8:30 AMkotlinOptions
in code snippetsVampire
05/11/2023, 8:33 AMtapchicoma
05/11/2023, 8:34 AMVampire
05/11/2023, 8:34 AM