Move generateLibVersion task to kotlin-sdk-core (#274)

fix #272 

## How Has This Been Tested?
Locally

## Breaking Changes
No

## Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed
This commit is contained in:
Pavel Gorgulov 2025-09-16 16:17:36 +02:00 • committed by GitHub
commit 41fc351cd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,25 +10,6 @@ plugins {
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
@ -41,10 +22,4 @@ kotlin {
explicitApi = ExplicitApiMode.Strict
jvmToolchain(21)
sourceSets {
commonMain {
kotlin.srcDir(generateLibVersion)
}
}
}