If you have variables defined in your gradle.properties
file, when is it necessary to use curly braces for variable substitution (e.g., "some string ${yourVariable}"
) and when is it okay to do without (e.g., "some string $yourVariable"
). Is it considered best practice to always use curly braces?
When do you need curly braces for variable substitution in Gradle?
Asked Answered
Is it considered best practice to always use curly braces?
Not necessarily. You can use curly braces all the time for consistency but I personally use them only when necessary.
Basically if any operation or method invocation is performed in interpolated expression you need to use curly braces. In all other cases it should just work. .
operator also doesn't require to use curly braces unless you navigate the properties.
It would be much easier to view the docs. What's also important it's that it's rather groovy question, not gradle.
Looks like I was looking in the wrong place. Thanks! –
Eggshaped
© 2022 - 2024 — McMap. All rights reserved.