diff --git a/compose-destinations-bottom-sheet/build.gradle.kts b/compose-destinations-bottom-sheet/build.gradle.kts index 0eccb2be..8f315164 100644 --- a/compose-destinations-bottom-sheet/build.gradle.kts +++ b/compose-destinations-bottom-sheet/build.gradle.kts @@ -13,7 +13,6 @@ android { defaultConfig { minSdk = libs.versions.minSdk.get().toIntOrNull() - targetSdk = libs.versions.targetSdk.get().toIntOrNull() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles.add(File("consumer-rules.pro")) @@ -40,11 +39,13 @@ android { } } -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += listOf( - "-opt-in=kotlin.RequiresOptIn", - "-opt-in=com.ramcosta.composedestinations.annotation.internal.InternalDestinationsApi" - ) +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + "-opt-in=kotlin.RequiresOptIn", + "-opt-in=com.ramcosta.composedestinations.annotation.internal.InternalDestinationsApi" + ) + } } dependencies { diff --git a/compose-destinations-ksp/build.gradle.kts b/compose-destinations-ksp/build.gradle.kts index 5d158b10..4b27ef9b 100644 --- a/compose-destinations-ksp/build.gradle.kts +++ b/compose-destinations-ksp/build.gradle.kts @@ -9,12 +9,12 @@ java { targetCompatibility = JavaVersion.VERSION_1_8 } -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() +kotlin { + compilerOptions { + freeCompilerArgs.addAll("-opt-in=kotlin.RequiresOptIn") } + + jvmToolchain(8) } dependencies { diff --git a/compose-destinations-wear/build.gradle.kts b/compose-destinations-wear/build.gradle.kts index 4a498745..859637d5 100644 --- a/compose-destinations-wear/build.gradle.kts +++ b/compose-destinations-wear/build.gradle.kts @@ -13,7 +13,6 @@ android { defaultConfig { minSdk = 25 - targetSdk = libs.versions.targetSdk.get().toIntOrNull() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles.add(File("consumer-rules.pro")) @@ -38,17 +37,17 @@ android { buildFeatures { compose = true } + } kotlin { jvmToolchain(11) -} - -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += listOf( - "-opt-in=kotlin.RequiresOptIn", - "-opt-in=com.ramcosta.composedestinations.annotation.internal.InternalDestinationsApi" - ) + compilerOptions { + freeCompilerArgs.addAll( + "-opt-in=kotlin.RequiresOptIn", + "-opt-in=com.ramcosta.composedestinations.annotation.internal.InternalDestinationsApi" + ) + } } dependencies { diff --git a/compose-destinations/build.gradle.kts b/compose-destinations/build.gradle.kts index cfe91d97..063067aa 100644 --- a/compose-destinations/build.gradle.kts +++ b/compose-destinations/build.gradle.kts @@ -44,11 +44,13 @@ android { } } -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += listOf( - "-opt-in=kotlin.RequiresOptIn", - "-opt-in=com.ramcosta.composedestinations.annotation.internal.InternalDestinationsApi" - ) +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + "-opt-in=kotlin.RequiresOptIn", + "-opt-in=com.ramcosta.composedestinations.annotation.internal.InternalDestinationsApi" + ) + } } dependencies { diff --git a/playground/app/build.gradle.kts b/playground/app/build.gradle.kts index b5401fde..61133cf7 100644 --- a/playground/app/build.gradle.kts +++ b/playground/app/build.gradle.kts @@ -7,10 +7,6 @@ plugins { alias(libs.plugins.compose.compiler) } -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" -} - android { namespace = "com.ramcosta.samples.playground" compileSdk = libs.versions.compileSdk.get().toIntOrNull() @@ -71,6 +67,9 @@ android { kotlin { jvmToolchain(11) + compilerOptions { + freeCompilerArgs.addAll("-opt-in=kotlin.RequiresOptIn") + } } dependencies { diff --git a/sample-wear/build.gradle.kts b/sample-wear/build.gradle.kts index 698d09cf..e2d3d124 100644 --- a/sample-wear/build.gradle.kts +++ b/sample-wear/build.gradle.kts @@ -1,12 +1,8 @@ plugins { id("com.android.application") kotlin("android") - alias(libs.plugins.compose.compiler) id("com.google.devtools.ksp") version libs.versions.ksp.get() -} - -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" + alias(libs.plugins.compose.compiler) } android { @@ -53,6 +49,9 @@ android { kotlin { jvmToolchain(11) + compilerOptions { + freeCompilerArgs.addAll("-opt-in=kotlin.RequiresOptIn") + } } dependencies { diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index f4edad1e..65e37f4f 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -5,10 +5,6 @@ plugins { alias(libs.plugins.compose.compiler) } -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" -} - android { namespace = "com.ramcosta.destinations.sample" compileSdk = libs.versions.compileSdk.get().toIntOrNull() @@ -53,6 +49,9 @@ android { kotlin { jvmToolchain(11) + compilerOptions { + freeCompilerArgs.addAll("-opt-in=kotlin.RequiresOptIn") + } } dependencies {