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" 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). diff --git a/samples/kotlin-mcp-client/settings.gradle.kts b/samples/kotlin-mcp-client/settings.gradle.kts index 39d0cc29..61dbfa51 100644 --- a/samples/kotlin-mcp-client/settings.gradle.kts +++ b/samples/kotlin-mcp-client/settings.gradle.kts @@ -6,6 +6,7 @@ plugins { dependencyResolutionManagement { repositories { + mavenLocal() mavenCentral() } } diff --git a/samples/kotlin-mcp-server/build.gradle.kts b/samples/kotlin-mcp-server/build.gradle.kts index 10520c20..64e3397c 100644 --- a/samples/kotlin-mcp-server/build.gradle.kts +++ b/samples/kotlin-mcp-server/build.gradle.kts @@ -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" + kotlin("multiplatform") version "2.2.0" + kotlin("plugin.serialization") version "2.2.0" } 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..83e5ab2f 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 { + mavenLocal() + mavenCentral() + } +} diff --git a/samples/weather-stdio-server/settings.gradle.kts b/samples/weather-stdio-server/settings.gradle.kts index 015fa3f2..210f5f43 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 { + mavenLocal() + mavenCentral() + } }