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 9 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
5 changes: 1 addition & 4 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 All @@ -40,10 +41,6 @@ android {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}

buildTypes {
debug {}
release {}
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")
// }
// }
// }
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[versions]
kotlin = "1.9.23"
ksp = "1.9.23-1.0.20"
kotlin = "2.0.21"
ksp = "2.0.21-1.0.25"
activity-compose = "1.9.0"
app-compat = "1.6.1"
android-paging3 = "3.2.1"
cli-kt = "3.5.0"
coroutines = "1.8.0"
compose-compiler = "1.5.13"
compose-ui = "1.6.6"
compose-material = "1.6.6"
cryptobox4j = "1.4.0"
Expand Down Expand Up @@ -44,7 +43,7 @@ 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"
detekt = "1.23.7"
agp = "8.5.2"
dokka = "1.8.20"
carthage = "0.0.1"
Expand All @@ -53,7 +52,7 @@ protobufCodegen = "0.9.4"
annotation = "1.7.1"
mordant = "2.0.0-beta13"
apache-tika = "2.9.2"
mockk = "1.13.10"
mockk = "1.13.13"
faker = "1.16.0"
robolectric = "4.12.1"
stately = "2.0.7"
Expand All @@ -79,6 +78,7 @@ 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" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
carthage = { id = "com.wire.carthage-gradle-plugin", version.ref = "carthage" }
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