Dariusz Kuc
05/13/2020, 3:43 AMfinalizedBy
always executes regardless whether finalized task succeeded or not - is there a way to ensure taskB
runs after taskA
only if taskA
is successful?
I’m trying to put ordering in publishing artifacts to maven central and Gradle plugin portal, was hoping I could order the tasks so that when I run ./gradlew publish
it will
1) initialize sonatype staging repo before publishing - [ok] root publish depends on intialize staging repo)
2) all subprojects attempt to publish their lib to maven central - [ok]
3) after publish is complete i need to close the staging repo - finalize doesn’t work as I don’t want to close the sonatype repo if publish failed
4) after this is complete I then want to publish my plugin to Gradle portal - was going to use publishPlugins
depends on closeStaging
and publish
is finalized by publishPlugins
but hit the same problem that I do not want to publish if it previous steps fail
Guess I should just stick to explicit tasks from command line? e.g.
./gradlew :initializeSonatypeStagingRepository publish :closeAndReleaseRepository publishPlugins
araqnid
05/13/2020, 7:56 AMmustRunAfter
? https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#org.gradle.api.Task:mustRunAfterDariusz Kuc
05/13/2020, 1:22 PMmustRunAfter
will work -> i.e. so i can say close repo must run after publish but if don’t invoke the close repo task it wont run (same thing with publish plugins)