Skip to content

Commit

Permalink
Add kotlinx-datetime and kotlinx-io, update kotlinx-atomicfu, kotlinx…
Browse files Browse the repository at this point in the history
…-serialization
  • Loading branch information
Him188 committed Jul 27, 2024
1 parent 65d0738 commit b283ba9
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 43 deletions.
2 changes: 1 addition & 1 deletion app/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
id("com.android.application")
kotlin("android")
kotlin("plugin.compose")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
id("kotlin-parcelize")
idea
}
Expand Down
2 changes: 1 addition & 1 deletion app/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {
kotlin("plugin.compose")
id("org.jetbrains.compose")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
idea
}

Expand Down
20 changes: 3 additions & 17 deletions app/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ plugins {
`flatten-source-sets`

kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
id("com.google.devtools.ksp")
id("androidx.room")
idea
Expand Down Expand Up @@ -73,6 +73,8 @@ kotlin {
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.serialization.json)
implementation(libs.atomicfu) // room runtime
api(libs.kotlinx.datetime)
api(libs.kotlinx.io.core)

// Compose
api(compose.foundation)
Expand Down Expand Up @@ -189,22 +191,6 @@ kotlin {

// https://repo1.maven.org/maven2/org/openjfx/javafx-graphics/17.0.11/
val os = getOs()
val classifier = when (os) {
Os.MacOS -> {
// check aarch
if (System.getProperty("os.arch").contains("aarch")) {
"mac-aarch64"
} else {
"mac"
}
}

Os.Windows -> "win"
Os.Linux -> "linux"
else -> {
null
}
}

runtimeOnly(libs.kotlinx.coroutines.debug)

Expand Down
2 changes: 1 addition & 1 deletion app/shared/image-viewer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
`flatten-source-sets`

kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
}

extra.set("ani.jvm.target", 17)
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ plugins {
kotlin("jvm") apply false
kotlin("plugin.serialization") version libs.versions.kotlin apply false
kotlin("plugin.compose") version libs.versions.kotlin apply false
id("org.jetbrains.kotlinx.atomicfu") apply false
id("org.jetbrains.compose") apply false
id("com.android.library") apply false
id("com.android.application") apply false
Expand Down
2 changes: 1 addition & 1 deletion ci-helper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import org.gradle.internal.impldep.com.amazonaws.services.s3.model.PutObjectRequ

plugins {
kotlin("jvm")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
}

val hostOS: OS by lazy {
Expand Down
2 changes: 1 addition & 1 deletion danmaku/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins {
id("org.jetbrains.compose")
id("com.android.library")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
}

extra.set("ani.jvm.target", 17)
Expand Down
2 changes: 1 addition & 1 deletion data-sources/bt/acg.rip/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/bt/dmhy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/bt/mikan/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/jellyfin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/web/gugufan/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/web/mxdongman/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/web/ntdm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/web/nyafun/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
2 changes: 1 addition & 1 deletion data-sources/web/web-base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.kotlinx.atomicfu")
`flatten-source-sets`
}

Expand Down
14 changes: 9 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ jna = "5.13.0"
kotlin = "2.0.0"
# kotlinx
coroutines = "1.8.1"
serialization = "1.6.3"
datetime = "0.6.0"
atomicfu = "0.23.2"
serialization = "1.7.1" # https://github.com/Kotlin/kotlinx.serialization/releases
datetime = "0.6.0" # https://github.com/Kotlin/kotlinx-datetime/releases
atomicfu = "0.25.0" # https://github.com/Kotlin/kotlinx-atomicfu/releases
kotlinx-io = "0.5.1" # https://github.com/Kotlin/kotlinx-io/releases
#
kotlinpoet = "1.16.0"
log4j-core = "2.20.0"
Expand Down Expand Up @@ -57,18 +58,21 @@ compose-multiplatfrom-gradle-plugin = { module = "org.jetbrains.compose:org.jetb

# Kotlinx
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" }
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kotlinx-io" }
kotlinx-io-bytestring = { module = "org.jetbrains.kotlinx:kotlinx-io-bytestring", version.ref = "kotlinx-io" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" }
kotlinx-coroutines-debug = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-debug", version.ref = "coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialization" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
kotlinx-serialization-json-io = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-io", version.ref = "serialization" }
atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "atomicfu" }
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version = "0.3.2" }
#kotlinx-serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization" }

kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }

# Ktor
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
Expand Down
7 changes: 0 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ pluginManagement {
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") // Compose Multiplatform pre-release versions
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "kotlinx-atomicfu") { // atomicfu is not on Gradle Plugin Portal
useModule("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${requested.version}")
}
}
}
}

plugins {
Expand Down
3 changes: 3 additions & 0 deletions utils/serialization/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

/*
* Ani
* Copyright (C) 2022-2024 Him188
Expand Down Expand Up @@ -28,5 +30,6 @@ dependencies {
}

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
}

0 comments on commit b283ba9

Please sign in to comment.