Hello, whats the proper way to introduce task orde...
# gradle
d
Hello, whats the proper way to introduce task ordering in multi module project? e.g. based on the docs (https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:finalizer_tasks)
finalizedBy
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
Istr I’ve used that to get test suites run in the right order
d
👍
actually I don’t think
mustRunAfter
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)