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 1 commit
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
Prev Previous commit
Next Next commit
chore: prepare for 2.0.0
  • Loading branch information
vitorhugods committed Jul 17, 2024
commit 5c4f9e7fefb1809870f9dfce2c37bba28e82df97
1 change: 0 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 Down
8 changes: 8 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ repositories {
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 {
implementation(libs.kotlin.plugin)
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${libs.versions.dokka.get()}")
Expand Down
14 changes: 11 additions & 3 deletions buildSrc/src/main/kotlin/scripts/detekt.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ dependencies {
detekt("io.gitlab.arturbosch.detekt:detekt-cli:$detektVersion")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-libraries:$detektVersion")
detektPlugins("com.wire:detekt-rules:2.0.0-main-SNAPSHOT") {
detektPlugins("com.wire:detekt-rules:1.0.0-1.23.6") {
isChanging = true
}
}

detekt {
buildUponDefaultConfig = true
// activate all available (even unstable) rules.
allRules = false
// allRules = false
config.setFrom(files("$rootDir/detekt/detekt.yml"))
source.setFrom(files("$rootDir"))
// a way of suppressing issues before introducing detekt
baseline = file("$rootDir/detekt/baseline.xml")

// dynamic prop to enable and disable autocorrect, enabled locally via local.properties file
val autoFixEnabled = getLocalProperty("detektAutofix", "false")
autoCorrect.set(autoFixEnabled.toBoolean())
autoCorrect = autoFixEnabled.toBoolean()
println("> Detekt autoCorrect: $autoFixEnabled")
}

Expand All @@ -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")
}
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,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 = "main-SNAPSHOT"
detekt = "1.23.6"
agp = "8.3.2"
dokka = "1.8.20"
carthage = "0.0.1"
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
Loading