Is there any method for executing some task after the build is done?
I have checked doLast
but it is only for tasks (task1.doLast(task2)
) and not for build...
A task's actions are run when the task is executed and must be added to the task's action list. This is done by using the task's doFirst, doLast or the << operator. Here is an example from the gradle documentation. I do agree that this is preferable when possible, but often some plugins etc.
You can execute multiple tasks from a single build file. Gradle can handle the build file using gradle command. This command will compile each task in such an order that they are listed and execute each task along with the dependencies using different options.
After reading and checking this the answer is build.finalizedBy(copyToLib)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With