Doni Winata
kotlinOptions { freeCompilerArgs += [ '-Xsam-conversions=class', ] }
ephemient
tasks.withType(KotlinCompile).matching { it.name.contains('Test') }.configureEach { kotlinOptions.freeCompilerArgs += [ ... ] }
Johannes Koenen
tasks { val prodOptIns = listOf("kotlin.RequiresOptIn") val testOptIns = prodOptIns + listOf("kotlinx.coroutines.ExperimentalCoroutinesApi", "kotlinx.coroutines.FlowPreview") compileKotlin { kotlinOptions { freeCompilerArgs = freeCompilerArgs + prodOptIns.map { "-Xopt-in=$it" } } } compileTestKotlin { kotlinOptions { freeCompilerArgs = freeCompilerArgs + testOptIns.map { "-Xopt-in=$it" } } } }
A modern programming language that makes developers happier.