Skip to content

Commit c112b30

Browse files
authored
Merge branch 'main' into dependabot/gradle/kotlin-2.2.20
2 parents 2e6b779 + 0ed92f5 commit c112b30

File tree

766 files changed

+2650
-78189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

766 files changed

+2650
-78189
lines changed

.github/workflows/apidocs.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Publish API Docs to GitHub Pages
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
# Allow running this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
jobs:
11+
deploy:
12+
13+
permissions:
14+
pages: write # to deploy to Pages
15+
id-token: write # to verify the deployment originates from an appropriate source
16+
17+
environment:
18+
name: github-pages
19+
url: ${{ steps.deployment.outputs.page_url }}
20+
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v5
24+
with:
25+
submodules: true # Fetch Hugo themes (true OR recursive)
26+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
27+
28+
- name: Set up JDK 21
29+
uses: actions/setup-java@v5
30+
with:
31+
java-version: '21'
32+
distribution: 'temurin'
33+
cache: gradle
34+
35+
- name: Setup Gradle
36+
uses: gradle/actions/setup-gradle@v4
37+
38+
- name: Generate Dokka Site
39+
run: |-
40+
./gradlew clean dokkaGenerate
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v4
44+
with:
45+
path: build/dokka/html
46+
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.github/workflows/build.yml

Lines changed: 29 additions & 4 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,18 +34,41 @@ 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
40-
if: always()
54+
if: ${{ !cancelled() }}
4155
uses: actions/upload-artifact@v4
4256
with:
4357
name: reports
4458
path: |
4559
**/build/reports/
4660
61+
- name: Publish Test Report
62+
uses: mikepenz/action-junit-report@v5
63+
if: ${{ !cancelled() }} # always run even if the previous step fails
64+
with:
65+
report_paths: '**/test-results/**/TEST-*.xml'
66+
detailed_summary: true
67+
flaky_summary: true
68+
include_empty_in_summary: false
69+
include_time_in_summary: true
70+
annotate_only: true
71+
4772
- name: Disable Auto-Merge on Fail
4873
if: failure() && github.event_name == 'pull_request'
4974
run: gh pr merge --disable-auto "$PR_URL"

.github/workflows/gradle-publish.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,16 @@ jobs:
3333
- name: Setup Gradle
3434
uses: gradle/actions/setup-gradle@v4
3535

36-
- name: Verify publication configuration
37-
run: ./gradlew jreleaserConfig
38-
env:
39-
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
40-
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
41-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
42-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
43-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
44-
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
4636
- name: Clean Build with Gradle
4737
run: ./gradlew clean build
48-
env:
49-
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
50-
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
51-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
52-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
53-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
54-
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
55-
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
5638

5739
- name: Publish to Maven Central Portal
5840
id: publish
59-
run: ./gradlew publish jreleaserFullRelease --info --stacktrace -Djreleaser.verbose=true
41+
run: ./gradlew publishToMavenCentral --no-configuration-cache
6042
env:
61-
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
62-
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
63-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
64-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
65-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
66-
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
44+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_TOKEN }}
45+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
46+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSPHRASE }}
6747
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
6848
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ build/
1111
.idea/compiler.xml
1212
.idea/libraries/
1313
.idea
14+
!.idea/icon.png
1415
*.iws
1516
*.iml
1617
*.ipr

build.gradle.kts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
plugins {
2+
id("mcp.dokka")
23
alias(libs.plugins.ktlint)
34
alias(libs.plugins.kover)
45
}
56

67
allprojects {
78
group = "io.modelcontextprotocol"
8-
version = "0.7.0"
9+
version = "0.7.2"
910
}
1011

