Skip to content
Merged

Agp9 #515

Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
39 changes: 18 additions & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")
}
Expand Down Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
package ru.beryukhov.coffeegram.repository

import android.content.Context
Expand Down Expand Up @@ -83,3 +84,4 @@ private fun ProtoThemeState?.mapOrNull(): DarkThemeState? {
if (this == null) return null
return DarkThemeState.valueOf(this.name)
}
*/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
package ru.beryukhov.coffeegram.repository

import androidx.datastore.core.CorruptionException
Expand All @@ -22,3 +23,4 @@ object ThemePreferencesSerializer : Serializer<ThemePreferences> {
t.writeTo(output)
}
}
*/
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
35 changes: 11 additions & 24 deletions cmp-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
28 changes: 7 additions & 21 deletions date-time-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
}
}
22 changes: 3 additions & 19 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
20 changes: 6 additions & 14 deletions repository-room/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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()

Expand All @@ -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)
Expand Down
22 changes: 6 additions & 16 deletions repository-sqldelight/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
Expand All @@ -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()

Expand Down Expand Up @@ -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
}
}
22 changes: 6 additions & 16 deletions repository/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
}
}
1 change: 0 additions & 1 deletion wear/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id("com.android.application")
id("com.autonomousapps.dependency-analysis")
kotlin("android")
id("org.jetbrains.kotlin.plugin.compose")
}

Expand Down