chore(deps): Kotlin 2.0

This commit is contained in:
Ahmad Ansori Palembani 2024-06-23 08:18:24 +07:00
parent 55813429b3
commit b29d51e30e
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
9 changed files with 40 additions and 33 deletions

View file

@ -34,3 +34,4 @@
- Migrated most of manga related queries - Migrated most of manga related queries
- Update Japenese translation - Update Japenese translation
- Update dependency com.github.tachiyomiorg:unifile to a9de196cc7 - Update dependency com.github.tachiyomiorg:unifile to a9de196cc7
- Update project to Kotlin 2.0

View file

@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.time.LocalDateTime import java.time.LocalDateTime
import java.time.ZoneOffset import java.time.ZoneOffset
@ -12,6 +13,7 @@ plugins {
id("com.google.android.gms.oss-licenses-plugin") id("com.google.android.gms.oss-licenses-plugin")
id("com.google.gms.google-services") apply false id("com.google.gms.google-services") apply false
id("com.google.firebase.crashlytics") apply false id("com.google.firebase.crashlytics") apply false
alias(kotlinx.plugins.compose.compiler)
} }
if (gradle.startParameter.taskRequests.toString().contains("Standard")) { if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
@ -135,10 +137,6 @@ android {
checkReleaseBuilds = false checkReleaseBuilds = false
} }
composeOptions {
kotlinCompilerExtensionVersion = compose.versions.compose.compiler.get()
}
namespace = "eu.kanade.tachiyomi" namespace = "eu.kanade.tachiyomi"
} }
@ -151,6 +149,7 @@ dependencies {
implementation(projects.sourceApi) implementation(projects.sourceApi)
// Compose // Compose
implementation(platform(compose.bom))
implementation(compose.bundles.compose) implementation(compose.bundles.compose)
debugImplementation(compose.ui.tooling) debugImplementation(compose.ui.tooling)
implementation(libs.compose.theme.adapter3) implementation(libs.compose.theme.adapter3)
@ -274,8 +273,8 @@ dependencies {
tasks { tasks {
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers) // See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf( compilerOptions.freeCompilerArgs.addAll(
"-Xcontext-receivers", "-Xcontext-receivers",
// "-opt-in=kotlin.Experimental", // "-opt-in=kotlin.Experimental",
"-opt-in=kotlin.RequiresOptIn", "-opt-in=kotlin.RequiresOptIn",
@ -298,12 +297,12 @@ tasks {
) )
if (project.findProperty("tachiyomi.enableComposeCompilerMetrics") == "true") { if (project.findProperty("tachiyomi.enableComposeCompilerMetrics") == "true") {
kotlinOptions.freeCompilerArgs += listOf( compilerOptions.freeCompilerArgs.addAll(
"-P", "-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
(project.layout.buildDirectory.asFile.orNull?.absolutePath ?: "/tmp/yokai") + "/compose_metrics", (project.layout.buildDirectory.asFile.orNull?.absolutePath ?: "/tmp/yokai") + "/compose_metrics",
) )
kotlinOptions.freeCompilerArgs += listOf( compilerOptions.freeCompilerArgs.addAll(
"-P", "-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
(project.layout.buildDirectory.asFile.orNull?.absolutePath ?: "/tmp/yokai") + "/compose_metrics", (project.layout.buildDirectory.asFile.orNull?.absolutePath ?: "/tmp/yokai") + "/compose_metrics",

View file

@ -1,13 +1,15 @@
import com.android.build.gradle.BaseExtension import com.android.build.gradle.BaseExtension
import com.android.build.gradle.BasePlugin import com.android.build.gradle.BasePlugin
import org.gradle.api.tasks.testing.logging.TestLogEvent import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.* import java.util.*
plugins { plugins {
alias(libs.plugins.kotlinter) alias(libs.plugins.kotlinter)
alias(libs.plugins.gradle.versions) alias(libs.plugins.gradle.versions)
alias(kotlinx.plugins.android) apply false alias(kotlinx.plugins.android) apply false
alias(kotlinx.plugins.compose.compiler) apply false
} }
buildscript { buildscript {
@ -29,9 +31,9 @@ buildscript {
} }
subprojects { subprojects {
tasks.withType<KotlinJvmCompile> { tasks.withType<KotlinCompile> {
kotlinOptions { compilerOptions {
jvmTarget = JavaVersion.VERSION_17.toString() jvmTarget = JvmTarget.JVM_17
} }
} }

View file

@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
kotlin("plugin.serialization") kotlin("plugin.serialization")
@ -47,8 +49,8 @@ android {
} }
tasks { tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf( compilerOptions.freeCompilerArgs.addAll(
"-Xcontext-receivers", "-Xcontext-receivers",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi", "-opt-in=kotlinx.serialization.ExperimentalSerializationApi",

View file

@ -1,16 +1,16 @@
[versions] [versions]
compose = "1.6.7" compose-bom = "2024.06.00"
compose-compiler = "1.5.14"
[libraries] [libraries]
animation = { module = "androidx.compose.animation:animation", version.ref = "compose" } bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" } animation = { module = "androidx.compose.animation:animation" }
foundation = { module = "androidx.compose.foundation:foundation" }
material3 = { module = "androidx.compose.material3:material3", version = "1.3.0-beta02" } material3 = { module = "androidx.compose.material3:material3", version = "1.3.0-beta02" }
material-motion = { module = "io.github.fornewid:material-motion-compose-core", version = "1.0.7" } material-motion = { module = "io.github.fornewid:material-motion-compose-core", version = "1.0.7" }
ui = { module = "androidx.compose.ui:ui", version.ref = "compose" } ui = { module = "androidx.compose.ui:ui" }
ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" } icons = { module = "androidx.compose.material:material-icons-extended" }
[bundles] [bundles]
compose = [ "animation", "foundation", "material3", "material-motion", "ui", "ui-tooling-preview", "icons" ] compose = [ "animation", "foundation", "material3", "material-motion", "ui", "ui-tooling-preview", "icons" ]

View file

@ -1,10 +1,11 @@
[versions] [versions]
kotlin = "1.9.24" kotlin = "2.0.0"
serialization = "1.6.2" serialization = "1.6.3"
xml_serialization = "0.86.3" xml_serialization = "0.86.3"
[libraries] [libraries]
coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version = "1.8.0" } compose-compiler-gradle = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }
coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version = "1.8.1" }
coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android" } coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android" }
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" } coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" }
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test" } coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test" }
@ -26,3 +27,4 @@ coroutines = [ "coroutines-android", "coroutines-core" ]
[plugins] [plugins]
android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

View file

@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("com.android.library") id("com.android.library")
@ -36,8 +38,8 @@ tasks {
// dependsOn(localesConfigTask) // dependsOn(localesConfigTask)
// } // }
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf( compilerOptions.freeCompilerArgs.addAll(
"-Xexpect-actual-classes", "-Xexpect-actual-classes",
) )
} }

View file

@ -1,6 +1,7 @@
plugins { plugins {
id("com.android.library") id("com.android.library")
id("org.jetbrains.kotlin.android") id("org.jetbrains.kotlin.android")
alias(kotlinx.plugins.compose.compiler)
} }
android { android {
@ -14,10 +15,6 @@ android {
buildFeatures { buildFeatures {
compose = true compose = true
} }
composeOptions {
kotlinCompilerExtensionVersion = compose.versions.compose.compiler.get()
}
} }
dependencies { dependencies {

View file

@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
kotlin("plugin.serialization") kotlin("plugin.serialization")
@ -34,8 +36,8 @@ android {
} }
} }
tasks { tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf( compilerOptions.freeCompilerArgs.addAll(
"-Xexpect-actual-classes", "-Xexpect-actual-classes",
) )
} }