Skip to content

Commit 5986d94

Browse files
committed
#196 Update build configuration and workflows for enhanced local publishing and sample builds
- 🐛 Add `jvm()` to Kotlin configuration for mcp client. - Add `mavenLocal()` to repository configuration in sample projects. - Update dependencies to distinguish between `mcp.kotlin.client` and `mcp.kotlin.server`. - Include `JAVA_OPTS` for optimized memory usage in GitHub workflow. - Enhance build workflow to include local publishing and build steps for sample projects. - Add package-lock.json for Kotlin JS/WASM Store - Replace `mcp.kotlin.server` and `mcp.kotlin.client` dependencies with their JVM-specific variants. - Update `libs.versions.toml` to include JVM-specific entries.
1 parent 41fc351 commit 5986d94

File tree

12 files changed

+8180
-10
lines changed

12 files changed

+8180
-10
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
validate-pr:
1717
runs-on: macos-latest-xlarge
1818
name: Validate PR
19+
env:
20+
JAVA_OPTS: "-Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g"
1921
steps:
2022
- uses: actions/checkout@v5
2123

@@ -32,9 +34,21 @@ jobs:
3234
cache-read-only: true
3335

3436
- name: Build with Gradle
35-
run: ./gradlew clean ktlintCheck build koverLog koverHtmlReport
36-
env:
37-
JAVA_OPTS: "-Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g"
37+
run: |-
38+
./gradlew clean ktlintCheck build koverLog koverHtmlReport
39+
./gradlew :kotlin-sdk-core:publishToMavenLocal :kotlin-sdk-client:publishToMavenLocal :kotlin-sdk-server:publishToMavenLocal
40+
41+
- name: Build Kotlin-MCP-Client Sample
42+
working-directory: ./samples/kotlin-mcp-client
43+
run: ./../../gradlew clean build
44+
45+
- name: Build Kotlin-MCP-Server Sample
46+
working-directory: ./samples/kotlin-mcp-server
47+
run: ./../../gradlew clean build
48+
49+
- name: Build Weather-Stdio-Server Sample
50+
working-directory: ./samples/weather-stdio-server
51+
run: ./../../gradlew clean build
3852

3953
- name: Upload Reports
4054
if: ${{ !cancelled() }}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
77
# Kotlin
88
kotlin.code.style=official
99
kotlin.daemon.jvmargs=-Xmx4G
10+
# Build JS targets using npm package manager https://kotlinlang.org/docs/js-project-setup.html#npm-dependencies
11+
kotlin.js.yarn=false
1012
# MPP
1113
kotlin.mpp.enableCInteropCommonization=true
1214
kotlin.native.ignoreDisabledTargets=true

gradle/libs.versions.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4
5757
# Samples
5858
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
5959
ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio", version.ref = "ktor" }
60-
mcp-kotlin = { group = "io.modelcontextprotocol", name = "kotlin-sdk", version.ref = "mcp-kotlin" }
60+
mcp-kotlin-client = { group = "io.modelcontextprotocol", name = "kotlin-sdk-client", version.ref = "mcp-kotlin" }
61+
mcp-kotlin-client-jvm = { group = "io.modelcontextprotocol", name = "kotlin-sdk-client-jvm", version.ref = "mcp-kotlin" }
62+
mcp-kotlin-server = { group = "io.modelcontextprotocol", name = "kotlin-sdk-server", version.ref = "mcp-kotlin" }
63+
mcp-kotlin-server-jvm = { group = "io.modelcontextprotocol", name = "kotlin-sdk-server-jvm", version.ref = "mcp-kotlin" }
6164
anthropic-java = { group = "com.anthropic", name = "anthropic-java", version.ref = "anthropic" }
6265
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
6366
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }

0 commit comments

Comments
 (0)