Chapter 3.  Working with Gradle Build Scripts

A Gradle script is a program. We use a Groovy DSL to express our build logic. Gradle has several useful built-in methods to handle files and directories as we often deal with files and directories in our build logic.

In this chapter, we will discuss how to use Gradle's features to work with files and directories. We will also take a look at how to set properties in a Gradle build and use Gradle's logging framework. Finally, we see will how to use the Gradle Wrapper task to distribute a configurable Gradle with our build scripts.

Working with files

It is very common in a build script that we have to work with files and directories. For example, when we need to copy a file from one directory to another ...

Get Gradle Effective Implementations Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.