Skip to content

Commit

Permalink
Register javadoc and sources after evaluating project
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Feb 28, 2024
1 parent c76d0a4 commit 28038a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,18 @@ class SonatypePlugin : Plugin<Project> {
apply(plugin = "org.gradle.maven-publish")

tasks.findByName("dokka")?.apply {
tasks.creating(Jar::class) {
tasks.create("javadocJar", Jar::class.java) {
archiveClassifier.set("javadoc")
from(this)
}
}

configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
// JavaPlugin might not have been applied yet
project.afterEvaluate {
configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
}
}

configure<PublishingExtension> {
Expand Down

0 comments on commit 28038a8

Please sign in to comment.