Skip to content

Commit b0775ad

Browse files
Setup Version Catalog
1 parent 92f846f commit b0775ad

File tree

3 files changed

+42
-39
lines changed

3 files changed

+42
-39
lines changed

build.gradle.kts

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
21
import org.apache.tools.ant.taskdefs.condition.Os
32
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
43

@@ -10,17 +9,12 @@ allprojects {
109
}
1110
}
1211

13-
buildscript {
14-
dependencies {
15-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
16-
}
17-
}
1812

1913
plugins {
20-
id("org.jetbrains.kotlin.multiplatform")
14+
alias(libs.plugins.kotlin.multiplatform)
2115
`maven-publish`
22-
id("org.jetbrains.kotlin.plugin.serialization")
23-
id("com.android.library")
16+
alias(libs.plugins.kotlin.serialization)
17+
alias(libs.plugins.android.library)
2418
}
2519

2620
publishing {
@@ -84,14 +78,7 @@ kotlin {
8478
}
8579
}
8680
}
87-
88-
val klockVersion = "2.4.13"
89-
val ktorVersion = "1.6.7"
90-
val coroutinesVersion = "1.8.0"
91-
val uuidVersion = "0.4.1"
92-
val kotlinxSerVersion = "1.5.0"
93-
val kermitVersion = "2.0.0-RC4"
94-
81+
9582
sourceSets {
9683
all {
9784
languageSettings {
@@ -102,16 +89,15 @@ kotlin {
10289
}
10390
}
10491
sourceSets["commonMain"].dependencies {
105-
implementation(kotlin("stdlib-common"))
106-
implementation("com.benasher44:uuid:$uuidVersion")
107-
implementation("com.soywiz.korlibs.klock:klock:$klockVersion")
108-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
109-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerVersion")
110-
implementation("co.touchlab:kermit:$kermitVersion")
92+
implementation(libs.uuid)
93+
implementation(libs.klock)
94+
implementation(libs.coroutines)
95+
implementation(libs.serialization)
96+
implementation(libs.kermit)
11197
}
11298

11399
sourceSets["commonTest"].dependencies {
114-
implementation(kotlin("test"))
100+
implementation(libs.kotlin.test)
115101
}
116102

117103
sourceSets["androidMain"].dependencies {
@@ -132,11 +118,11 @@ kotlin {
132118
}
133119

134120
sourceSets["jvmTest"].dependencies {
135-
implementation(kotlin("test"))
136-
implementation(kotlin("test-junit"))
137-
implementation("io.ktor:ktor-client-websockets:$ktorVersion")
138-
implementation("io.ktor:ktor-client-cio:$ktorVersion")
139-
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
121+
implementation(libs.kotlin.test)
122+
implementation(libs.kotlin.test.junit)
123+
implementation(libs.ktor.websockets)
124+
implementation(libs.ktor.cio)
125+
implementation(libs.ktor.okhttp)
140126
}
141127
}
142128
}

gradle/libs.versions.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[versions]
2+
agp = "8.1.4"
3+
kotlin = "2.0.0"
4+
klock = "2.4.13"
5+
ktor = "1.6.7"
6+
coroutine = "1.8.0"
7+
uuid = "0.4.1"
8+
serialization = "1.5.0"
9+
kermit = "2.0.0-RC4"
10+
11+
[plugins]
12+
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
13+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
14+
android-library = { id = "com.android.library", version.ref = "agp" }
15+
16+
[libraries]
17+
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
18+
klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "klock" }
19+
coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutine" }
20+
serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
21+
kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
22+
ktor-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
23+
ktor-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
24+
ktor-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
25+
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
26+
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
27+

settings.gradle.kts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ pluginManagement {
55
gradlePluginPortal()
66
maven { url = uri("https://jitpack.io") }
77
}
8-
9-
val kotlinVersion: String by settings
10-
val agpVersion: String by settings
11-
12-
plugins {
13-
id("org.jetbrains.kotlin.multiplatform") version kotlinVersion
14-
`maven-publish`
15-
id("org.jetbrains.kotlin.plugin.serialization") version kotlinVersion
16-
id("com.android.library") version agpVersion
17-
}
188
}
199

2010
rootProject.name = "libpebblecommon"

0 commit comments

Comments
 (0)