1112
dependencies {
13+
dokka(project(":kotlin-sdk-core"))
14+
dokka(project(":kotlin-sdk-client"))
15+
dokka(project(":kotlin-sdk-server"))
16+
1217
kover(project(":kotlin-sdk-core"))
1318
kover(project(":kotlin-sdk-client"))
1419
kover(project(":kotlin-sdk-server"))
@@ -20,6 +25,14 @@ subprojects {
2025
apply(plugin = "org.jetbrains.kotlinx.kover")
2126
}
2227

28+
dokka {
29+
moduleName = "MCP Kotlin SDK"
30+
31+
dokkaPublications.html {
32+
includes.from("docs/moduledoc.md")
33+
}
34+
}
35+
2336
kover {
2437
reports {
2538
filters {

buildSrc/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ dependencies {
1212
implementation(libs.kotlin.serialization)
1313
implementation(libs.kotlinx.atomicfu.gradle)
1414
implementation(libs.dokka.gradle)
15-
implementation(libs.jreleaser.gradle)
16-
}
15+
implementation(libs.maven.publish)
16+
}

buildSrc/src/main/kotlin/mcp.dokka.gradle.kts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,35 @@ plugins {
55
}
66

77
dokka {
8-
moduleName.set("MCP Kotlin SDK - ${project.name}")
98

109
dokkaSourceSets.configureEach {
10+
includes.from("Module.md")
11+
12+
pluginsConfiguration.html {
13+
footerMessage = "Copyright © 2024-2025 Anthropic, PBC"
14+
}
15+
1116
sourceLink {
1217
localDirectory = projectDir.resolve("src")
1318
remoteUrl("https://github.com/modelcontextprotocol/kotlin-sdk/tree/main/${project.name}/src")
1419
remoteLineSuffix = "#L"
1520
}
1621

1722
documentedVisibilities(VisibilityModifier.Public)
18-
}
1923

20-
dokkaPublications.html {
21-
outputDirectory = rootProject.layout.projectDirectory.dir("docs/${project.name}")
24+
externalDocumentationLinks.register("ktor-client") {
25+
url("https://api.ktor.io/ktor-client/")
26+
packageListUrl("https://api.ktor.io/package-list")
27+
}
28+
29+
externalDocumentationLinks.register("kotlinx-coroutines") {
30+
url("https://kotlinlang.org/api/kotlinx.coroutines/")
31+
packageListUrl("https://kotlinlang.org/api/kotlinx.coroutines/package-list")
32+
}
33+
34+
externalDocumentationLinks.register("kotlinx-serialization") {
35+
url("https://kotlinlang.org/api/kotlinx.serialization/")
36+
packageListUrl("https://kotlinlang.org/api/kotlinx.serialization/package-list")
37+
}
2238
}
23-
}
39+
}

buildSrc/src/main/kotlin/mcp.jreleaser.gradle.kts

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

buildSrc/src/main/kotlin/mcp.multiplatform.gradle.kts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,6 @@ plugins {
1010
id("org.jetbrains.kotlinx.atomicfu")
1111
}
1212

13-
// Generation library versions
14-
val generateLibVersion by tasks.registering {
15-
val outputDir = layout.buildDirectory.dir("generated-sources/libVersion")
16-
outputs.dir(outputDir)
17-
18-
doLast {
19-
val sourceFile = outputDir.get().file("io/modelcontextprotocol/kotlin/sdk/LibVersion.kt").asFile
20-
sourceFile.parentFile.mkdirs()
21-
sourceFile.writeText(
22-
"""
23-
package io.modelcontextprotocol.kotlin.sdk
24-
25-
public const val LIB_VERSION: String = "${project.version}"
26-
27-
""".trimIndent()
28-
)
29-
}
30-
}
31-
3213
kotlin {
3314
jvm {
3415
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
@@ -41,10 +22,4 @@ kotlin {
4122

4223
explicitApi = ExplicitApiMode.Strict
4324
jvmToolchain(21)
44-
45-
sourceSets {
46-
commonMain {
47-
kotlin.srcDir(generateLibVersion)
48-
}
49-
}
5025
}

0 commit comments

Comments
 (0)