Property management

We cannot make a software available on different operating systems, or different environments without configuring it dynamically. One approach to configure software is by using the properties file or environment properties. The following are the different ways Gradle provides to configure properties to build.gradle:

  • ext closure
  • gradle.properties
  • Command line
  • Custom properties file

ext closure

We saw many examples in Chapter 3, Managing Task, of adding custom properties to a project using the ext closure. Thus, we will not discuss the topic in this chapter.

gradle.properties

Gradle provides a default mechanism of reading the properties file using gradle.properties. You can add the gradle.properties file in any of the following locations: ...

Get Mastering Gradle 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.