Skip to content

Commit

Permalink
Fix publish
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Dec 29, 2023
1 parent 59ce192 commit 12a7fbe
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 2 deletions.
79 changes: 78 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
`java-library`
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka") version "1.8.10"
id("org.jetbrains.dokka") version "1.9.10"
id("signing")
}

Expand Down Expand Up @@ -47,4 +47,81 @@ tasks.withType<Test>().configureEach {

kotlin {
jvmToolchain(8)
}

allprojects {

val varintName = project.name

apply {
plugin("org.jetbrains.kotlin.jvm")
plugin("org.jetbrains.dokka")
}

val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)

tasks {
val javadocJar by creating(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}
val sourcesJar by creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["kotlin"])
artifactId = varintName

artifact(tasks["javadocJar"])
artifact(tasks["sourcesJar"])

pom {
name.set("decomat")
description.set("DecoMat - Deconstructive Pattern Matching for Kotlin")
url.set("https://github.com/exoquery/decomat")

licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}

developers {
developer {
name.set("Alexander Ioffe")
email.set("[email protected]")
organization.set("github")
organizationUrl.set("http://www.github.com")
}
}

scm {
url.set("https://github.com/exoquery/decomat/tree/main")
connection.set("scm:git:git://github.com/ExoQuery/DecoMat.git")
developerConnection.set("scm:git:ssh://github.com:ExoQuery/DecoMat.git")
}
}
}
}
}

// Check the 'skipSigning' project property
if (!project.hasProperty("nosign")) {
// If 'skipSigning' is not present, apply the signing plugin and configure it
apply(plugin = "signing")

signing {
// use the properties passed as command line args
// -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
sign(publishing.publications["mavenJava"])
}
}
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}
rootProject.name = "KPrint"
rootProject.name = "pprint-kotlin"

0 comments on commit 12a7fbe

Please sign in to comment.