Opt-in for experimental Kotlin API's in gradle files

  • #  android
  • #  kotlin
  • #  gradle
  • In an Android module

    plugins {
        id "com.android.library"
        id "kotlin-android"
    }
    
    android {
        defaultConfig {
            kotlinOptions {
                freeCompilerArgs += [
                    "-Xopt-in=kotlin.time.ExperimentalTime"
                ]
            }
        }
    }
    

    In a Kotlin module

    plugins {
        id "org.jetbrains.kotlin.jvm"
    }
    
    compileKotlin {
        kotlinOptions {
            freeCompilerArgs += [
                "-Xopt-in=kotlin.time.ExperimentalTime"
            ]
        }
    }