Skip to content
Merged
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
16 changes: 8 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
plugins {
//trick: for the same plugin versions in all sub-modules
id("com.android.application").version(Versions.GRADLE_PLUGIN).apply(false)
id("com.android.library").version(Versions.GRADLE_PLUGIN).apply(false)
id("com.vanniktech.maven.publish").version(Versions.PUBLISH_PLUGIN).apply(false)
id("io.gitlab.arturbosch.detekt").version(Versions.DETEKT_PLUGIN).apply(false)
id("org.jlleitschuh.gradle.ktlint").version(Versions.KTLINT_PLUGIN).apply(false)
id("org.jetbrains.kotlinx.kover").version(Versions.KOVER_PLUGIN).apply(false)
kotlin("android").version(Versions.KOTLIN).apply(false)
kotlin("multiplatform").version(Versions.KOTLIN).apply(false)
id("com.android.application") version libs.versions.gradlePlugin apply false
id("com.android.library").version(libs.versions.gradlePlugin).apply(false)
id("com.vanniktech.maven.publish").version(libs.versions.publishPlugin).apply(false)
id("io.gitlab.arturbosch.detekt").version(libs.versions.detektPlugin).apply(false)
id("org.jlleitschuh.gradle.ktlint").version(libs.versions.ktlintPlugin).apply(false)
id("org.jetbrains.kotlinx.kover").version(libs.versions.koverPlugin).apply(false)
kotlin("android").version(libs.versions.kotlin).apply(false)
kotlin("multiplatform").version(libs.versions.kotlin).apply(false)
}

tasks.register("clean", Delete::class) {
Expand Down
5 changes: 0 additions & 5 deletions buildSrc/src/main/kotlin/Config.kt

This file was deleted.

67 changes: 0 additions & 67 deletions buildSrc/src/main/kotlin/Dependencies.kt

This file was deleted.

63 changes: 63 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[versions]
coil = "2.2.2"
compose = "1.3.3"
composeActivity = "1.6.1"
composeFoundation = "1.3.1"
composeLivedata = "1.3.3"
composeNavigation = "2.5.3"
config-compile-sdk-version = "33"
config-min-sdk-version = "23"
config-target-sdk-version = "33"
detektPlugin = "1.22.0"
gradlePlugin = "7.3.0"
koin = "3.2.0"
kotlin = "1.7.20"
koverPlugin = "0.6.1"
ktlintPlugin = "11.0.0"
ktor = "2.2.2"
mockk = "1.13.4"
mockkCommon = "1.12.5"
publishPlugin = "0.24.0"
spmPlugin = "2.0.5-arm64"
spring = "2.4.5"

[libraries]
# Spring
spring-boot-dependencies = { group = "org.springframework.boot", name = "spring-boot-dependencies", version.ref = "spring" }
spring-boot-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" }

#Network
ktor-android = { group = "io.ktor", name = "ktor-client-android", version.ref = "ktor" }
ktor-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
ktor-darwin = { group = "io.ktor", name = "ktor-client-darwin", version.ref = "ktor" }
ktor-ios = { group = "io.ktor", name = "ktor-client-ios", version.ref = "ktor" }
ktor-logging = { group = "io.ktor", name = "ktor-client-logging", version.ref = "ktor" }
ktor-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-okhttp = { group = "io.ktor", name = "ktor-client-okhttp", version.ref = "ktor" }
ktor-serialization = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }

# DI
koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" }
koin-compose = { group = "io.insert-koin", name = "koin-androidx-compose", version.ref = "koin" }
koin-core = { group = "io.insert-koin", name = "koin-core", version.ref = "koin" }

#UI
androidx-compose-activity = { group = "androidx.activity", name = "activity-compose", version.ref = "composeActivity" }
androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "composeFoundation" }
androidx-compose-livedata = { group = "androidx.compose.runtime", name = "runtime-livedata", version.ref = "composeLivedata" }
androidx-compose-material = { group = "androidx.compose.material", name = "material", version.ref = "composeFoundation" }
androidx-compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "composeNavigation" }
androidx-compose-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "compose" }
androidx-compose-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "compose" }
coil = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }

#Test
koin-test = { group = "io.insert-koin", name = "koin-test", version.ref = "koin" }
ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock", version.ref = "ktor" }
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
mockk-common = { group = "io.mockk", name = "mockk-common", version.ref = "mockkCommon" }
mockk-jvm = { group = "io.mockk", name = "mockk-jvm", version.ref = "mockk" }

