hello! is there a way to finalize root module task...
# gradle
d
hello! is there a way to finalize root module task AFTER all child modules finish their tasks? e.g. would like to finalize
publish
with
closeAndReleaseRepository
(from
gradle-nexus-staging-plugin
) but it needs to run after ALL modules finish publishing their artifacts. Currently I’m explicitly running
gradle publish closeAndReleaseRepository
but wondering whether there is a better way
c
There is no
publish
in the root module, when you call:
./gradlew publish
you are just executing publish on all the Gradle modules
d
well my
dependsOn
clause for root
publish
works fine (i.e.
initializeSonatypeStagingRepository
)
but yeah there are no artifacts for root to be published
c
It seems you are applying the publishing plugin to the root project, so, yes, you have a publish task (that does nothing) at the root
d
So there is no clean way of updating build to finalize publish after all modules are published
c
I was looking for the documentation but I don't find it, Gradle suggests exposing a configuration from the projects and consuming it from the root in your case..
That's the thing, different tasks on different projects... You could declare a task on the root that depends on all the projects and is finelizedBy the close
d
I guess
Eh i think i'll keep explicit task invocation for publish + closerepo
1
Thanks!
c
BTW does anything enforce the order of the task or may it run before the publish finished?
d
i guess its just gradle running tasks in order they are specified