Skip to content

Commit

Permalink
Merge pull request #2 from gnagy/publish
Browse files Browse the repository at this point in the history
Set up artifact signing and publishing from gradle
  • Loading branch information
gnagy authored Nov 25, 2023
2 parents a3d61ca + dfb0efd commit 4554b56
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 12 deletions.
57 changes: 56 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -24,3 +27,55 @@ dependencies {
tasks.withType<Test> {
useJUnitPlatform()
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("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("[email protected]")
}
}
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"])
}
11 changes: 0 additions & 11 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}

rootProject.name = "perspektive"

0 comments on commit 4554b56

Please sign in to comment.