Task
Lets create 'Hello world' type of task.
When we run gradle tasks --all
, we should be able to see that task among other project tasks.
We can try to execute the task and see what happens. The task prints out 'Hello world' message in console.
Tasks using Ant
Ant is available in all Gradle builds.
Dynamic tasks
Taks can be created in dynamic way.
Run gradle tasks --all
to get all the available tasks. We should be able to see dynamically created tasks there.
Task dependencies
Tasks can be dependent on other tasks. There can be no circular dependencies (Gradle needs to be able to create an acyclic dependency graph).
Task abbreviation
Almost all the tasks are executable by its abbreviation. If there is conflict in abbreviation uniqueness, Gradle fails to run the task.
Exclude task from execution
Use -x
flag to say what tasks should be excluded from task execution.
Task graph
We can hook into the task execution graph.
Last updated
Was this helpful?