add ios and wasm targets (#81)
* add wasm and ios targets * add yarn.lock file to gitignore * clean up code * fix typo in method name * add wasm server example * update jrelease publishing for klibs * update gradle-publish workflow to use macos runner * update README to reflect multiplatform support and clarify server setup for JVM and WASM * remove the old main file from the kotlin-mcp-server example * update api dump * Refactor `build.gradle.kts` * clean up imports and remove unnecessary charset specification in tests * add JS target configuration and update API dump
This commit is contained in:
parent
7ce665b931
commit
0cff2ca718
1 changed files with 705 additions and 478 deletions
|
|
@ -1,35 +1,53 @@
|
|||
@file:OptIn(ExperimentalWasmDsl::class, ExperimentalKotlinGradlePluginApi::class)
|
||||
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "2.1.0"
|
||||
kotlin("plugin.serialization") version "2.1.0"
|
||||
application
|
||||
kotlin("multiplatform") version "2.1.20"
|
||||
kotlin("plugin.serialization") version "2.1.20"
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("MainKt")
|
||||
}
|
||||
|
||||
|
||||
group = "org.example"
|
||||
version = "0.1.0"
|
||||
|
||||
dependencies {
|
||||
implementation("io.modelcontextprotocol:kotlin-sdk:0.5.0")
|
||||
implementation("org.slf4j:slf4j-nop:2.0.9")
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
val jvmMainClass = "Main_jvmKt"
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
jvmToolchain(17)
|
||||
jvm {
|
||||
binaries {
|
||||
executable {
|
||||
mainClass.set(jvmMainClass)
|
||||
}
|
||||
}
|
||||
val jvmJar by tasks.getting(org.gradle.jvm.tasks.Jar::class) {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
doFirst {
|
||||
manifest {
|
||||
attributes["Main-Class"] = jvmMainClass
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
manifest {
|
||||
attributes["Main-Class"] = "MainKt"
|
||||
from(configurations["jvmRuntimeClasspath"].map { if (it.isDirectory) it else zipTree(it) })
|
||||
}
|
||||
}
|
||||
}
|
||||
wasmJs {
|
||||
nodejs()
|
||||
binaries.executable()
|
||||
}
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
||||
sourceSets {
|
||||
commonMain.dependencies {
|
||||
implementation("io.modelcontextprotocol:kotlin-sdk:0.5.0")
|
||||
}
|
||||
jvmMain.dependencies {
|
||||
implementation("org.slf4j:slf4j-nop:2.0.9")
|
||||
}
|
||||
wasmJsMain.dependencies {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue