From 010d321a8364d39d04c86d66b4a5bdd612a5d0b6 Mon Sep 17 00:00:00 2001 From: Markus Billharz <50644328+MarkusBillharz@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:00:33 +0200 Subject: [PATCH 1/5] Use mavenLocal across all samples consistently (#196) --- samples/kotlin-mcp-client/settings.gradle.kts | 1 + samples/kotlin-mcp-server/build.gradle.kts | 4 ---- samples/kotlin-mcp-server/settings.gradle.kts | 7 +++++++ samples/weather-stdio-server/settings.gradle.kts | 7 ++++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/samples/kotlin-mcp-client/settings.gradle.kts b/samples/kotlin-mcp-client/settings.gradle.kts index 39d0cc29..1b15a3c2 100644 --- a/samples/kotlin-mcp-client/settings.gradle.kts +++ b/samples/kotlin-mcp-client/settings.gradle.kts @@ -7,5 +7,6 @@ plugins { dependencyResolutionManagement { repositories { mavenCentral() + mavenLocal() } } diff --git a/samples/kotlin-mcp-server/build.gradle.kts b/samples/kotlin-mcp-server/build.gradle.kts index 10520c20..f36149dd 100644 --- a/samples/kotlin-mcp-server/build.gradle.kts +++ b/samples/kotlin-mcp-server/build.gradle.kts @@ -11,10 +11,6 @@ plugins { group = "org.example" version = "0.1.0" -repositories { - mavenCentral() -} - val jvmMainClass = "Main_jvmKt" kotlin { diff --git a/samples/kotlin-mcp-server/settings.gradle.kts b/samples/kotlin-mcp-server/settings.gradle.kts index 6efbc10a..c0266275 100644 --- a/samples/kotlin-mcp-server/settings.gradle.kts +++ b/samples/kotlin-mcp-server/settings.gradle.kts @@ -2,3 +2,10 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } rootProject.name = "kotlin-mcp-server" + +dependencyResolutionManagement { + repositories { + mavenCentral() + mavenLocal() + } +} diff --git a/samples/weather-stdio-server/settings.gradle.kts b/samples/weather-stdio-server/settings.gradle.kts index 015fa3f2..a3ff2bc9 100644 --- a/samples/weather-stdio-server/settings.gradle.kts +++ b/samples/weather-stdio-server/settings.gradle.kts @@ -5,7 +5,8 @@ plugins { } dependencyResolutionManagement { - repositories { - mavenCentral() - } + repositories { + mavenCentral() + mavenLocal() + } } From 2a546edca88fe83f49e46aa89285547a092b6bd4 Mon Sep 17 00:00:00 2001 From: Markus Billharz <50644328+MarkusBillharz@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:00:34 +0200 Subject: [PATCH 2/5] Fix incompatible ABI version build error (#196) --- samples/kotlin-mcp-server/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/kotlin-mcp-server/build.gradle.kts b/samples/kotlin-mcp-server/build.gradle.kts index f36149dd..64e3397c 100644 --- a/samples/kotlin-mcp-server/build.gradle.kts +++ b/samples/kotlin-mcp-server/build.gradle.kts @@ -4,8 +4,8 @@ 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" + kotlin("multiplatform") version "2.2.0" + kotlin("plugin.serialization") version "2.2.0" } group = "org.example" From 1279e906177583bff3a994727b7ca048f41cfcab Mon Sep 17 00:00:00 2001 From: Markus Billharz <50644328+MarkusBillharz@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:00:34 +0200 Subject: [PATCH 3/5] Add sample builds to GitHub PR action (#196) --- .github/workflows/validate-pr.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 0ab75a73..91428e75 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -26,6 +26,21 @@ jobs: - name: Clean Build with Gradle run: ./gradlew clean build + - name: Publish Build to MavenLocal # used by the samples + run: ./gradlew publishToMavenLocal + + - name: Build Kotlin-MCP-Client Sample + working-directory: ./samples/kotlin-mcp-client + run: ./gradlew clean build + + - name: Build Kotlin-MCP-Server Sample + working-directory: ./samples/kotlin-mcp-server + run: ./gradlew clean build + + - name: Build Weather-Stdio-Server Sample + working-directory: ./samples/kotlin-mcp-client + run: ./gradlew clean build + - name: Disable Auto-Merge on Fail if: failure() run: gh pr merge --disable-auto "$PR_URL" From 0757cca64a06db97158ca996e9bf2d6e8b7209ce Mon Sep 17 00:00:00 2001 From: Markus Billharz <50644328+MarkusBillharz@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:00:34 +0200 Subject: [PATCH 4/5] Prioritize mavenLocal in the samples dependency resolution (#196) This ensures that the PR action and local development are guaranteed to be using the latest version. --- samples/kotlin-mcp-client/settings.gradle.kts | 2 +- samples/kotlin-mcp-server/settings.gradle.kts | 2 +- samples/weather-stdio-server/settings.gradle.kts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/kotlin-mcp-client/settings.gradle.kts b/samples/kotlin-mcp-client/settings.gradle.kts index 1b15a3c2..61dbfa51 100644 --- a/samples/kotlin-mcp-client/settings.gradle.kts +++ b/samples/kotlin-mcp-client/settings.gradle.kts @@ -6,7 +6,7 @@ plugins { dependencyResolutionManagement { repositories { - mavenCentral() mavenLocal() + mavenCentral() } } diff --git a/samples/kotlin-mcp-server/settings.gradle.kts b/samples/kotlin-mcp-server/settings.gradle.kts index c0266275..83e5ab2f 100644 --- a/samples/kotlin-mcp-server/settings.gradle.kts +++ b/samples/kotlin-mcp-server/settings.gradle.kts @@ -5,7 +5,7 @@ rootProject.name = "kotlin-mcp-server" dependencyResolutionManagement { repositories { - mavenCentral() mavenLocal() + mavenCentral() } } diff --git a/samples/weather-stdio-server/settings.gradle.kts b/samples/weather-stdio-server/settings.gradle.kts index a3ff2bc9..210f5f43 100644 --- a/samples/weather-stdio-server/settings.gradle.kts +++ b/samples/weather-stdio-server/settings.gradle.kts @@ -6,7 +6,7 @@ plugins { dependencyResolutionManagement { repositories { - mavenCentral() mavenLocal() + mavenCentral() } } From 7ebe530a78eba31529ff3a06c1efc680c4dd0cb4 Mon Sep 17 00:00:00 2001 From: Markus Billharz <50644328+MarkusBillharz@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:00:34 +0200 Subject: [PATCH 5/5] Add instructions for testing local changes with samples (#196) --- CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1e985ea..88662387 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,6 +81,12 @@ See [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/ * Run `./gradlew test` to test the module and speed up development. * Run `./gradlew build` to build the project, which also runs all the tests. +### Running Samples with Local Changes + +All sample projects include mavenLocal() in their repositories and will prioritize locally published builds by default. + +* Run `./gradlew publishToMavenLocal` to test the samples with local changes to the SDK + ## Contacting maintainers * If something cannot be done, not convenient, or does not work — submit an [issue](#submitting-issues).