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

View file

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

View file

@ -1,16 +1,16 @@
[versions]
compose = "1.6.7"
compose-compiler = "1.5.14"
compose-bom = "2024.06.00"
[libraries]
animation = { module = "androidx.compose.animation:animation", version.ref = "compose" }
foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
animation = { module = "androidx.compose.animation:animation" }
foundation = { module = "androidx.compose.foundation:foundation" }
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" }
ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" }
ui = { module = "androidx.compose.ui:ui" }
ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
icons = { module = "androidx.compose.material:material-icons-extended" }
[bundles]
compose = [ "animation", "foundation", "material3", "material-motion", "ui", "ui-tooling-preview", "icons" ]

View file

@ -1,10 +1,11 @@
[versions]
kotlin = "1.9.24"
serialization = "1.6.2"
kotlin = "2.0.0"
serialization = "1.6.3"
xml_serialization = "0.86.3"
[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-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" }
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test" }
@ -26,3 +27,4 @@ coroutines = [ "coroutines-android", "coroutines-core" ]
[plugins]
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 {
kotlin("multiplatform")
id("com.android.library")
@ -36,8 +38,8 @@ tasks {
// dependsOn(localesConfigTask)
// }
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
withType<KotlinCompile> {
compilerOptions.freeCompilerArgs.addAll(
"-Xexpect-actual-classes",
)
}

View file

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

View file

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