diff --git a/build.gradle.kts b/build.gradle.kts index efa012a..624c474 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,14 @@ plugins { kotlin("jvm") version "1.9.10" + `maven-publish` + signing id("org.jlleitschuh.gradle.ktlint") version "11.6.1" id("com.github.ben-manes.versions") version "0.50.0" } group = "hu.webhejj.perspektive" -version = "1.0-SNAPSHOT" +version = "0.1.0" +description = "Perspektive is a diagramming tool written in Kotlin" repositories { mavenCentral() @@ -24,3 +27,55 @@ dependencies { tasks.withType { useJUnitPlatform() } + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + create("maven") { + from(components["java"]) + pom { + packaging = "jar" + name.set("perspektive") + description.set(project.description) + url.set("https://github.com/gnagy/perspektive") + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + id.set("gnagy") + name.set("Gergely Nagy") + email.set("greg@webhejj.hu") + } + } + scm { + connection.set("scm:git:git://github.com/gnagy/perspektive.git") + developerConnection.set("scm:git:ssh://github.com/gnagy/perspektive.git") + url.set("https://github.com/gnagy/perspektive") + } + } + } + } + + repositories { + maven { + name = "OSSRH" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = project.findProperty("ossrhUsername") as String? + password = project.findProperty("ossrhPassword") as String? + } + } + } +} + +signing { + sign(publishing.publications["maven"]) +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 3005371..a8893e1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,12 +1 @@ -pluginManagement { - repositories { - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" -} - rootProject.name = "perspektive"