From e43c0fcef4a6b592870b04a87de444d72111c933 Mon Sep 17 00:00:00 2001 From: Marco Martinez Date: Mon, 3 Jun 2024 13:32:16 -0600 Subject: [PATCH] Add lib catalog (#20) * Create libs.versions.toml * Update project build.gradle.kts * Update core build.gradle.kts * Update solana build.gradle.kts --- build.gradle.kts | 4 ++-- core/build.gradle.kts | 10 +++++----- gradle/libs.versions.toml | 23 +++++++++++++++++++++++ solana/build.gradle.kts | 18 +++++++++--------- 4 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/build.gradle.kts b/build.gradle.kts index 86c019e..acbd6e8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - kotlin("multiplatform") version "1.9.21" apply false - id("com.vanniktech.maven.publish") version "0.25.3" apply false + alias(libs.plugins.kotlin.multiplatform) apply false + alias(libs.plugins.publish) apply false } //tasks.register("clean", Delete::class) { diff --git a/core/build.gradle.kts b/core/build.gradle.kts index a395a7c..d51190e 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,7 +1,7 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") version "1.9.21" - id("com.vanniktech.maven.publish") + alias(libs.plugins.kotlin.multiplatform) + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.publish) } val artifactIdPrefix: String by project @@ -29,12 +29,12 @@ kotlin { sourceSets { val commonMain by getting { dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2") + implementation(libs.kotlinx.serialization.json) } } val commonTest by getting { dependencies { - implementation(kotlin("test")) + implementation(libs.kotlin.test) } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..65861d7 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,23 @@ +[versions] +kotlinxCoroutines= "1.7.3" + +# Plugin versions +androidGradlePlugin = "8.0.2" +kotlin = "1.9.21" +kotlinSerialization = "1.6.2" +vanniktechMavenPublish = "0.25.3" + +[libraries] +crypto = { group = "com.diglol.crypto", name = "crypto", version = "0.1.5" } +kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test" } +kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinSerialization" } +#kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" } +kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } +multimult = { group = "io.github.funkatronics", name = "multimult", version = "0.2.1" } +rpc-core = { group = "com.solanamobile", name = "rpc-core", version = "0.2.5" } + +[plugins] +android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +publish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktechMavenPublish" } diff --git a/solana/build.gradle.kts b/solana/build.gradle.kts index cef8adb..6fae560 100644 --- a/solana/build.gradle.kts +++ b/solana/build.gradle.kts @@ -1,7 +1,7 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") version "1.9.21" - id("com.vanniktech.maven.publish") + alias(libs.plugins.kotlin.multiplatform) + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.publish) } val artifactIdPrefix: String by project @@ -30,16 +30,16 @@ kotlin { val commonMain by getting { dependencies { api(project(mapOf("path" to ":core"))) - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2") - implementation("io.github.funkatronics:multimult:0.2.1") + implementation(libs.kotlinx.serialization.json) + implementation(libs.multimult) } } val commonTest by getting { dependencies { - implementation(kotlin("test")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") - implementation("com.diglol.crypto:pkc:0.1.5") - implementation("com.solanamobile:rpc-core:0.2.4") + implementation(libs.kotlin.test) + implementation(libs.kotlinx.coroutines.test) + implementation(libs.crypto) + implementation(libs.rpc.core) } } }