Skip to content

Commit

Permalink
Try another way
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Feb 4, 2024
1 parent 6fbe9b2 commit f8f9f1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- run: ./gradlew ${{ matrix.publish_command }} -Pplatform=${{ matrix.platform }} -PisCI -no-daemon --no-parallel --stacktrace
- run: ./gradlew ${{ matrix.publish_command }} -Pplatform=${{ matrix.platform }} -PisCI -no-daemon --stacktrace
26 changes: 13 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ subprojects {
plugin("signing")
}

val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)
val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}

publishing {
val user = System.getenv("SONATYPE_USERNAME")
val pass = System.getenv("SONATYPE_PASSWORD")
Expand Down Expand Up @@ -59,19 +66,7 @@ subprojects {
}

publications.withType<MavenPublication> {
val publication = this
val dokkaJar = project.tasks.register("${publication.name}DokkaJar", Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka into a Javadoc jar"
archiveClassifier.set("javadoc")
from(project.tasks.named("dokkaHtml"))

// Each archive name should be distinct, to avoid implicit dependency issues.
// We use the same format as the sources Jar tasks.
// https://youtrack.jetbrains.com/issue/KT-46466
archiveBaseName.set("${archiveBaseName.get()}-${publication.name}")
}
artifact(dokkaJar)
artifact(javadocJar)

pom {
name.set("pprint-kotlin")
Expand Down Expand Up @@ -146,4 +141,9 @@ subprojects {
mustRunAfter(it)
}
}

tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}
}

0 comments on commit f8f9f1c

Please sign in to comment.