1+ import org.jreleaser.model.Active.ALWAYS
2+ import org.jreleaser.model.Active.NEVER
3+
14plugins {
5+ java
6+ application
7+ `maven- publish`
8+ signing
9+ jacoco
210 kotlin(" jvm" ) version " 2.1.0"
311 kotlin(" plugin.serialization" ) version " 2.1.0"
412 id(" com.diffplug.spotless" ) version " 7.0.3"
5- application
13+ id(" pl.allegro.tech.build.axion-release" ) version " 1.18.7"
14+ id(" org.jreleaser" ) version " 1.17.0"
615}
716
8- group = " mcp.code.analysis"
17+ scmVersion {
18+ unshallowRepoOnCI.set(true )
19+ tag { prefix.set(" v" ) }
20+ }
921
10- version = " 1.0-SNAPSHOT"
22+ group = " io.github.eschizoid"
23+
24+ version = rootProject.scmVersion.version
25+
26+ description = " MCP Server for GitHub Code Repositories Analysis"
1127
1228dependencies {
1329 // Kotlin standard library
@@ -29,18 +45,21 @@ dependencies {
2945
3046 // Logging
3147 implementation(" ch.qos.logback:logback-classic:1.5.18" )
48+ implementation(" org.slf4j:jul-to-slf4j:2.0.17" )
3249
3350 // Coroutines
34- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 " )
51+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 " )
3552
3653 // Serialization
37- implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0 " )
54+ implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1 " )
3855
3956 // JGit for repository interaction
4057 implementation(" org.eclipse.jgit:org.eclipse.jgit:7.2.1.202505142326-r" )
4158
4259 // Testing
4360 testImplementation(kotlin(" test" ))
61+ testImplementation(" io.mockk:mockk:1.14.2" )
62+ testImplementation(" io.ktor:ktor-client-mock-jvm:$ktorVersion " )
4463}
4564
4665application { mainClass.set(" MainKt" ) }
@@ -57,7 +76,11 @@ tasks.jar {
5776
5877tasks.test { useJUnitPlatform() }
5978
60- kotlin { jvmToolchain(23 ) }
79+ java {
80+ withSourcesJar()
81+ withJavadocJar()
82+ toolchain { languageVersion = JavaLanguageVersion .of(23 ) }
83+ }
6184
6285spotless {
6386 kotlin {
@@ -79,3 +102,89 @@ spotless {
79102 target(" *.gradle.kts" )
80103 }
81104}
105+
106+ signing {
107+ afterEvaluate { sign(publishing.publications[" maven" ]) }
108+
109+ val signingKey = System .getenv(" JRELEASER_GPG_SECRET_KEY" ) ? : project.properties[" signing.secretKey" ]?.toString()
110+ val signingPassword = System .getenv(" JRELEASER_GPG_PASSPHRASE" ) ? : project.properties[" signing.password" ]?.toString()
111+
112+ if (signingKey != null && signingPassword != null ) {
113+ useInMemoryPgpKeys(signingKey, signingPassword)
114+ }
115+ }
116+
117+ publishing {
118+ publications {
119+ create<MavenPublication >(" maven" ) {
120+ groupId = " io.github.eschizoid"
121+ artifactId = " mcp-github-code-analyzer"
122+ from(components[" java" ])
123+
124+ pom {
125+ name.set(" mcp-github-code-analyzer" )
126+ description.set(" MCP Server for GitHub Code Repositories Analysis" )
127+ url.set(" https://github.com/eschizoid/mcp-github-code-analyzer" )
128+ inceptionYear.set(" 2025" )
129+
130+ licenses {
131+ license {
132+ name.set(" Apache License 2.0" )
133+ url.set(" https://www.apache.org/licenses/LICENSE-2.0" )
134+ }
135+ }
136+
137+ developers {
138+ developer {
139+ id.set(" eschizoid" )
140+ name.set(" Mariano Gonzalez" )
141+ email.set(" mariano.gonzalez.mx@gmail.com" )
142+ }
143+ }
144+
145+ scm {
146+ connection.set(" scm:git:git://github.com/eschizoid/mcp-github-code-analyzer.git" )
147+ developerConnection.set(" scm:git:ssh://github.com/eschizoid/mcp-github-code-analyzer.git" )
148+ url.set(" https://github.com/eschizoid/mcp-github-code-analyzer" )
149+ }
150+ }
151+ }
152+ }
153+
154+ repositories { maven { url = uri(layout.buildDirectory.dir(" staging-deploy" )) } }
155+ }
156+
157+ jreleaser {
158+ project {
159+ name.set(" mcp-github-code-analyzer" )
160+ description.set(" MCP Server for GitHub Code Repositories Analysis" )
161+ authors.set(listOf (" Mariano Gonzalez" ))
162+ license.set(" Apache-2.0" )
163+ links { homepage.set(" https://github.com/eschizoid/mcp-github-code-analyzer" ) }
164+ inceptionYear.set(" 2025" )
165+ tags.set(listOf (" MCP" , " LLM" , " Ollama" , " kotlin" , " github" , " code analysis" ))
166+ }
167+
168+ signing { active.set(NEVER ) }
169+
170+ deploy {
171+ maven {
172+ mavenCentral {
173+ create(" sonatype" ) {
174+ active.set(ALWAYS )
175+ url.set(" https://central.sonatype.com/api/v1/publisher" )
176+ stagingRepository(" build/staging-deploy" )
177+ enabled.set(true )
178+ sign.set(false )
179+ }
180+ }
181+ }
182+ }
183+
184+ release {
185+ github {
186+ enabled.set(true )
187+ overwrite.set(false )
188+ }
189+ }
190+ }
0 commit comments