Skip to content

Commit

Permalink
Trying to configure publish
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Jan 28, 2024
1 parent 8e1a687 commit 213a674
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 72 deletions.
124 changes: 53 additions & 71 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ plugins {
signing
kotlin("multiplatform") version "1.9.22" apply false
id("io.kotest.multiplatform") version "5.8.0" apply false
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka") version "1.8.10"
}

allprojects {
Expand All @@ -15,82 +17,62 @@ allprojects {
}
}

//subprojects {
// val varintName = project.name
//
// apply {
// plugin("org.jetbrains.dokka")
// plugin("maven-publish")
// }
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}

// val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)
subprojects {
//val varintName = project.name

// 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)
// }
// }
apply {
plugin("org.jetbrains.dokka")
plugin("maven-publish")
plugin("signing")
}

// 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")
// }
// }
// }
// }
// }
publishing {
publications.withType<MavenPublication> {
pom {
name.set("decomat")
description.set("DecoMat - Deconstructive Pattern Matching for Kotlin")
url.set("https://github.com/deusaquilus/pprint-kotlin")

// // 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"])
// }
// }
//}
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")
}
}
}
}

signing {
sign(publishing.publications)
}

tasks.withType<Sign> {
onlyIf { !project.hasProperty("nosign") }
}
}
3 changes: 2 additions & 1 deletion pprint-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.AbstractDokkaTask
import org.jetbrains.dokka.gradle.DokkaTask

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -59,4 +61,3 @@ tasks.withType<AbstractTestTask>().configureEach {
events(TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}

20 changes: 20 additions & 0 deletions pprint-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTask

plugins {
kotlin("jvm")
`java-library`
Expand All @@ -16,3 +18,21 @@ dependencies {
implementation(kotlin("reflect"))
implementation(project(":pprint-core"))
}

allprojects {

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)
}
}

}

0 comments on commit 213a674

Please sign in to comment.