#152 ## Motivation and Context To simplify publishing, use the [recommended plugin](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-publish-libraries.html#set-up-the-publishing-plugin) ## 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
64 lines
1.8 KiB
Kotlin
64 lines
1.8 KiB
Kotlin
plugins {
|
|
`maven-publish`
|
|
id("com.vanniktech.maven.publish")
|
|
signing
|
|
}
|
|
|
|
mavenPublishing {
|
|
signAllPublications()
|
|
publishToMavenCentral(automaticRelease = true)
|
|
|
|
pom {
|
|
name = project.name
|
|
description = "Kotlin implementation of the Model Context Protocol (MCP)"
|
|
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
|
|
|
licenses {
|
|
license {
|
|
name = "MIT License"
|
|
url = "https://github.com/modelcontextprotocol/kotlin-sdk/blob/main/LICENSE"
|
|
distribution = "repo"
|
|
}
|
|
}
|
|
|
|
organization {
|
|
name = "Anthropic"
|
|
url = "https://www.anthropic.com"
|
|
}
|
|
|
|
developers {
|
|
developer {
|
|
id = "JetBrains"
|
|
name = "JetBrains Team"
|
|
organization = "JetBrains"
|
|
organizationUrl = "https://www.jetbrains.com"
|
|
}
|
|
}
|
|
|
|
scm {
|
|
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
|
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
|
|
developerConnection = "scm:git:git@github.com:modelcontextprotocol/kotlin-sdk.git"
|
|
}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
mavenLocal()
|
|
}
|
|
}
|
|
|
|
signing {
|
|
val gpgKeyName = "GPG_SIGNING_KEY"
|
|
val gpgPassphraseName = "SIGNING_PASSPHRASE"
|
|
val signingKey = providers.environmentVariable(gpgKeyName)
|
|
.orElse(providers.gradleProperty(gpgKeyName))
|
|
val signingPassphrase = providers.environmentVariable(gpgPassphraseName)
|
|
.orElse(providers.gradleProperty(gpgPassphraseName))
|
|
|
|
if (signingKey.isPresent) {
|
|
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
|
|
sign(publishing.publications)
|
|
}
|
|
}
|