Skip to content

Move samples deps to version catalog #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,20 @@ mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
kotest-assertions-json = { group = "io.kotest", name = "kotest-assertions-json", version.ref = "kotest" }

# Samples
mcp-kotlin = { group = "io.modelcontextprotocol", name = "kotlin-sdk", version = "0.5.0" }
slf4j-nop = { group = "org.slf4j", name = "slf4j-nop", version.ref = "slf4j" }
anthropic-jvm = { group = "com.anthropic", name = "anthropic-java", version = "0.8.0" }
ktor-client-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-serialization-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
jreleaser = { id = "org.jreleaser", version.ref = "jreleaser"}
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidatorPlugin" }

# Samples
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" }
15 changes: 5 additions & 10 deletions samples/kotlin-mcp-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
plugins {
kotlin("jvm") version "2.1.10"
alias(libs.plugins.kotlin.jvm)
application
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.shadow)
}

application {
mainClass.set("io.modelcontextprotocol.sample.client.MainKt")
}


group = "org.example"
version = "0.1.0"

val mcpVersion = "0.5.0"
val slf4jVersion = "2.0.9"
val anthropicVersion = "0.8.0"

dependencies {
implementation("io.modelcontextprotocol:kotlin-sdk:$mcpVersion")
implementation("org.slf4j:slf4j-nop:$slf4jVersion")
implementation("com.anthropic:anthropic-java:$anthropicVersion")
implementation(libs.mcp.kotlin)
implementation(libs.slf4j.nop)
implementation(libs.anthropic.jvm)
}

tasks.test {
Expand Down
5 changes: 5 additions & 0 deletions samples/kotlin-mcp-client/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ plugins {
}

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../../gradle/libs.versions.toml"))
}
}
repositories {
mavenCentral()
}
Expand Down
12 changes: 4 additions & 8 deletions samples/kotlin-mcp-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
kotlin("multiplatform") version "2.1.20"
kotlin("plugin.serialization") version "2.1.20"
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
}

group = "org.example"
version = "0.1.0"

repositories {
mavenCentral()
}

val jvmMainClass = "Main_jvmKt"

kotlin {
Expand Down Expand Up @@ -43,10 +39,10 @@ kotlin {

sourceSets {
commonMain.dependencies {
implementation("io.modelcontextprotocol:kotlin-sdk:0.5.0")
implementation(libs.mcp.kotlin)
}
jvmMain.dependencies {
implementation("org.slf4j:slf4j-nop:2.0.9")
implementation(libs.slf4j.nop)
}
wasmJsMain.dependencies {}
}
Expand Down
15 changes: 14 additions & 1 deletion samples/kotlin-mcp-server/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
rootProject.name = "kotlin-mcp-server"

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
rootProject.name = "kotlin-mcp-server"


dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../../gradle/libs.versions.toml"))
}
}
repositories {
mavenCentral()
}
}
21 changes: 8 additions & 13 deletions samples/weather-stdio-server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
plugins {
kotlin("jvm") version "2.1.10"
kotlin("plugin.serialization") version "2.1.10"
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.shadow)
application
}

application {
mainClass.set("io.modelcontextprotocol.sample.server.MainKt")
}


group = "org.example"
version = "0.1.0"

val mcpVersion = "0.5.0"
val slf4jVersion = "2.0.9"
val ktorVersion = "3.1.1"

dependencies {
implementation("io.modelcontextprotocol:kotlin-sdk:$mcpVersion")
implementation("org.slf4j:slf4j-nop:$slf4jVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation(libs.mcp.kotlin)
implementation(libs.slf4j.nop)
implementation(libs.ktor.client.negotiation)
implementation(libs.ktor.serialization.json)
testImplementation(kotlin("test"))
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.1")
testImplementation(libs.kotlinx.coroutines.test)
}

tasks.test {
Expand Down
5 changes: 5 additions & 0 deletions samples/weather-stdio-server/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ plugins {
}

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../../gradle/libs.versions.toml"))
}
}
repositories {
mavenCentral()
}
Expand Down