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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With