From 49d1fb822f783528a476e7b63547a2c5b3b9b1f5 Mon Sep 17 00:00:00 2001 From: Gergely Hegedus Date: Mon, 24 Jan 2022 20:17:13 +0200 Subject: [PATCH] Opt in into experimental features for android modules as well --- gradlescripts/testoptions.gradle | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gradlescripts/testoptions.gradle b/gradlescripts/testoptions.gradle index 42b9166..7193f48 100644 --- a/gradlescripts/testoptions.gradle +++ b/gradlescripts/testoptions.gradle @@ -31,6 +31,13 @@ subprojects { module -> includeAndroidResources = true } } + module.tasks.configureEach { task -> + if (task.taskIdentity.type.toString() == "class org.jetbrains.kotlin.gradle.tasks.KotlinCompile") { + task.kotlinOptions { + freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" + } + } + } } plugins.withId("com.android.library") { @@ -47,5 +54,12 @@ subprojects { module -> includeAndroidResources = true } } + module.tasks.configureEach { task -> + if (task.taskIdentity.type.toString() == "class org.jetbrains.kotlin.gradle.tasks.KotlinCompile") { + task.kotlinOptions { + freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" + } + } + } } } \ No newline at end of file