modularize sdk (#208)
* Modularize SDK: migrated client and server implementations to separate modules. Removed old configuration files and reorganized the source code structure * add support native targets and update js/wasm configurations * Refactor sample projects: add samples as composite builds, replace hardcoded dependencies with version catalog, remove obsolete gradle wrapper files * Update .gitignore: exclude SWE agent directories (.claude/ and .junie/) * Refine CodeQL workflow: update Kotlin build steps to target individual modules separately instead of building all at once
This commit is contained in:
parent
641df74f5d
commit
8698b96dd2
1 changed files with 979 additions and 2003 deletions
50
buildSrc/src/main/kotlin/mcp.multiplatform.gradle.kts
Normal file
50
buildSrc/src/main/kotlin/mcp.multiplatform.gradle.kts
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
@file:OptIn(ExperimentalWasmDsl::class)
|
||||
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("org.jetbrains.kotlinx.atomicfu")
|
||||
}
|
||||
|
||||
// Generation library versions
|
||||
val generateLibVersion by tasks.registering {
|
||||
val outputDir = layout.buildDirectory.dir("generated-sources/libVersion")
|
||||
outputs.dir(outputDir)
|
||||
|
||||
doLast {
|
||||
val sourceFile = outputDir.get().file("io/modelcontextprotocol/kotlin/sdk/LibVersion.kt").asFile
|
||||
sourceFile.parentFile.mkdirs()
|
||||
sourceFile.writeText(
|
||||
"""
|
||||
package io.modelcontextprotocol.kotlin.sdk
|
||||
|
||||
public const val LIB_VERSION: String = "${project.version}"
|
||||
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm {
|
||||
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
|
||||
}
|
||||
macosX64(); macosArm64()
|
||||
linuxX64(); linuxArm64()
|
||||
mingwX64()
|
||||
js { nodejs() }
|
||||
wasmJs { nodejs() }
|
||||
|
||||
explicitApi = ExplicitApiMode.Strict
|
||||
jvmToolchain(21)
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
kotlin.srcDir(generateLibVersion)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue