From 247bad68378665428391e7813d8935f751baba35 Mon Sep 17 00:00:00 2001 From: Sven Jacobs Date: Mon, 20 May 2024 17:04:10 +0200 Subject: [PATCH] feat: update to Kotlin 2.0.0 RC3 --- app/build.gradle.kts | 9 +++++---- build.gradle.kts | 7 ++++--- buildSrc/build.gradle.kts | 3 ++- buildSrc/src/main/kotlin/android-library.gradle.kts | 10 +++++----- gradle/libs.versions.toml | 4 ++-- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c9a63c9f..cc808c7f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,6 +24,7 @@ plugins { id("com.android.application") kotlin("android") kotlin("plugin.parcelize") + id("org.jetbrains.kotlin.plugin.compose") id("com.mikepenz.aboutlibraries.plugin") alias(libs.plugins.triplet.play) } @@ -93,10 +94,6 @@ android { buildConfig = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get() - } - testOptions { unitTests.all { it.useJUnitPlatform() @@ -112,6 +109,10 @@ android { } } +composeCompiler { + enableStrongSkippingMode = true +} + play { serviceAccountCredentials.set(rootProject.file("google-play-service-account.json")) defaultToAppBundles.set(true) diff --git a/build.gradle.kts b/build.gradle.kts index 6e9de55f..2f04c664 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ /* * Léon - The URL Cleaner - * Copyright (C) 2023 Sven Jacobs + * Copyright (C) 2024 Sven Jacobs * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ buildscript { dependencies { classpath(libs.android.gradle.plugin) classpath(libs.kotlin.gradle.plugin) + classpath(libs.compose.gradle.plugin) classpath(libs.mikepenz.aboutlibraries.gradle.plugin) } } @@ -58,8 +59,8 @@ subprojects { } tasks.withType().configureEach { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf( + compilerOptions { + freeCompilerArgs.addAll( "-opt-in=kotlin.RequiresOptIn", "-opt-in=androidx.lifecycle.compose.ExperimentalLifecycleComposeApi", "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index fe0f3eda..6f67cf24 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,6 +1,6 @@ /* * Léon - The URL Cleaner - * Copyright (C) 2022 Sven Jacobs + * Copyright (C) 2024 Sven Jacobs * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,4 +28,5 @@ repositories { dependencies { implementation(libs.kotlin.gradle.plugin) implementation(libs.android.gradle.plugin) + implementation(libs.compose.gradle.plugin) } diff --git a/buildSrc/src/main/kotlin/android-library.gradle.kts b/buildSrc/src/main/kotlin/android-library.gradle.kts index d4d04052..f1b8ff90 100644 --- a/buildSrc/src/main/kotlin/android-library.gradle.kts +++ b/buildSrc/src/main/kotlin/android-library.gradle.kts @@ -24,6 +24,7 @@ val libs: VersionCatalog = catalogs.named("libs") plugins { id("com.android.library") kotlin("android") + id("org.jetbrains.kotlin.plugin.compose") } android { @@ -47,11 +48,6 @@ android { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = - libs.findVersion("androidx.compose.compiler").get().requiredVersion - } - testOptions { unitTests.all { it.useJUnitPlatform() @@ -59,6 +55,10 @@ android { } } +composeCompiler { + enableStrongSkippingMode = true +} + dependencies { api(project(":core-common")) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 82709cfe..1bb1da55 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,11 +2,10 @@ android-gradle-plugin = "8.4.0" androidx-activity = "1.9.0" androidx-compose-bom = "2024.05.00" # https://developer.android.com/jetpack/compose/bom/bom-mapping -androidx-compose-compiler = "1.5.14" # https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility androidx-lifecycle = "2.8.0" google-accompanist = "0.34.0" kotest = "5.9.0" -kotlin = "1.9.24" +kotlin = "2.0.0-RC3" kotlinx-coroutines = "1.8.1" mikepenz-aboutlibraries = "11.1.4" @@ -38,6 +37,7 @@ kotest-framework-api-jvm = { module = "io.kotest:kotest-framework-api-jvm", vers kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" } kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +compose-gradle-plugin = { module = "org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin", version.ref = "kotlin" } kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" } kotlinx-collections-immutable = "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7" kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }