Skip to content

Commit 8b5b58f

Browse files
committed
Add knit
1 parent 7bfd9fc commit 8b5b58f

File tree

9 files changed

+54
-5
lines changed

9 files changed

+54
-5
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
./gradlew --no-daemon \
4444
--rerun-tasks \
4545
clean \
46+
knit \
4647
ktlintCheck \
4748
build \
4849
-x :conformance-test:test \

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id("mcp.dokka")
3+
id("knit-convention")
34
alias(libs.plugins.ktlint)
45
alias(libs.plugins.kover)
56
}

buildSrc/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ dependencies {
1313
implementation(libs.kotlinx.atomicfu.gradle)
1414
implementation(libs.dokka.gradle)
1515
implementation(libs.maven.publish)
16+
implementation(libs.kotlinx.knit)
1617
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
id("org.jetbrains.kotlinx.knit")
3+
}
4+
knit {
5+
rootDir = projectDir
6+
files = fileTree(projectDir) {
7+
include("README.md")
8+
}
9+
defaultLineSeparator = "\n"
10+
siteRoot = "" // Disable site root validation
11+
}

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Knit-generated sources
2+
src/

docs/build.gradle.kts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
2+
3+
plugins {
4+
id("mcp.multiplatform")
5+
}
6+
7+
kotlin {
8+
jvm()
9+
10+
explicitApi = ExplicitApiMode.Disabled
11+
12+
sourceSets {
13+
jvmMain {
14+
dependencies {
15+
implementation(project(":kotlin-sdk"))
16+
implementation(libs.kotlinx.coroutines.core)
17+
implementation(libs.kotlinx.io.core)
18+
implementation(libs.ktor.server.core)
19+
implementation(libs.ktor.server.sse)
20+
}
21+
}
22+
}
23+
}
24+
25+
tasks.clean {
26+
delete("src")
27+
}

gradle/libs.versions.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[versions]
22
# plugins version
3-
kotlin = "2.2.21"
4-
dokka = "2.1.0"
53
atomicfu = "0.29.0"
6-
ktlint = "14.0.1"
4+
binaryCompatibilityValidatorPlugin = "0.18.1"
5+
dokka = "2.1.0"
6+
knit = "0.5.0"
7+
kotlin = "2.2.21"
78
kover = "0.9.3"
8-
netty = "4.2.7.Final"
9+
ktlint = "14.0.1"
910
mavenPublish = "0.35.0"
10-
binaryCompatibilityValidatorPlugin = "0.18.1"
11+
netty = "4.2.7.Final"
1112
openapi-generator = "7.17.0"
1213

1314
# libraries version
@@ -30,6 +31,7 @@ dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref
3031
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
3132
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
3233
kotlinx-atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }
34+
kotlinx-knit = { module = "org.jetbrains.kotlinx:kotlinx-knit", version.ref = "knit" }
3335
maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "mavenPublish" }
3436

3537
# Kotlinx libraries

knit.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Knit configuration
2+
knit.package = io.modelcontextprotocol.kotlin.sdk.examples
3+
knit.dir = docs/src/jvmMain/kotlin

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ include(
2323
":kotlin-sdk-server",
2424
":kotlin-sdk",
2525
":kotlin-sdk-test",
26+
":docs",
2627
":conformance-test",
2728
)

0 commit comments

Comments
 (0)