getProperty

fun Project.getProperty(name: String): Provider<String>

Get a property with the exact name or the name transformed to SCREAMING_CASE, for example, some.prop or SOME_PROP with this ordering:

  • Gradle properties from CLI

  • Environment variables

  • Properties from gradle-local.properties files

  • Properties from local.properties files

  • Properties from gradle.properties files

For any kind of file the function tries to find the property in the file next to the project, so it checks for the project file, later its parent, and so on until stop in the root directory.

An example of priority

  • /foo/bar/gradle.properties

  • /foo/gradle.properties

  • /gradle.properties

In the previous example, /foo/bar/gradle.properties file has priority, if it wasn't there, then /foo/gradle.properties would have the priority, and if it wasn't there, then /gradle.properties would have the priority.


fun Settings.getProperty(name: String): Provider<String>