From a38178bedd069b54fa9e61482a2e7184d7884635 Mon Sep 17 00:00:00 2001 From: Andrei Beriukhov Date: Fri, 6 Mar 2026 17:05:51 +0200 Subject: [PATCH 1/6] first part --- app/build.gradle.kts | 2 +- gradle.properties | 10 ++++++++++ gradle/libs.versions.toml | 4 +--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2a50cc7..16403d8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -12,7 +12,7 @@ plugins { kotlin("plugin.serialization") id("org.jetbrains.kotlin.plugin.compose") id("com.google.protobuf") - id("com.github.triplet.play") version "3.12.2" + id("com.github.triplet.play") version "4.0.0" id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") id("com.android.compose.screenshot") } diff --git a/gradle.properties b/gradle.properties index bf8d9bf..62cba61 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,3 +27,13 @@ kotlin.incremental.wasm=true # kotlin.native.cacheKind=none org.jetbrains.compose.experimental.jscanvas.enabled=true +#android.defaults.buildfeatures.resvalues=true +#android.sdk.defaultTargetSdkToCompileSdkIfUnset=false +#android.enableAppCompileTimeRClass=false +#android.usesSdkInManifest.disallowed=false +#android.uniquePackageNames=false +#android.dependency.useConstraints=true +#android.r8.strictFullModeForKeepRules=false +#android.r8.optimizedResourceShrinking=false +android.builtInKotlin=false +android.newDsl=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3598235..4ca24c1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,7 @@ compose = "1.10.4" # https://developer.android.com/jetpack/androidx/releases/com jetbrainsCompose = "1.10.2" # https://github.com/JetBrains/compose-multiplatform/releases hotReload = "1.0.0" # https://github.com/JetBrains/compose-hot-reload/releases -agp = "8.13.2" # https://developer.android.com/studio/releases/gradle-plugin +agp = "9.0.1" # https://developer.android.com/studio/releases/gradle-plugin ktor = "3.4.0" # https://github.com/ktorio/ktor androidxRoom = "2.8.4" # https://developer.android.com/jetpack/androidx/releases/room sqlite = "2.6.2" # https://developer.android.com/jetpack/androidx/releases/sqlite @@ -76,8 +76,6 @@ ktor-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor" } ktor-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } ktor-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" } -compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" } -compose-material3 = "androidx.compose.material3:material3:1.4.0" # https://developer.android.com/jetpack/androidx/releases/compose-material3 compose-uiTooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } compose-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } compose-icons-core = "androidx.compose.material:material-icons-core:1.7.8" From cdf5ada3b9d3d29b404d4c70c86cb1360d36da7e Mon Sep 17 00:00:00 2001 From: Andrei Beriukhov Date: Fri, 6 Mar 2026 17:35:54 +0200 Subject: [PATCH 2/6] cleaning --- gradle.properties | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/gradle.properties b/gradle.properties index 62cba61..744ffb0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,34 +6,14 @@ org.gradle.configuration-cache=true org.gradle.daemon=true org.gradle.parallel=true -#kotlin.native.binary.memoryModel=experimental -#kotlin.mpp.androidSourceSetLayoutVersion=2 android.nonTransitiveRClass=true android.nonFinalResIds=false -#kotlin.native.useEmbeddableCompilerJar=true - -# also needed for ios build -#compose.desktop.verbose=true - -#org.jetbrains.compose.experimental.uikit.enabled=true -#kotlin.mpp.enableCInteropCommonization=true android.experimental.enableScreenshotTest=true kotlin.native.binary.gc=cms kotlin.incremental.wasm=true -#org.jetbrains.compose.experimental.wasm.enabled=true -# kotlin.native.cacheKind=none - org.jetbrains.compose.experimental.jscanvas.enabled=true -#android.defaults.buildfeatures.resvalues=true -#android.sdk.defaultTargetSdkToCompileSdkIfUnset=false -#android.enableAppCompileTimeRClass=false -#android.usesSdkInManifest.disallowed=false -#android.uniquePackageNames=false -#android.dependency.useConstraints=true -#android.r8.strictFullModeForKeepRules=false -#android.r8.optimizedResourceShrinking=false android.builtInKotlin=false android.newDsl=false From 8b2599c6444e2f9d005d07a1ea1c08fcf847496e Mon Sep 17 00:00:00 2001 From: Andrei Beriukhov Date: Fri, 6 Mar 2026 17:40:00 +0200 Subject: [PATCH 3/6] cleanup defaults --- gradle.properties | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/gradle.properties b/gradle.properties index 744ffb0..78884c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,19 +1,13 @@ org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 -XX:+UseParallelGC -android.useAndroidX=true -kotlin.code.style=official org.gradle.caching=true org.gradle.configuration-cache=true -org.gradle.daemon=true org.gradle.parallel=true -android.nonTransitiveRClass=true -android.nonFinalResIds=false - android.experimental.enableScreenshotTest=true +android.nonFinalResIds=false +android.builtInKotlin=false +android.newDsl=false kotlin.native.binary.gc=cms kotlin.incremental.wasm=true - org.jetbrains.compose.experimental.jscanvas.enabled=true -android.builtInKotlin=false -android.newDsl=false From fcd07dabd13f5103dfc01c441deaa5e5c4f33db1 Mon Sep 17 00:00:00 2001 From: Andrei Beriukhov Date: Fri, 6 Mar 2026 17:56:16 +0200 Subject: [PATCH 4/6] protobuf disabled --- app/build.gradle.kts | 29 +++++++++---------- .../repository/ThemeDataStoreProtoStorage.kt | 2 ++ .../repository/ThemePreferencesSerializer.kt | 2 ++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 16403d8..03bc097 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,7 +11,6 @@ plugins { kotlin("android") kotlin("plugin.serialization") id("org.jetbrains.kotlin.plugin.compose") - id("com.google.protobuf") id("com.github.triplet.play") version "4.0.0" id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") id("com.android.compose.screenshot") @@ -148,20 +147,20 @@ dependencies { testRuntimeOnly(libs.kotlin.test.junit) } -protobuf { - protoc { - artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}" - } - generateProtoTasks { - all().forEach { task -> - task.builtins { - id("java") { - option("lite") - } - } - } - } -} +//protobuf { +// protoc { +// artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}" +// } +// generateProtoTasks { +// all().forEach { task -> +// task.builtins { +// id("java") { +// option("lite") +// } +// } +// } +// } +//} object KeyHelper { diff --git a/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemeDataStoreProtoStorage.kt b/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemeDataStoreProtoStorage.kt index e9b9dd4..3b57291 100644 --- a/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemeDataStoreProtoStorage.kt +++ b/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemeDataStoreProtoStorage.kt @@ -1,3 +1,4 @@ +/* package ru.beryukhov.coffeegram.repository import android.content.Context @@ -83,3 +84,4 @@ private fun ProtoThemeState?.mapOrNull(): DarkThemeState? { if (this == null) return null return DarkThemeState.valueOf(this.name) } +*/ diff --git a/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemePreferencesSerializer.kt b/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemePreferencesSerializer.kt index 850e3e9..7f66e9a 100644 --- a/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemePreferencesSerializer.kt +++ b/app/src/main/java/ru/beryukhov/coffeegram/repository/ThemePreferencesSerializer.kt @@ -1,3 +1,4 @@ +/* package ru.beryukhov.coffeegram.repository import androidx.datastore.core.CorruptionException @@ -22,3 +23,4 @@ object ThemePreferencesSerializer : Serializer { t.writeTo(output) } } +*/ From 226c20b13cd809a47f5903335a1a2a15cc7a0820 Mon Sep 17 00:00:00 2001 From: Andrei Beriukhov Date: Fri, 6 Mar 2026 18:24:47 +0200 Subject: [PATCH 5/6] newdsl = true --- app/build.gradle.kts | 5 ++-- build.gradle.kts | 2 +- cmp-common/build.gradle.kts | 38 +++++++++----------------- date-time-utils/build.gradle.kts | 27 ++++-------------- gradle.properties | 4 +-- repository-room/build.gradle.kts | 20 ++++---------- repository-sqldelight/build.gradle.kts | 22 ++++----------- repository/build.gradle.kts | 22 ++++----------- wear/build.gradle.kts | 1 - 9 files changed, 42 insertions(+), 99 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 03bc097..486d753 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,5 @@ -import com.google.protobuf.gradle.id -import com.google.protobuf.gradle.protobuf +//import com.google.protobuf.gradle.id +//import com.google.protobuf.gradle.protobuf import java.io.File import java.io.FileInputStream import java.time.Instant @@ -8,7 +8,6 @@ import java.util.Properties plugins { id("com.android.application") id("com.autonomousapps.dependency-analysis") - kotlin("android") kotlin("plugin.serialization") id("org.jetbrains.kotlin.plugin.compose") id("com.github.triplet.play") version "4.0.0" diff --git a/build.gradle.kts b/build.gradle.kts index 85266e8..10cfe96 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,7 +20,7 @@ buildscript { classpath(libs.serializationGradle) classpath(libs.sqldelightGradle) classpath(libs.composeKotlinGradle) - classpath(libs.protobufGradle) +// classpath(libs.protobufGradle) classpath(libs.secretsGradle) classpath(libs.screenshotGradle) classpath(libs.hotReloadGradle) diff --git a/cmp-common/build.gradle.kts b/cmp-common/build.gradle.kts index 1a5990e..719515d 100644 --- a/cmp-common/build.gradle.kts +++ b/cmp-common/build.gradle.kts @@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { kotlin("multiplatform") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") // id("com.autonomousapps.dependency-analysis") kotlin("native.cocoapods") id("org.jetbrains.compose") @@ -15,7 +15,13 @@ plugins { } kotlin { - androidTarget() + android { + namespace = "ru.beryukhov.compose_common" + compileSdk = libs.versions.compileSdk.get().toInt() + minSdk = libs.versions.minSdk.get().toInt() + androidResources.enable = true + } + jvm() iosX64() @@ -107,11 +113,11 @@ kotlin { // Wearable implementation(libs.playServices.wearable) } - val androidUnitTest by getting { - dependencies { - implementation(libs.kotlin.test.junit) - } - } +// val androidUnitTest by getting { +// dependencies { +// implementation(libs.kotlin.test.junit) +// } +// } jvmMain.dependencies { implementation(compose.desktop.currentOs) implementation(libs.ktor.java) @@ -139,24 +145,6 @@ kotlin { } } -android { - namespace = "ru.beryukhov.compose_common" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } - - kotlin { - jvmToolchain(21) - } -} - compose.desktop { application { mainClass = "Main_desktopKt" diff --git a/date-time-utils/build.gradle.kts b/date-time-utils/build.gradle.kts index d5c28c4..2d76260 100644 --- a/date-time-utils/build.gradle.kts +++ b/date-time-utils/build.gradle.kts @@ -2,14 +2,18 @@ import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl plugins { kotlin("multiplatform") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") id("com.autonomousapps.dependency-analysis") } version = "1.0" kotlin { - androidTarget() + android { + namespace = "ru.beryukhov.date_time_utils" + compileSdk = libs.versions.compileSdk.get().toInt() + minSdk = libs.versions.minSdk.get().toInt() + } jvm() @@ -36,24 +40,5 @@ kotlin { implementation(libs.kotlin.test) implementation(libs.kotlin.test.annotations) } - val androidUnitTest by getting { - dependencies { - implementation(libs.kotlin.test.junit) - } - } - } -} - -android { - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - } - namespace = "ru.beryukhov.date_time_utils" - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 } } diff --git a/gradle.properties b/gradle.properties index 78884c9..468f962 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ org.gradle.parallel=true android.experimental.enableScreenshotTest=true android.nonFinalResIds=false -android.builtInKotlin=false -android.newDsl=false +android.builtInKotlin=true +android.newDsl=true kotlin.native.binary.gc=cms kotlin.incremental.wasm=true diff --git a/repository-room/build.gradle.kts b/repository-room/build.gradle.kts index 66e83c5..516c60e 100644 --- a/repository-room/build.gradle.kts +++ b/repository-room/build.gradle.kts @@ -1,6 +1,6 @@ plugins { kotlin("multiplatform") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") id("com.autonomousapps.dependency-analysis") id("androidx.room") id("com.google.devtools.ksp") @@ -9,7 +9,11 @@ plugins { version = "1.0" kotlin { - androidTarget() + android { + namespace = "repository" + compileSdk = libs.versions.compileSdk.get().toInt() + minSdk = libs.versions.minSdk.get().toInt() + } jvm() @@ -36,18 +40,6 @@ kotlin { } } -android { - compileSdk = libs.versions.compileSdk.get().toInt() - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - } - namespace = "repository" - compileOptions { - targetCompatibility = JavaVersion.VERSION_21 - sourceCompatibility = JavaVersion.VERSION_21 - } -} - dependencies { add("kspAndroid", libs.room.compiler) add("kspIosSimulatorArm64", libs.room.compiler) diff --git a/repository-sqldelight/build.gradle.kts b/repository-sqldelight/build.gradle.kts index 8e27b7e..7213eda 100644 --- a/repository-sqldelight/build.gradle.kts +++ b/repository-sqldelight/build.gradle.kts @@ -1,6 +1,6 @@ plugins { kotlin("multiplatform") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") id("com.autonomousapps.dependency-analysis") id("app.cash.sqldelight") } @@ -18,7 +18,11 @@ sqldelight { version = "1.0" kotlin { - androidTarget() + android { + namespace = "ru.beryukhov.sqldelight" + compileSdk = libs.versions.compileSdk.get().toInt() + minSdk = libs.versions.minSdk.get().toInt() + } jvm() @@ -50,17 +54,3 @@ kotlin { } } } - -android { - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - } - namespace = "ru.beryukhov.sqldelight" - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } -} diff --git a/repository/build.gradle.kts b/repository/build.gradle.kts index 78f3b25..6de0bd0 100644 --- a/repository/build.gradle.kts +++ b/repository/build.gradle.kts @@ -2,14 +2,18 @@ import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl plugins { kotlin("multiplatform") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") id("com.autonomousapps.dependency-analysis") } version = "1.0" kotlin { - androidTarget() + android { + namespace = "ru.beryukhov.repository" + compileSdk = libs.versions.compileSdk.get().toInt() + minSdk = libs.versions.minSdk.get().toInt() + } jvm() @@ -34,17 +38,3 @@ kotlin { } } } - -android { - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - } - namespace = "ru.beryukhov.repository" - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } -} diff --git a/wear/build.gradle.kts b/wear/build.gradle.kts index 75e5551..8ea1023 100644 --- a/wear/build.gradle.kts +++ b/wear/build.gradle.kts @@ -1,7 +1,6 @@ plugins { id("com.android.application") id("com.autonomousapps.dependency-analysis") - kotlin("android") id("org.jetbrains.kotlin.plugin.compose") } From 8bf38352fe6e334734832d804239b28dd6d668bc Mon Sep 17 00:00:00 2001 From: Andrei Beriukhov Date: Fri, 6 Mar 2026 18:46:49 +0200 Subject: [PATCH 6/6] restore unit tests --- Makefile | 2 +- app/build.gradle.kts | 11 +++++------ cmp-common/build.gradle.kts | 9 ++++----- date-time-utils/build.gradle.kts | 1 + 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b9777d5..73cabcf 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ buildDesktop: ./gradlew :cmp-common:jvmJar $(params) testCommon: - ./gradlew :cmp-common:testDebugUnitTest $(params) + ./gradlew :cmp-common:testAndroidHostTest $(params) localCheck: detekt testApp buildApp buildWear buildDesktop testCommon diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 486d753..1051ae6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,5 @@ -//import com.google.protobuf.gradle.id -//import com.google.protobuf.gradle.protobuf +// import com.google.protobuf.gradle.id +// import com.google.protobuf.gradle.protobuf import java.io.File import java.io.FileInputStream import java.time.Instant @@ -141,12 +141,11 @@ dependencies { testImplementation(libs.compose.uiTestJunit4) testImplementation(libs.kakao.compose) - testImplementation(libs.kotlin.test) + testImplementation(libs.kotlin.test.junit) testImplementation(libs.kotlin.test.annotations) - testRuntimeOnly(libs.kotlin.test.junit) } -//protobuf { +// protobuf { // protoc { // artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}" // } @@ -159,7 +158,7 @@ dependencies { // } // } // } -//} +// } object KeyHelper { diff --git a/cmp-common/build.gradle.kts b/cmp-common/build.gradle.kts index 719515d..52baf99 100644 --- a/cmp-common/build.gradle.kts +++ b/cmp-common/build.gradle.kts @@ -20,6 +20,7 @@ kotlin { compileSdk = libs.versions.compileSdk.get().toInt() minSdk = libs.versions.minSdk.get().toInt() androidResources.enable = true + withHostTestBuilder {} } jvm() @@ -113,11 +114,9 @@ kotlin { // Wearable implementation(libs.playServices.wearable) } -// val androidUnitTest by getting { -// dependencies { -// implementation(libs.kotlin.test.junit) -// } -// } + getByName("androidHostTest").dependencies { + implementation(libs.kotlin.test.junit) + } jvmMain.dependencies { implementation(compose.desktop.currentOs) implementation(libs.ktor.java) diff --git a/date-time-utils/build.gradle.kts b/date-time-utils/build.gradle.kts index 2d76260..d4ef1f4 100644 --- a/date-time-utils/build.gradle.kts +++ b/date-time-utils/build.gradle.kts @@ -13,6 +13,7 @@ kotlin { namespace = "ru.beryukhov.date_time_utils" compileSdk = libs.versions.compileSdk.get().toInt() minSdk = libs.versions.minSdk.get().toInt() + withHostTestBuilder {} } jvm()