[plugins]
android-application = { id = "com.android.application", version.ref = "gradlePlugin" }
android-library = { id = "com.android.library", version.ref = "gradlePlugin" }
29 changes: 14 additions & 15 deletions sample/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {

android {
namespace = "co.yml.ychat.android"
compileSdk = Config.COMPILE_SDK_VERSION
compileSdk = libs.versions.config.compile.sdk.version.get().toInt()
defaultConfig {
applicationId = "co.yml.ychat.android"
minSdk = Config.MIN_SDK_VERSION
targetSdk = Config.TARGET_SDK_VERSION
minSdk = libs.versions.config.min.sdk.version.get().toInt()
targetSdk = libs.versions.config.target.sdk.version.get().toInt()
versionCode = 1
versionName = "1.0"

Expand Down Expand Up @@ -45,16 +45,15 @@ android {

dependencies {
implementation(project(":ychat"))
implementation(Dependencies.UI.COMPOSE_UI)
implementation(Dependencies.UI.COMPOSE_TOOLING)
implementation(Dependencies.UI.COMPOSE_TOOLING_PREVIEW)
implementation(Dependencies.UI.COMPOSE_FOUNDATION)
implementation(Dependencies.UI.COMPOSE_MATERIAL)
implementation(Dependencies.UI.COMPOSE_ACTIVITY)
implementation(Dependencies.UI.COMPOSE_NAVIGATION)
implementation(Dependencies.UI.COMPOSE_LIVEDATA)
implementation(Dependencies.UI.COIL)
implementation(Dependencies.DI.KOIN_CORE)
implementation(Dependencies.DI.KOIN_ANDROID)
implementation(Dependencies.DI.KOIN_COMPOSE)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.tooling.preview)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.activity)
implementation(libs.androidx.compose.navigation)
implementation(libs.androidx.compose.livedata)
implementation(libs.coil)
implementation(libs.koin.core)
implementation(libs.koin.android)
implementation(libs.koin.compose)
}
6 changes: 3 additions & 3 deletions sample/jvm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.springframework.boot").version(Versions.SPRING)
id("org.springframework.boot").version(libs.versions.spring)
java
}

Expand All @@ -10,6 +10,6 @@ java {

dependencies {
implementation(project(":ychat"))
implementation(platform(Dependencies.Spring.SPRING_DEP))
implementation(Dependencies.Spring.SPRING_WEB)
implementation(platform(libs.spring.boot.dependencies))
implementation(libs.spring.boot.web)
}
30 changes: 15 additions & 15 deletions ychat-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api(Dependencies.Network.KTOR_NEGOTIATION)
api(Dependencies.Network.KTOR_SERIALIZATION)
api(Dependencies.Network.KTOR_CORE)
api(Dependencies.Network.KTOR_LOGGING)
api(libs.ktor.negotiation)
api(libs.ktor.serialization)
api(libs.ktor.core)
api(libs.ktor.logging)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(Dependencies.Test.MOCKK_COMMON)
implementation(Dependencies.Test.KTOR)
implementation(Dependencies.Test.KOIN)
implementation(libs.mockk.common)
implementation(libs.ktor.client.mock)
implementation(libs.koin.test)
}
}
val androidMain by getting {
dependencies {
implementation(Dependencies.Network.KTOR_OKHTTP)
implementation(libs.ktor.okhttp)
}
}
val iosX64Main by getting
Expand All @@ -65,7 +65,7 @@ kotlin {
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
dependencies {
implementation(Dependencies.Network.KTOR_IOS)
implementation(libs.ktor.ios)
}
}
val macosArm64Main by getting
Expand All @@ -75,31 +75,31 @@ kotlin {
macosArm64Main.dependsOn(this)
macosX64Main.dependsOn(this)
dependencies {
implementation(Dependencies.Network.KTOR_DARWIN)
implementation(libs.ktor.darwin)
}
}
val iosTest by creating {
dependsOn(commonTest)
}
val jvmMain by getting {
dependencies {
implementation(Dependencies.Network.KTOR_OKHTTP)
implementation(libs.ktor.okhttp)
}
}
val jvmTest by getting {
dependencies {
implementation(Dependencies.Test.MOCKK_JVM)
implementation(libs.mockk.jvm)
}
}
}
}

android {
namespace = "co.yml.ychat.core"
compileSdk = Config.COMPILE_SDK_VERSION
compileSdk = libs.versions.config.compile.sdk.version.get().toInt()
defaultConfig {
minSdk = Config.MIN_SDK_VERSION
targetSdk = Config.TARGET_SDK_VERSION
minSdk = libs.versions.config.min.sdk.version.get().toInt()
targetSdk = libs.versions.config.target.sdk.version.get().toInt()
}
}

Expand Down
22 changes: 11 additions & 11 deletions ychat/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization").version(Versions.KOTLIN)
id("io.github.luca992.multiplatform-swiftpackage").version(Versions.SPM_PLUGIN)
kotlin("plugin.serialization").version(libs.versions.kotlin)
id("io.github.luca992.multiplatform-swiftpackage").version(libs.versions.spmPlugin)
id("com.vanniktech.maven.publish")
id("com.android.library")
id("io.gitlab.arturbosch.detekt")
Expand Down Expand Up @@ -53,22 +53,22 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(Dependencies.DI.KOIN_CORE)
implementation(libs.koin.core)
implementation(project(":ychat-core"))
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(Dependencies.Test.MOCKK_COMMON)
implementation(Dependencies.Test.KTOR)
implementation(Dependencies.Test.KOIN)
implementation(libs.mockk.common)
implementation(libs.ktor.client.mock)
implementation(libs.koin.test)
}
}
val androidMain by getting
val androidTest by getting {
dependencies {
implementation(Dependencies.Test.MOCKK)
implementation(libs.mockk)
}
}
val iosX64Main by getting
Expand Down Expand Up @@ -99,18 +99,18 @@ kotlin {
val jvmMain by getting
val jvmTest by getting {
dependencies {
implementation(Dependencies.Test.MOCKK_JVM)
implementation(libs.mockk.jvm)
}
}
}
}

android {
namespace = "co.yml.ychat"
compileSdk = Config.COMPILE_SDK_VERSION
compileSdk = libs.versions.config.compile.sdk.version.get().toInt()
defaultConfig {
minSdk = Config.MIN_SDK_VERSION
targetSdk = Config.TARGET_SDK_VERSION
minSdk = libs.versions.config.min.sdk.version.get().toInt()
targetSdk = libs.versions.config.target.sdk.version.get().toInt()
}
}

Expand Down