Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scalatest): resolve issues with crossbuild signing #1111

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 45 additions & 32 deletions allure-scalatest/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.gradle.jvm.tasks.Jar

description = "Allure ScalaTest Integration"

plugins {
Expand All @@ -24,50 +22,63 @@ crossBuild {
}
}

val crossBuildScala_212Jar by tasks.getting
val crossBuildScala_213Jar by tasks.getting

val scaladocJar by tasks.creating(Jar::class) {
from(tasks.getByName("scaladoc"))
archiveClassifier.set("scaladoc")
tasks.publishMavenPublicationToMavenLocal {
enabled = false
}

tasks.withType<PublishToMavenLocal>().configureEach {
val predicate = provider {
publication != publishing.publications["maven"]
}
onlyIf("disable default maven publication") {
predicate.get()
}
tasks.publishMavenPublicationToSonatypeRepository {
enabled = false
}

tasks.withType<PublishToMavenRepository>().configureEach {
val predicate = provider {
publication != publishing.publications["maven"]
}
onlyIf("disable default maven publication") {
predicate.get()
}
tasks.signMavenPublication {
enabled = false
}
tasks.sourcesJar {
enabled = false
}

publishing {
publications {
create<MavenPublication>("crossBuildScala_212") {
from(components["crossBuildScala_212"])
artifact(scaladocJar)
artifact(tasks.sourcesJar)

val crossBuildScala_212SourcesJar by tasks.creating(Jar::class) {
from(sourceSets["crossBuildScala_212"].allSource)
archiveBaseName.set("allure-scalatest_$scala212")
archiveClassifier.set("sources")
}
artifact(crossBuildScala_212SourcesJar)

val crossBuildScala_212ScaladocJar by tasks.creating(Jar::class) {
from(tasks.scaladoc)
archiveBaseName.set("allure-scalatest_$scala212")
archiveClassifier.set("scaladoc")
}
artifact(crossBuildScala_212ScaladocJar)
}
create<MavenPublication>("crossBuildScala_213") {
from(components["crossBuildScala_213"])
artifact(scaladocJar)
artifact(tasks.sourcesJar)

val crossBuildScala_213SourcesJar by tasks.creating(Jar::class) {
from(sourceSets["crossBuildScala_213"].allSource)
archiveBaseName.set("allure-scalatest_$scala213")
archiveClassifier.set("sources")
}
artifact(crossBuildScala_213SourcesJar)

val crossBuildScala_213ScaladocJar by tasks.creating(Jar::class) {
from(tasks.scaladoc)
archiveBaseName.set("allure-scalatest_$scala213")
archiveClassifier.set("scaladoc")
}
artifact(crossBuildScala_213ScaladocJar)
}
}
}

signing {
sign(publishing.publications["crossBuildScala_212"])
sign(publishing.publications["crossBuildScala_213"])
sign(
publishing.publications["crossBuildScala_212"],
publishing.publications["crossBuildScala_213"]
)
}

dependencies {
Expand All @@ -88,9 +99,11 @@ dependencies {

tasks.jar {
manifest {
attributes(mapOf(
attributes(
mapOf(
"Automatic-Module-Name" to "io.qameta.allure.scalatest"
))
)
)
}
}

Expand Down
Loading