This message was deleted.
# plugin-development
s
This message was deleted.
e
example from kotlin:
Copy code
features {
  specialFeature(option1 = true, option2 = true)
}
then from groovy it just ends up being kind of a mess with context-less booleans
Copy code
features {
  specialFeature(true, true)
}
is there a way to get named parameters in groovy? or would the recommendation be to turn this into a closure for something more like this?
Copy code
features {
  specialFeature {
    option1 = true
    option2 = true
  }
}
c
don
don’t use groovy? 😅
e
real answers please?
c
breaking it down to avoid named parameters works (just did this elsewhere to Kotlin / Groovy)
t
"Named parameters" in Groovy are achieved through a java.util.Map as the first argument: https://groovy-lang.org/objectorientation.html#_named_parameters_2
e
ah interesting. so the IDE couldn’t help, but it would appear as if there were named params
not that the IDE really helps with groovy anyway
although what i was trying to avoid with the closure is missing required arguments, and i guess taking a map doesn’t solve that problem either
t
In any case, you'd have to handle that from your code and throw an exception.
e
yeah, fair enough. i wish build.gradle.kts files were handled better so kotlin could just do this for us 😕
c
I use @JvmOverloads for default values in a constructor, but maybe it's not needed