Unverified Commit 447436f3 authored by Igor Demin's avatar Igor Demin Committed by GitHub

Fix signKotlinMultiplatformPublication on CI (2) (#1127)

Reverts JetBrains/skiko#1126 with additional fixes

Fixes:
```
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':signKotlinMultiplatformPublication' (type 'Sign').
  - Gradle detected a problem with the following location: '/mnt/agent/work/381d14fe560aa354/skiko/build/libs/skiko-0.9.33-javadoc.jar.asc'.

    Reason: Task ':publishAwtRuntimeElementsPublicationToComposeRepoRepository' uses this output of task ':signKotlinMultiplatformPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
```

Part of [SKIKO-530](https://youtrack.jetbrains.com/issue/SKIKO-530)
support for all platforms of awt-runtime in one jar

## Testing
- doesn't fail on configuration stage:
```
./gradlew publishAwtRuntimeElementsPublicationToMavenLocal -Pmaven.central.sign=true -Pmaven.central.sign.key=TEST -Pmaven.central.sign.password=TEST
```
- [CI is
successful](https://buildserver.labs.intellij.net/buildConfiguration/Skiko_PublishSnapshot/827040952)
parent c2cc37a0
...@@ -269,15 +269,25 @@ fun Project.configureSignAndPublishDependencies() { ...@@ -269,15 +269,25 @@ fun Project.configureSignAndPublishDependencies() {
tasks.configureEach { tasks.configureEach {
val publishKmp = "publishKotlinMultiplatformPublicationTo" val publishKmp = "publishKotlinMultiplatformPublicationTo"
val publishAwt = "publishAwtPublicationTo" val publishAwt = "publishAwtPublicationTo"
val publishAwtRuntimeElements = "publishAwtRuntimeElementsPublicationTo"
val signKmp = "signKotlinMultiplatformPublication" val signKmp = "signKotlinMultiplatformPublication"
val signAwt = "signAwtPublication" val signAwt = "signAwtPublication"
val signAwtRuntimeElements = "signAwtRuntimeElementsPublication"
when { when {
name.startsWith(publishKmp) -> { name.startsWith(publishKmp) -> {
if (supportAwt) dependsOn(signAwt) if (supportAwt) {
dependsOn(signAwt)
dependsOn(signAwtRuntimeElements)
}
} }
name.startsWith(publishAwt) -> { name.startsWith(publishAwt) -> {
dependsOn(signKmp) dependsOn(signKmp)
dependsOn(signAwtRuntimeElements)
}
name.startsWith(publishAwtRuntimeElements) -> {
dependsOn(signAwt)
dependsOn(signKmp)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment