


If that particular task doesn’t have any snapshots of its input yet, or if the inputs have changed, the Gradle will run the task again. Before each task is run, Gradle saves a snapshot of the inputs used by the task.

Gradle accomplished this by tracking each tasks’ inputs and outputs. If we are going to change one of our layout files, we don’t have to compile our code again. Building our application requires compiling our code, generating source files, and packaging static resources into the final APK. So, don’t redo any work that has already been done the last time we executed our build.

We call the idea of only doing the minimum amount of work necessary Incremental Builds. It will be a huge impediment to the development process if our builds had to start from scratch every time. This is especially important during development when we run our builds often many times a day with some minor changes. The Gradle Build Language is also called The Gradle DSL (Domain Specific Language: that is finely tailored for a specific task, in this case, the domain we are talking about is an Android Build).Īs our builds become increasingly more complex, we want to ensure that we don’t redo any work that has already been done the last time we executed our build. The entire build script has what we call a delegate object, which exposes the Gradle Build Language to Groovy Scripting Language within the build script. The main thing we need to learn when using Gradle is the Gradle Build Language which is where the keywords like Android are coming from. Groovy integrates perfectly with Java which is the language that the Gradle platform is written in. It has a lot of syntactic sugar that looks a lot more like natural language when compared to using something like Java. It sits on top of a generic scripting language called Groovy. But it’s not a language that is developed from scratch. Gradle Scripts are written in a special purpose build language provided by Gradle.
