In my settings.gradle.kts, I can do this to check ...
# gradle
e
In my settings.gradle.kts, I can do this to check if a property (in ~/gradle.properties) has been set, right?
Copy code
val artifactoryUsername : String? by settings
if(artifactoryUsername == null) {
   ...
How can I do the same in groovy dsl? (Sorry, not all builds converted to kotlin, yet)
j
I haven't used the Groovy DSL for a while, but I believe you can use
Copy code
if (project.hasProperty('artifactoryUsername')) {
   // do something
}
e
Thanks for the answer! Unfortunately, that works only in a build.gradle, but not in settings.gradle, because there is no project.
But in the meantime I found that settings.hasProperty(“foo”) works fine
c
Yup, that's it.
133 Views