KT-17245 is not about options of Kotlin compiler, ...
# build-tools
a
KT-17245 is not about options of Kotlin compiler, it is about javac options to KAPT (which uses javac internally). @alex.hart There are several ways to pass some options to the compiler: 1. Options can be set for each task. Please note that when
kotlin-android
plugin is used, Kotlin tasks patch the pattern
compile<VARIANT_NAME>Kotlin
. Also when
kotlin-android
is used, tasks are created after configuration phase, so you can refer to tasks only in
afterEvaluate
block:
Copy code
afterEvaluate {
    compileDebugKotlin {
          kotlinOptions {
               // see the docs for the list of options <https://kotlinlang.org/docs/reference/using-gradle.html#attributes-specific-for-jvm>
          }
    }
}
2. Options can be set per project by using
kotlinOptions
extension in
android
block:
Copy code
apply plugin: 'kotlin-android'

android {
     kotlinOptions {
           // ...
     }
}
The list of options that can be set using DSL can be found here https://kotlinlang.org/docs/reference/using-gradle.html#attributes-specific-for-jvm There is
freeCompilerArgs
for options that cannot be set using DSL