Gradle Concepts Flashcards

1
Q

Project

A

The Project interface is the main API interacted with from a build file.
Essentially a collection of Tasks
Has a one-to-one relationship with a build.gradle file
This is what’s configured with a build.gradle file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Task

A

A single atomic piece of work for a build, such as compiling classes or generating javadoc
Each task belongs to a Project. Can be created with methods on the TaskContainer as well as with the ‘task’ keyword in a build script.
A Task is made up of a sequence of Action objects. When a Task is executed, each of the actions is executed in turn, by calling Action.execute(T).
Groovy closures can be used to provide a task action. When the action is executed, the closure is called with the task as parameter.
Tasks may have dependencies on other tasks or might be scheduled to always run after another task.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Project Lifecycle

A
  • Create a Settings instance for the build.
  • Evaluate the “settings.gradle” script, if present, against the Settings object to configure it.
  • Use the configured Settings object to create the hierarchy of Project instances.
  • Finally, evaluate each Project by executing its “build.gradle” file, if present, against the project. The projects are evaluated in breadth-wise order, such that a project is evaluated before its child projects. This order can be overridden by calling evaluationDependsOnChildren() or by adding an explicit evaluation dependency using evaluationDependsOn(String).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly