In Gradle there are plenty of hooks. But I can't understand exactly when they are applied. From the docs I found hooks for the build and for a project:
For project
So I tried to make representation of figure from the book Gradle in Action (Muschko, Benjamin. "Hooking into the Build Lifecycle." Gradle in Action. N.p.: n.p., 2014. 100. Print.) to receive better idea for the whole picture when and where the hooks are apply?
So when the hook are added and if there other build, project hooks?
Gradle Builds and Android StudioThe build system allows you to define flexible custom build configurations. Each build configuration can define its own set of code and resources while reusing the parts that are common to all versions of your app. Gradle and the Android plugin run independent of Android Studio.
Every Gradle build proceeds through three lifecycle phases in precisely the same order. These phases are initialization, configuration, and execution. During the initialization phase, Gradle starts up and locates the build files it must process.
afterEvaluate , which runs after a particular project has been configured, there is also a gradle.
Every Gradle build consists of three basic building blocks: projects, tasks, and properties.
Looks about right. (I assume the question is when callbacks are executed.) gradle.projectsLoaded
needs to go between initialization and configuration phase. gradle.beforeProject
happens at certain points during the configuration phase. Check out Gradle
in the Gradle Build Language Reference for other callbacks.
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