How to use ext in gradle in Android
Issue #338
Gradle uses Groovy and it has ext
, also known as ExtraPropertiesExtension
Additional, ad-hoc, properties for Gradle domain objects.
Extra properties extensions allow new properties to be added to existing domain objects. They act like maps, allowing the storage of arbitrary key/value pairs. All ExtensionAware Gradle domain objects intrinsically have an extension named “ext” of this type.
1 | project.ext { |
In root build.gradle
, ext
adds extra property to rootProject
object. There we can access rootProject.ext
or just ext
1 | ext { |
In module app/build.gradle
, ext
adds extra property to project
object. There we can access project.ext
or just ext
1 | ext { |