Skip to content

Commit 50695fe

Browse files
committed
Refactor sample projects: add samples as composite builds, replace hardcoded dependencies with version catalog, remove obsolete gradle wrapper files
1 parent 7333d41 commit 50695fe

26 files changed

+85
-1204
lines changed

gradle/libs.versions.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ binaryCompatibilityValidatorPlugin = "0.18.1"
1616
slf4j = "2.0.17"
1717
kotest = "5.9.1"
1818

19+
# Samples
20+
mcp-kotlin = "0.6.0"
21+
anthropic = "0.8.0"
22+
shadow = "8.1.1"
23+
1924
[libraries]
2025
# Plugins
2126
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
@@ -44,5 +49,17 @@ ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock", version.ref =
4449
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
4550
kotest-assertions-json = { group = "io.kotest", name = "kotest-assertions-json", version.ref = "kotest" }
4651

52+
# Samples
53+
mcp-kotlin = { group = "io.modelcontextprotocol", name = "kotlin-sdk", version.ref = "mcp-kotlin" }
54+
anthropic-java = { group = "com.anthropic", name = "anthropic-java", version.ref = "anthropic" }
55+
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
56+
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
57+
4758
[plugins]
4859
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidatorPlugin" }
60+
61+
# Samples
62+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
63+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
64+
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
65+
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }

samples/kotlin-mcp-client/.gitignore

Lines changed: 0 additions & 42 deletions
This file was deleted.

samples/kotlin-mcp-client/build.gradle.kts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
plugins {
2-
kotlin("jvm") version "2.1.10"
2+
alias(libs.plugins.kotlin.jvm)
3+
alias(libs.plugins.shadow)
34
application
4-
id("com.github.johnrengelman.shadow") version "8.1.1"
55
}
66

77
application {
88
mainClass.set("io.modelcontextprotocol.sample.client.MainKt")
99
}
1010

11-
1211
group = "org.example"
1312
version = "0.1.0"
1413

15-
val mcpVersion = "0.6.0"
16-
val slf4jVersion = "2.0.9"
17-
val anthropicVersion = "0.8.0"
18-
1914
dependencies {
20-
implementation("io.modelcontextprotocol:kotlin-sdk:$mcpVersion")
21-
implementation("org.slf4j:slf4j-nop:$slf4jVersion")
22-
implementation("com.anthropic:anthropic-java:$anthropicVersion")
15+
implementation(libs.mcp.kotlin)
16+
implementation(libs.slf4j.simple)
17+
implementation(libs.anthropic.java)
2318
}
2419

2520
tasks.test {

samples/kotlin-mcp-client/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
-42.7 KB
Binary file not shown.

samples/kotlin-mcp-client/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

samples/kotlin-mcp-client/gradlew

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)