Skip to content

Commit

Permalink
update to K2
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed May 26, 2024
1 parent 054f298 commit 6559e51
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 203 deletions.
8 changes: 2 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.cocoapods) apply false
alias(libs.plugins.compose) apply false
// alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.crashlytics) apply false
alias(libs.plugins.konfig) apply false
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.moko.resources) apply false
alias(libs.plugins.sekret) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.complete.kotlin) // Disable for K2 or bump version
// alias(libs.plugins.complete.kotlin) // Disable for K2 or bump version
alias(libs.plugins.versions)
}

Expand Down Expand Up @@ -55,10 +55,6 @@ allprojects {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(CompileOptions.jvmTargetString))
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:experimentalStrongSkipping=true"
)
}
}
plugins.withType<YarnPlugin> {
Expand Down
7 changes: 6 additions & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
alias(libs.plugins.multiplatform)
alias(libs.plugins.android.application)
alias(libs.plugins.compose)
// alias(libs.plugins.compose.compiler)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.konfig)
alias(libs.plugins.moko.resources)
alias(libs.plugins.sekret)
Expand Down Expand Up @@ -54,6 +54,11 @@ sekret {
}
}

composeCompiler {
enableStrongSkippingMode.set(true)
enableNonSkippingGroupOptimization.set(true)
}

kotlin {
androidTarget()

Expand Down
20 changes: 10 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ coil = "3.0.0-alpha06"
compose = "1.6.10"
complete-kotlin = "1.1.0"
coroutines = "1.8.1"
crashlytics-plugin = "2.9.9"
crashlytics-plugin = "3.0.1"
datastore = "1.1.1"
datetime = "0.6.0-RC.2"
decompose = "3.0.0"
desugar = "2.0.4"
firebase = "1.11.1"
firebase-android = "20.4.3"
firebase-android-analytics = "21.6.2"
firebase-android-auth = "22.3.1"
firebase-android-crashlytics = "18.6.4"
firebase = "1.12.0"
firebase-android = "21.0.0"
firebase-android-analytics = "22.0.0"
firebase-android-auth = "23.0.0"
firebase-android-crashlytics = "19.0.0"
flowredux = "1.2.1"
google-identity = "1.1.0"
haze = "0.7.1"
Expand All @@ -35,15 +35,15 @@ kmpalette = "3.1.0"
kodein = "7.22.0"
kolor = "1.6.0"
konfig = "0.15.1"
kotlin = "1.9.23" # K2 requires GitLive Firebase bump
ksp = "1.9.23-1.0.20"
kotlin = "2.0.0" # K2 requires GitLive Firebase bump
ksp = "2.0.0-1.0.21"
ktor = "2.3.11"
ktorfit = "1.13.0"
ktorfit = "1.14.0"
markdown-renderer = "0.16.0"
moko-resources = "0.24.0-beta-4"
multidex = "2.0.1"
napier = "2.7.1"
sekret = "2.0.0-alpha-04"
sekret = "2.0.0-alpha-05"
serialization = "1.6.3"
splashscreen = "1.0.1"
tooling = "1.4.0"
Expand Down
180 changes: 0 additions & 180 deletions model/src/commonMain/kotlin/dev/datlag/aniflow/model/CatchResult.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.datlag.aniflow.nekos

import dev.datlag.aniflow.model.CatchResult
import dev.datlag.aniflow.nekos.model.ImagesResponse
import dev.datlag.aniflow.nekos.model.Rating
import dev.datlag.tooling.async.suspendCatching
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
Expand All @@ -17,13 +17,13 @@ class NekosRepository(

@OptIn(ExperimentalCoroutinesApi::class)
private val result = rating.mapLatest {
CatchResult.repeat(2) {
suspendCatching {
nekos.images(
rating = it.query
)
}
}.mapLatest {
State.fromResponse(it.asNullableSuccess())
State.fromResponse(it.getOrNull())
}
val response = combine(nsfw.distinctUntilChanged(), result, rating) { n, q, r ->
if (n) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.datlag.aniflow.trace

import dev.datlag.aniflow.model.CatchResult
import dev.datlag.aniflow.trace.model.SearchResponse
import dev.datlag.tooling.async.suspendCatching
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import kotlinx.serialization.Serializable
Expand All @@ -22,9 +22,9 @@ class TraceRepository(
} else {
emit(
State.fromResponse(
response = CatchResult.repeat(2) {
response = suspendCatching {
trace.search(t1)
}.asNullableSuccess(),
}.getOrNull(),
nsfw = t2
)
)
Expand Down

0 comments on commit 6559e51

Please sign in to comment.