From 3a22212d8bdcd07e2750266d1ca95018a6009699 Mon Sep 17 00:00:00 2001 From: skydoves Date: Fri, 3 Jan 2025 11:53:06 +0900 Subject: [PATCH] Migrate to compiler options --- .../com/skydoves/landscapist/AndroidCompose.kt | 4 ---- coil3/build.gradle.kts | 14 ++++++-------- gradle/libs.versions.toml | 2 +- landscapist-animation/build.gradle.kts | 10 ++++++---- landscapist-palette/build.gradle.kts | 10 ++++++---- landscapist-placeholder/build.gradle.kts | 10 ++++++---- landscapist/build.gradle.kts | 15 ++++++--------- 7 files changed, 31 insertions(+), 34 deletions(-) diff --git a/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/AndroidCompose.kt b/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/AndroidCompose.kt index 23741a4e..83de72c7 100644 --- a/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/AndroidCompose.kt +++ b/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/AndroidCompose.kt @@ -40,10 +40,6 @@ internal fun Project.configureAndroidCompose( compose = true } - composeOptions { - kotlinCompilerExtensionVersion = "1.5.14" - } - packaging { resources { excludes.add("/META-INF/{AL2.0,LGPL2.1}") diff --git a/coil3/build.gradle.kts b/coil3/build.gradle.kts index ae3b260c..a7961815 100644 --- a/coil3/build.gradle.kts +++ b/coil3/build.gradle.kts @@ -14,6 +14,8 @@ * limitations under the License. */ import com.github.skydoves.landscapist.Configuration +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile plugins { id("landscapist.library.compose.multiplatformWasm") @@ -115,14 +117,10 @@ baselineProfile { } } -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += listOf( - "-Xexplicit-api=strict", - "-opt-in=kotlin.RequiresOptIn", - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-opt-in=com.skydoves.landscapist.InternalLandscapistApi", +tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + freeCompilerArgs.addAll( "-opt-in=coil3.annotation.ExperimentalCoilApi", ) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 35fc902e..3a2f7e39 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ dokka = "2.0.0" jvmTarget = "11" nexusPlugin = "0.30.0" kotlinxCoroutines = "1.9.0" -kotlinBinaryCompatibility = "0.16.3" +kotlinBinaryCompatibility = "0.17.0" androidGradlePlugin = "8.7.3" androidxActivity = "1.9.3" androidxMaterial = "1.12.0" diff --git a/landscapist-animation/build.gradle.kts b/landscapist-animation/build.gradle.kts index e90255d8..0876330a 100644 --- a/landscapist-animation/build.gradle.kts +++ b/landscapist-animation/build.gradle.kts @@ -14,6 +14,8 @@ * limitations under the License. */ import com.github.skydoves.landscapist.Configuration +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile plugins { id("landscapist.library.compose.multiplatformWasm") @@ -86,10 +88,10 @@ baselineProfile { } } -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += listOf( +tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + freeCompilerArgs.addAll( "-Xexplicit-api=strict", "-opt-in=kotlin.RequiresOptIn", "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", diff --git a/landscapist-palette/build.gradle.kts b/landscapist-palette/build.gradle.kts index f178f2bc..48e2ac63 100644 --- a/landscapist-palette/build.gradle.kts +++ b/landscapist-palette/build.gradle.kts @@ -14,6 +14,8 @@ * limitations under the License. */ import com.github.skydoves.landscapist.Configuration +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile plugins { id("landscapist.library.compose.multiplatform") @@ -81,10 +83,10 @@ baselineProfile { } } -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += listOf( +tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + freeCompilerArgs.addAll( "-Xexplicit-api=strict", "-opt-in=kotlin.RequiresOptIn", "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", diff --git a/landscapist-placeholder/build.gradle.kts b/landscapist-placeholder/build.gradle.kts index 6cdd694b..1e49a356 100644 --- a/landscapist-placeholder/build.gradle.kts +++ b/landscapist-placeholder/build.gradle.kts @@ -14,6 +14,8 @@ * limitations under the License. */ import com.github.skydoves.landscapist.Configuration +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile plugins { id("landscapist.library.compose.multiplatformWasm") @@ -86,10 +88,10 @@ baselineProfile { } } -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += listOf( +tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + freeCompilerArgs.addAll( "-Xexplicit-api=strict", "-opt-in=kotlin.RequiresOptIn", "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", diff --git a/landscapist/build.gradle.kts b/landscapist/build.gradle.kts index 20809763..20cfe7d8 100644 --- a/landscapist/build.gradle.kts +++ b/landscapist/build.gradle.kts @@ -15,6 +15,8 @@ */ import com.github.skydoves.landscapist.Configuration +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile plugins { id("landscapist.library.compose.multiplatformWasm") @@ -83,14 +85,9 @@ baselineProfile { } } -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += listOf( - "-Xexplicit-api=strict", - "-opt-in=kotlin.RequiresOptIn", - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-opt-in=com.skydoves.landscapist.InternalLandscapistApi", - ) +tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + } }