tseisel
02/03/2020, 10:47 AMgradle.properties
:
com.foo.myproperty=bar
What is the idiomatic way to read that property from scripts ?
The property delegate syntax val myProperty by project
makes it mandatory to declare a variable with the same name as the property.
Moreover, it seems that there is no settings.property("com.foo.myproperty")
function.Czar
02/03/2020, 11:18 AMby settings
instead of by project
if your names are not compatible with kotlin var naming, then: extra["your.prop.name"]
in both project and settings, if you're nesting it you could spefity the receiver explicitely, just in case: settings.extra["..."]
gregorbg
02/03/2020, 11:22 AMfindProperty("com.foo.myproperty") as? String
jmfayard
02/03/2020, 1:51 PMtapchicoma
02/03/2020, 7:23 PMproject.properties["name.of.the.property"].toString()