Skip to content

Commit

Permalink
add pom metadata and ossrh repository for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Azpillaga Aldalur committed Feb 9, 2024
1 parent 9c7e013 commit 80553ab
Showing 1 changed file with 54 additions and 10 deletions.
64 changes: 54 additions & 10 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import java.net.URI

plugins {
id("org.jetbrains.kotlin.jvm") version "1.8.22"
id("org.jlleitschuh.gradle.ktlint") version "11.6.0"
id("maven-publish")
id("signing")
}

repositories {
Expand All @@ -24,28 +27,69 @@ tasks.register<Jar>("jarTest") {
archiveBaseName = "library-test"
}

java {
withSourcesJar()
withJavadocJar()
}

group = "com.strumenta.kolasu"
version = "1.0.0"

publishing {
repositories {
maven {
url = uri("https://maven.pkg.github.com/Strumenta/kolasu-languageserver-library")
name = "OSSRH"
url = URI("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = (if (extra.has("starlasu.github.user")) extra["starlasu.github.user"] else System.getenv("STRUMENTA_PACKAGES_USER")) as String?
password = (if (extra.has("starlasu.github.token")) extra["starlasu.github.token"] else System.getenv("STRUMENTA_PACKAGES_TOKEN")) as String?
username = project.properties["ossrhUser"] as String
password = project.properties["osshrPassword"] as String
}
}
}
publications {
create<MavenPublication>("language-server") {
groupId = "com.strumenta.kolasu"
artifactId = "language-server"
version = "0.0.0"
version = "1.0.0"

artifact(tasks.getByName("jar"))
artifact(tasks.getByName("sourcesJar"))
artifact(tasks.getByName("javadocJar"))

pom {
name = "Kolasu language server"
description = "Create a language server for parsers created with Kolasu"
inceptionYear = "2023"
url = "https://github.com/Strumenta/kolasu-languageserver-library"
licenses {
license {
name = "Apache License, Version 2.0"
url = "https://opensource.org/license/apache-2-0/"
}
}
developers {
developer {
id = "martin-azpillaga"
name = "Martin Azpillaga Aldalur"
email = "[email protected]"
}
}
scm {
url = "https://github.com/Strumenta/kolasu-languageserver-library.git"
connection = "scm:git:git:github.com/Strumenta/kolasu-languageserver-library.git"
developerConnection = "scm:git:ssh:github.com/Strumenta/kolasu-languageserver-library.git"
}
}
}
create<MavenPublication>("language-server-test") {
groupId = "com.strumenta.kolasu"
artifactId = "language-server-test"
version = "0.0.0"
artifact(tasks.getByName("jarTest"))
}
// create<MavenPublication>("language-server-test") {
// groupId = "com.strumenta.kolasu"
// artifactId = "language-server-test"
// version = "0.0.0"
// artifact(tasks.getByName("jarTest"))
// }
}
}

signing {
sign(publishing.publications.getByName("language-server"))
}

0 comments on commit 80553ab

Please sign in to comment.