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 #3189

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Java class files
*.class

# Kotlin files
.kotlin/

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

id(libs.plugins.aboutLibraries.get().pluginId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package com.wire.android.ui.home.conversations.details.editguestaccess

import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -74,6 +75,7 @@ private fun CreateInviteLinkSheetItem(
)
}

@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
fun PreviewCreateGuestLinkBottomSheet() {
Expand All @@ -84,6 +86,7 @@ fun PreviewCreateGuestLinkBottomSheet() {
)
}

@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
fun PreviewCreateGuestLinkBottomSheetDisabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package com.wire.android.ui.settings.devices.e2ei

import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -86,6 +87,7 @@ private fun CreateCertificateSheetItem(
)
}

@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
fun PreviewE2eiCertificateDetailsBottomSheet() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("org.jetbrains.kotlin.plugin.compose")
}

extensions.configure<ApplicationExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.android")
apply("org.jetbrains.kotlin.plugin.compose")
}

extensions.configure<LibraryExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package com.wire.android.gradle

import com.android.build.api.dsl.CommonExtension
import findVersion
import org.gradle.api.Project

internal fun Project.configureCompose(
Expand All @@ -27,8 +26,4 @@ internal fun Project.configureCompose(
buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = findVersion("compose.compiler").requiredVersion
}
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ allprojects {
plugins {
id(ScriptPlugins.infrastructure)
alias(libs.plugins.ksp) apply false // https://github.com/google/dagger/issues/3965
alias(libs.plugins.compose.compiler) apply false
}

8 changes: 8 additions & 0 deletions buildSrc/src/main/kotlin/scripts/quality.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,11 @@ tasks.register("testCoverage") {
description = "Reports code coverage on tests within the Wire Android codebase."
dependsOn("koverXmlReport")
}

//configurations.matching { it.name == "detekt" }.all {
// resolutionStrategy.eachDependency {
// if (requested.group == "org.jetbrains.kotlin") {
// useVersion("1.9.23")
// }
// }
//}
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gradle = "8.8"

# Kotlin
grgitCore = "5.2.2"
kotlin = "1.9.23"
kotlin = "2.0.21"

# KotlinX
coroutines = "1.8.0"
Expand All @@ -14,7 +14,7 @@ ktx-immutableCollections = "0.3.8"
ktx-serialization = "1.6.3"

# Android Core / Architecture
detekt = "1.23.6"
detekt = "1.23.7"
google-gms = "4.4.2"
gms-location = "21.3.0"
android-gradlePlugin = "8.5.2"
Expand Down Expand Up @@ -48,7 +48,6 @@ compose-qr = "1.0.1"
# Compose
composeBom = "2024.10.00"
compose-activity = "1.9.2"
compose-compiler = "1.5.13"
compose-constraint = "1.0.1"
compose-navigation = "2.7.7" # adjusted to work with compose-destinations "1.9.54"
compose-destinations = "1.10.2"
Expand Down Expand Up @@ -84,7 +83,7 @@ openIdAppAuth = "0.11.1"
# Other Tools
aboutLibraries = "11.1.4"
leakCanary = "2.14"
ksp = "1.9.23-1.0.20"
ksp = "2.0.21-1.0.25"

# Benchmark
benchmark-macro-junit4 = "1.3.0"
Expand All @@ -110,6 +109,7 @@ hamcrest = "2.2"

[plugins]
# 3rd Party plugins
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "android-gradlePlugin" }
android-application = { id = "com.android.application", version.ref = "android-gradlePlugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
Expand Down
Loading