diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f2836ef7..0fb31350 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,6 @@ ktlint = "14.2.0" knit = "0.5.1" mavenPublish = "0.36.0" netty = "4.2.12.Final" -openapi-generator = "7.21.0" # libraries version awaitility = "4.3.0" @@ -81,4 +80,3 @@ kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-co kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } knit = { id = "org.jetbrains.kotlinx.knit", version.ref = "knit" } -openapi-generator = { id = "org.openapi.generator", version.ref = "openapi-generator" } diff --git a/kotlin-sdk-core/.openapi-generator-ignore b/kotlin-sdk-core/.openapi-generator-ignore deleted file mode 100644 index dbdf9303..00000000 --- a/kotlin-sdk-core/.openapi-generator-ignore +++ /dev/null @@ -1,29 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -**/auth/** -**/infrastructure/** -!**/Base64ByteArray.kt -!**/Bytes.kt - - -## Exclude Models which are causing problems -**/JSONRPCResponse.kt -**/Result.kt -**/ListToolsResult.kt -**/InitializeRequest.kt -**/InitializeResult.kt -**/ServerCapabilities.kt -**/InitializeRequestParams.kt -**/CreateMessageRequest.kt -**/CreateMessageRequestParams.kt -**/ClientCapabilities.kt -**/Tool.kt -**/ToolInputSchema.kt -**/ToolOutputSchema.kt - diff --git a/kotlin-sdk-core/build.gradle.kts b/kotlin-sdk-core/build.gradle.kts index 0e702c47..f4a23148 100644 --- a/kotlin-sdk-core/build.gradle.kts +++ b/kotlin-sdk-core/build.gradle.kts @@ -7,62 +7,6 @@ plugins { id("mcp.publishing") id("mcp.dokka") alias(libs.plugins.kotlinx.binary.compatibility.validator) - alias(libs.plugins.openapi.generator) -} - -/* -tasks.withType>().configureEach { - dependsOn(tasks.openApiGenerate) -} - -tasks.named("runKtlintCheckOverCommonMainSourceSet") { - dependsOn(tasks.openApiGenerate) -} - -// Also ensure it runs before other relevant tasks -tasks.withType().configureEach { - dependsOn(tasks.openApiGenerate) -} - -tasks.withType().configureEach { - if (name.lowercase().contains("sourcesjar")) { - dependsOn(tasks.openApiGenerate) - } -} - */ - -openApiGenerate { - val schemaVersion = "2025-03-26" // or "2025-06-18" or "draft" - val schemaUrl = -// "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema/$schemaVersion/schema.json" - "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/tags/$schemaVersion/schema/$schemaVersion/schema.json" - generatorName = "kotlin" - remoteInputSpec = schemaUrl - outputDir = layout.buildDirectory.dir("generated-sources/openapi").get().asFile.absolutePath - packageName = "io.modelcontextprotocol.kotlin.sdk.models" - modelPackage = "io.modelcontextprotocol.kotlin.sdk.models" - apiPackage = "io.modelcontextprotocol.kotlin.sdk.api" - generateModelTests = false - generateModelDocumentation = false - cleanupOutput = false - skipValidateSpec = true // do not validate spec - library.set("multiplatform") - ignoreFileOverride.set("${layout.projectDirectory}/.openapi-generator-ignore") - globalProperties.set( - mapOf( - "supportingFiles" to "", - "models" to "", // or generate all models - ), - ) - configOptions.set( - mapOf( - "omitGradleWrapper" to "true", - "enumPropertyNaming" to "UPPERCASE", - "dateLibrary" to "kotlinx-datetime", - "explicitApi" to "true", - "modelMutable" to "false", - ), - ) } // Generation library versions