Skip to content

Commit

Permalink
Suppress deprecation warnings & opt in for experimental APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
mr3y-the-programmer committed Jun 30, 2024
1 parent 6dfd61e commit 7619c42
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 9 deletions.
14 changes: 14 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ fun Project.configureKotlin() {
tasks.withType<KotlinCompile>().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",
)
)
}
}
}
10 changes: 10 additions & 0 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ fun Podcast.toPodcastEntity(): PodcastEntity {
)
}

@Suppress("DEPRECATION")
fun Episode.toEpisodeEntity(): EpisodeEntity {
return EpisodeEntity(
id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand Down
11 changes: 11 additions & 0 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions core/opml/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions core/sync/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions ui/design-system/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7619c42

Please sign in to comment.