Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to kotlin 2.0 [WPB-8645] #2884

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ native/
# Java class files
*.class

# Kotlin files
.kotlin/

# Generated files
bin/
gen/
Expand Down
1 change: 1 addition & 0 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
alias(libs.plugins.compose.compiler)
}

android {
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ buildscript {
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${libs.versions.dokka.get()}")
classpath("com.google.protobuf:protobuf-gradle-plugin:${libs.versions.protobufCodegen.get()}")
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${libs.versions.detekt.get()}")
classpath("io.gitlab.arturbosch.detekt:detekt-cli:${libs.versions.detekt.get()}")
classpath("io.github.leandroborgesferreira:dag-command:${libs.versions.dagCommand.get()}")
}
}
Expand All @@ -43,6 +42,7 @@ repositories {
wireDetektRulesRepo()
google()
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}

plugins {
Expand All @@ -52,6 +52,7 @@ plugins {
id("scripts.detekt")
alias(libs.plugins.moduleGraph)
alias(libs.plugins.completeKotlin)
alias(libs.plugins.compose.compiler) apply false
}

dependencies {
Expand Down
9 changes: 9 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ plugins {
repositories {
google()
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}

configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
useVersion(libs.versions.kotlin.get())
}
}
}

dependencies {
Expand Down
8 changes: 8 additions & 0 deletions buildSrc/src/main/kotlin/scripts/detekt.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ tasks.withType<Detekt> {
"**/protobuf/**",
)
}

// configurations.matching { it.name == "detekt" }.all {
// resolutionStrategy.eachDependency {
// if (requested.group == "org.jetbrains.kotlin") {
// useVersion("1.9.23")
// }
// }
// }
9 changes: 5 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "1.9.23"
kotlin = "2.0.10"
activity-compose = "1.9.0"
app-compat = "1.6.1"
android-paging3 = "3.2.1"
Expand Down Expand Up @@ -43,8 +43,8 @@ core-crypto-multiplatform = "0.6.0-rc.3-multiplatform-pre1"
completeKotlin = "1.1.0"
desugar-jdk = "2.0.4"
kermit = "2.0.3"
detekt = "1.23.6"
agp = "8.3.2"
detekt = "1.23.7"
agp = "8.5.2"
dokka = "1.8.20"
carthage = "0.0.1"
libsodiumBindings = "0.8.7"
Expand Down Expand Up @@ -74,12 +74,13 @@ kalium-library = { id = "kalium.library" }
android-library = { id = "com.android.library", version.ref = "agp" }
android-application = { id = "com.android.application", version.ref = "agp" }
completeKotlin = { id = "com.louiscad.complete-kotlin", version.ref = "completeKotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
moduleGraph = { id = "dev.iurysouza.modulegraph", version.ref = "moduleGraph" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
ksp = { id = "com.google.devtools.ksp", version = "1.9.23-1.0.20" }
ksp = { id = "com.google.devtools.ksp", version = "2.0.10-1.0.24" }
carthage = { id = "com.wire.carthage-gradle-plugin", version.ref = "carthage" }
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
protobuf = { id = "com.google.protobuf", version.ref = "protobufCodegen" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal actual class UserSessionScopeProviderImpl(
private val networkStateObserver: NetworkStateObserver,
private val logoutCallback: LogoutCallback,
userAgent: String
) : UserSessionScopeProviderCommon(globalCallManager, userStorageProvider, userAgent) {
) : UserSessionScopeProviderCommon(globalCallManager, userStorageProvider, userAgent), UserSessionScopeProvider {

override fun create(userId: UserId): UserSessionScope {
val userIdEntity = userId.toDao()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ abstract class UserSessionScopeProviderCommon(
abstract fun create(userId: UserId): UserSessionScope
}

internal expect class UserSessionScopeProviderImpl : UserSessionScopeProviderCommon
internal expect class UserSessionScopeProviderImpl : UserSessionScopeProvider
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ package com.wire.kalium.util

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainCoroutineDispatcher

actual object KaliumDispatcherImpl : KaliumDispatcher {
override val default: CoroutineDispatcher
get() = Dispatchers.Default
override val main: MainCoroutineDispatcher
override val main: CoroutineDispatcher
get() = Dispatchers.Main
override val unconfined: CoroutineDispatcher
get() = Dispatchers.Unconfined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ package com.wire.kalium.util

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainCoroutineDispatcher

actual object KaliumDispatcherImpl : KaliumDispatcher {
override val default: CoroutineDispatcher
get() = Dispatchers.Default
override val main: MainCoroutineDispatcher
override val main: CoroutineDispatcher
get() = Dispatchers.Main
override val unconfined: CoroutineDispatcher
get() = Dispatchers.Unconfined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ package com.wire.kalium.util

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainCoroutineDispatcher

actual object KaliumDispatcherImpl : KaliumDispatcher {
override val default: CoroutineDispatcher
get() = Dispatchers.Default
override val main: MainCoroutineDispatcher
override val main: CoroutineDispatcher
get() = Dispatchers.Main
override val unconfined: CoroutineDispatcher
get() = Dispatchers.Unconfined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ package com.wire.kalium.util

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainCoroutineDispatcher

actual object KaliumDispatcherImpl : KaliumDispatcher {
override val default: CoroutineDispatcher
get() = Dispatchers.Default
override val main: MainCoroutineDispatcher
override val main: CoroutineDispatcher
get() = Dispatchers.Main
override val unconfined: CoroutineDispatcher
get() = Dispatchers.Unconfined
Expand Down
Loading