Skip to content

Commit

Permalink
Fix dependsOn
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisRev committed Jan 31, 2024
1 parent 2fd27f7 commit f4a8db0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
9 changes: 7 additions & 2 deletions build-src/src/main/kotlin/SignPublications.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven
import org.gradle.kotlin.dsl.configure
Expand All @@ -7,7 +8,7 @@ import org.gradle.kotlin.dsl.withType
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension

fun Project.signPublications() {
fun Project.signPublications(docsJar: Task) {
configure<SigningExtension> {
if (shouldSign) {
try {
Expand All @@ -16,7 +17,11 @@ fun Project.signPublications() {
useGpgCmd()
}
sign(project.extensions.getByName<PublishingExtension>("publishing").publications)
tasks.withType<AbstractPublishToMaven> { dependsOn(tasks.withType<Sign>()) }
tasks.withType<AbstractPublishToMaven> {
dependsOn(tasks.withType<Sign>())
dependsOn(docsJar)
}
tasks.withType<Sign> { dependsOn(docsJar) }
}
}
}
Expand Down
17 changes: 1 addition & 16 deletions build-src/src/main/kotlin/publish-gradle-plugin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,4 @@ val sourcesJar by project.tasks.creating(Jar::class) {

setupPublishing(docsJar, sourcesJar)

signPublications()

if (
project.name.contains("formatter") ||
project.name.contains("kotlin")
) {
println(project.name)
}

tasks.findByName(
"publishIo.arrow-kt.${project.name}PluginMarkerMavenPublication"
)?.apply { dependsOn(docsJar) }

tasks.findByName(
"signIo.arrow-kt.${project.name}PluginMarkerMavenPublication"
)?.apply { dependsOn(docsJar) }
signPublications(docsJar)
2 changes: 1 addition & 1 deletion build-src/src/main/kotlin/publish-kotlin-jvm.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ project.tasks.creating(Jar::class) {

setupPublishing(docsJar, sourcesJar, createMavenFromJava = true)

signPublications()
signPublications(docsJar)

if (
project.name.contains("formatter") ||
Expand Down

0 comments on commit f4a8db0

Please sign in to comment.