We discussed in first chapter that a build file consists of three phases: initialization, configuration, and execution, which are explained briefly as follows:
The task API mainly defines two types of closures: doFirst
(Closure closure) and doLast
(Closure closure), which internally calls doFirst(Action action)
and doLast(Action action)
. You can mention either one or both of them.
Tip
Statements mentioned outside of these actions are part of your configuration, which are executed during the configuration phase.
To verify the configuration phase of a task, you can execute the build script using the --dry-run
or –m
option. The --dry-run
( or –m
) option only goes through the initialization...