diff --git a/build.gradle.kts b/build.gradle.kts index e53fb3c..2b09e26 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,13 +14,19 @@ * limitations under the License. */ +import com.vanniktech.maven.publish.SonatypeHost + plugins { kotlin("jvm") id("org.jetbrains.kotlinx.kover") + id("com.vanniktech.maven.publish") } -group = "ch.icken" -version = "0.1.0-SNAPSHOT" +val groupId: String by project +setGroup(groupId) +val artifactId: String by project +val version: String by project +setVersion(version) repositories { mavenCentral() @@ -52,6 +58,40 @@ java { kotlin { jvmToolchain(17) } +mavenPublishing { + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, false) + + signAllPublications() + + coordinates(groupId, artifactId, version) + + pom { + name = artifactId + description = "A dynamic, type-safe way to write your queries" + url = "https://icken.ch/panache-kotlin-dsl" + + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + + developers { + developer { + id = "Thijsiez" + name = "Thijs Koppen" + email = "thijs.koppen@gmail.com" + } + } + + scm { + url = "https://github.com/Thijsiez/panache-kotlin-dsl" + connection = "scm:git:https://github.com/Thijsiez/panache-kotlin-dsl" + developerConnection = "scm:git:https://github.com/Thijsiez/panache-kotlin-dsl" + } + } +} tasks { test { diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index ef09181..d7ed1b3 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -26,9 +26,6 @@ plugins { id("org.sonarqube") } -group = "ch.icken" -version = "0.1.0-SNAPSHOT" - repositories { mavenCentral() } diff --git a/gradle.properties b/gradle.properties index 37dd244..4b2875c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,10 @@ # limitations under the License. # +groupId=ch.icken +artifactId=panache-kotlin-dsl +version=0.0.1 + #https://github.com/quarkusio/quarkus Pinned, do not change # Minimum, because of https://osv.dev/vulnerability/GHSA-f8h5-v2vg-46rr # Does not need to be upgraded since we only use the Panache API @@ -42,5 +46,7 @@ compileTestingVersion=1.5.0 #https://github.com/Kotlin/kotlinx-kover koverVersion=0.8.3 +#https://github.com/vanniktech/gradle-maven-publish-plugin +mavenPublishVersion=0.30.0 kotlin.code.style=official diff --git a/settings.gradle.kts b/settings.gradle.kts index 555e730..52530da 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,10 +23,13 @@ pluginManagement { plugins { val kotlinVersion: String by settings val koverVersion: String by settings + val mavenPublishVersion: String by settings kotlin("jvm") version kotlinVersion id("org.jetbrains.kotlinx.kover") version koverVersion + id("com.vanniktech.maven.publish") version mavenPublishVersion } } -rootProject.name = "panache-kotlin-dsl" +val artifactId: String by settings +rootProject.name = artifactId