Smith
01/05/2020, 2:47 PMval someVersion: String by extra("1.2.3")
However, in childproj/build.gradle.kts:
val someVersion: String by extra
does not work, saying “Cannot get non-null extra property ‘someVersion’”
What’s the appropriate way to do variable inheritance?Czar
01/05/2020, 5:16 PMval someVersion: String by project
(project
delegate inherits properties from parent project, including extra
)
or direct access if you want to prevent a clash with something like `gradle.properties`:
val someVersion: String by rootProject.extra
Nicholas Bilyk
01/06/2020, 2:55 PMextra("1.2.3")
any properties you put in your gradle.properties will be available to all projects
gradle.properties
someVersion=1.2.3