diff --git a/Makefile b/Makefile index b9777d55..73cabcf4 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 2a50cc7a..1051ae6e 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,11 +8,9 @@ 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.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") } @@ -143,25 +141,24 @@ 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 { - 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 e9b9dd48..3b572917 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 850e3e95..7f66e9aa 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) } } +*/ diff --git a/build.gradle.kts b/build.gradle.kts index 85266e8b..10cfe967 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 1a5990e9..52baf999 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,14 @@ plugins { } kotlin { - androidTarget() + android { + namespace = "ru.beryukhov.compose_common" + compileSdk = libs.versions.compileSdk.get().toInt() + minSdk = libs.versions.minSdk.get().toInt() + androidResources.enable = true + withHostTestBuilder {} + } + jvm() iosX64() @@ -107,10 +114,8 @@ 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) @@ -139,24 +144,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 d5c28c4c..d4ef1f43 100644 --- a/date-time-utils/build.gradle.kts +++ b/date-time-utils/build.gradle.kts @@ -2,14 +2,19 @@ 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() + withHostTestBuilder {} + } jvm() @@ -36,24 +41,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 bf8d9bfd..468f962f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,29 +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 -#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 +android.nonFinalResIds=false +android.builtInKotlin=true +android.newDsl=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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 35982355..4ca24c14 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" diff --git a/repository-room/build.gradle.kts b/repository-room/build.gradle.kts index 66e83c58..516c60e4 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 8e27b7e2..7213eda0 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 78f3b25f..6de0bd0f 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 75e55517..8ea1023c 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") }