I am new to gradle. I have a boolean property in gradle.properties file. When I tried to access it, the property is set as string. The string property always seemed to be evaluated as true when the string is not null and not empty.
My gradle.properties looks like this
enableGradleApp=false
and my settings.gradle looks like
if (enableGradleApp) { println 'Enabled core' }
The message 'Enabled Core' is always gets printed.
Need some help please
When the Properties of your file are loaded you can use the Boolean -Class to get the Properties: Boolean. getBoolean("your. property");
properties in the project folder or in the C:\Users\Username. gradle.
I had the same problem, but I just converted it to boolean
like this:
if (enableGradleApp.toBoolean()) { .... }
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