Gradle Concepts: Difference between revisions
Line 18: | Line 18: | ||
A build is a Gradle execution. Each build instantiates at least one [[Gradle Project#Overview|project]], which in turn contains [[Gradle Task#Overview|tasks]], and it can be configured and controlled with [[Gradle Runtime and Project Configuration#Overview|properties]]. | A build is a Gradle execution. Each build instantiates at least one [[Gradle Project#Overview|project]], which in turn contains [[Gradle Task#Overview|tasks]], and it can be configured and controlled with [[Gradle Runtime and Project Configuration#Overview|properties]]. | ||
<span id='Build_Initialization_Phase'></span><span id='Initialization'></span>'''Initialization phase''' | <span id='Build_Initialization_Phase'></span><span id='Initialization'></span>'''Initialization phase'''. [[Gradle Extra Properties#Overview|Extra properties]] for [[Org.gradle.api.invocation.Gradle|Gradle]] and [[Gradle_Settings|Settings]] object instances can be declared at this phase. | ||
<span id='Build_Configuration_Phase'></span><span id='Configuration'></span>'''Configuration phase'''. Tasks are [[Gradle_Task#Task_Lifecycle|instantiated and configured]]. | <span id='Build_Configuration_Phase'></span><span id='Configuration'></span>'''Configuration phase'''. Tasks are [[Gradle_Task#Task_Lifecycle|instantiated and configured]]. |
Revision as of 04:34, 5 October 2020
External
- API reference https://docs.gradle.org/current/javadoc/index.html
- DSL reference https://docs.gradle.org/current/dsl/
Internal
Overview
Gradle is a general-purpose build tool. It is primarily used to build Java and Groovy, but it can build other languages as well. The goal of a Gradle execution, also known as a Gradle build, is to execute a set of tasks, in sequence. Each build runs according to a well defined build lifecycle, during which Gradle instantiates a complex domain model of the project in memory: a Gradle instance, a Settings instance and the project itself.
Build Lifecycle
A build is a Gradle execution. Each build instantiates at least one project, which in turn contains tasks, and it can be configured and controlled with properties.
Initialization phase. Extra properties for Gradle and Settings object instances can be declared at this phase.
Configuration phase. Tasks are instantiated and configured.
Execution phase. Task actions are executed.
Convention over Configuration
Subjects
- Project, Dependencies and Configurations, Multi-Project Builds
- Task, Extending Gradle with a Custom Enhanced Task
- Gradle Runtime and Project Configuration
- Gradle Instance, Settings Instance
- Logging
- Plugins
- Extending Gradle
- Gradle File Resolution