From 7619c42eaf6ed24889ca9aec0da1fb11cf61f662 Mon Sep 17 00:00:00 2001 From: MR3Y Date: Mon, 1 Jul 2024 02:52:03 +0300 Subject: [PATCH] Suppress deprecation warnings & opt in for experimental APIs --- app/build.gradle.kts | 14 ++++++++++++++ .../kotlin/com/mr3y/podcaster/gradle/Kotlin.kt | 9 --------- core/data/build.gradle.kts | 10 ++++++++++ .../com/mr3y/podcaster/core/local/Mappers.kt | 1 + .../mr3y/podcaster/core/local/dao/PodcastsDao.kt | 1 + .../com/mr3y/podcaster/core/model/Episode.kt | 1 + core/network/build.gradle.kts | 11 +++++++++++ core/opml/build.gradle.kts | 11 +++++++++++ core/sync/build.gradle.kts | 10 ++++++++++ ui/design-system/build.gradle.kts | 12 ++++++++++++ 10 files changed, 71 insertions(+), 9 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6c2871d2..1e9f95ee 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -93,6 +93,20 @@ play { } } +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", + "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", + "-opt-in=coil3.annotation.ExperimentalCoilApi", + ) + ) + } +} + hilt { enableAggregatingTask = true } diff --git a/convention-plugins/plugins/src/main/kotlin/com/mr3y/podcaster/gradle/Kotlin.kt b/convention-plugins/plugins/src/main/kotlin/com/mr3y/podcaster/gradle/Kotlin.kt index 6308c72f..fe961139 100644 --- a/convention-plugins/plugins/src/main/kotlin/com/mr3y/podcaster/gradle/Kotlin.kt +++ b/convention-plugins/plugins/src/main/kotlin/com/mr3y/podcaster/gradle/Kotlin.kt @@ -9,15 +9,6 @@ fun Project.configureKotlin() { tasks.withType().configureEach { compilerOptions { jvmTarget.set(JvmTarget.JVM_17) - freeCompilerArgs.addAll( - listOf( - "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", - "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", - "-opt-in=coil3.annotation.ExperimentalCoilApi", - ) - ) } } } diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index 0c0e7294..8757c1af 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -7,6 +7,16 @@ android { namespace = "com.mr3y.podcaster.core.data" } +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + ) + ) + } +} + dependencies { ksp(libs.hilt.compiler) diff --git a/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/Mappers.kt b/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/Mappers.kt index 880dd0b7..001b9ee9 100644 --- a/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/Mappers.kt +++ b/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/Mappers.kt @@ -128,6 +128,7 @@ fun Podcast.toPodcastEntity(): PodcastEntity { ) } +@Suppress("DEPRECATION") fun Episode.toEpisodeEntity(): EpisodeEntity { return EpisodeEntity( id, diff --git a/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/dao/PodcastsDao.kt b/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/dao/PodcastsDao.kt index 17b70213..9a372a98 100644 --- a/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/dao/PodcastsDao.kt +++ b/core/database/src/main/kotlin/com/mr3y/podcaster/core/local/dao/PodcastsDao.kt @@ -246,6 +246,7 @@ class DefaultPodcastsDao @Inject constructor( database.currentlyPlayingEntityQueries.updateCurrentlyPlayingEpisodeSpeed(newSpeed) } + @Suppress("DEPRECATION") override fun upsertEpisode(episode: Episode) { val queries = database.episodeEntityQueries queries.transaction { diff --git a/core/model/src/main/kotlin/com/mr3y/podcaster/core/model/Episode.kt b/core/model/src/main/kotlin/com/mr3y/podcaster/core/model/Episode.kt index afe48981..1d9b57b6 100644 --- a/core/model/src/main/kotlin/com/mr3y/podcaster/core/model/Episode.kt +++ b/core/model/src/main/kotlin/com/mr3y/podcaster/core/model/Episode.kt @@ -22,6 +22,7 @@ data class Episode( val isCompleted: Boolean = false, val progressInSec: Int? = null, ) { + @Suppress("DEPRECATION") override fun toString(): String { return "\nEpisode(\n" + "id = ${id}L,\n" + diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index 16ff0e03..53ccc19f 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -21,6 +21,17 @@ android { } } +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + ) + ) + } +} + fun getValueOfKey(key: String): String { return if (System.getenv("CI").toBoolean()) { System.getenv(key) diff --git a/core/opml/build.gradle.kts b/core/opml/build.gradle.kts index 25489cc1..5059073d 100644 --- a/core/opml/build.gradle.kts +++ b/core/opml/build.gradle.kts @@ -8,6 +8,17 @@ android { namespace = "com.mr3y.podcaster.core.opml" } +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + ) + ) + } +} + dependencies { implementation(projects.core.model) diff --git a/core/sync/build.gradle.kts b/core/sync/build.gradle.kts index cab6e513..fbb0a5f1 100644 --- a/core/sync/build.gradle.kts +++ b/core/sync/build.gradle.kts @@ -7,6 +7,16 @@ android { namespace = "com.mr3y.podcaster.core.sync" } +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + ) + ) + } +} + dependencies { implementation(projects.core.model) implementation(projects.core.data) diff --git a/ui/design-system/build.gradle.kts b/ui/design-system/build.gradle.kts index aa5c59e0..c3417a39 100644 --- a/ui/design-system/build.gradle.kts +++ b/ui/design-system/build.gradle.kts @@ -6,6 +6,18 @@ android { namespace = "com.mr3y.podcaster.ui" } +kotlin { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", + "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", + "-opt-in=coil3.annotation.ExperimentalCoilApi", + ) + ) + } +} + dependencies { implementation(platform(libs.compose.bom)) implementation(libs.bundles.compose)