Skip to content

Allow samples to run against local builds using mavenLocal() #197

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 5 commits 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
15 changes: 15 additions & 0 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions samples/kotlin-mcp-client/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

dependencyResolutionManagement {
repositories {
mavenLocal()
mavenCentral()
}
}
8 changes: 2 additions & 6 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"
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 {
Expand Down
7 changes: 7 additions & 0 deletions samples/kotlin-mcp-server/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
7 changes: 4 additions & 3 deletions samples/weather-stdio-server/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ plugins {
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}
repositories {
mavenLocal()
mavenCentral()
}
}