-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing Action<T> when configuring nested extensions #187
Comments
Thanks for the suggestion. We accept PRs. |
I'm having a look. Is there a tidier way to do this? /**
* Allows programmatic configuration of the analyzer extension
* @param configAction the action to configure the analyzers extension
* @return the analyzers extension
*/
def analyzers(Action<? super AnalyzerExtension> configAction) {
configAction.execute(analyzers)
return analyzers
} The existing ones using |
For the Kotlin DSL I have to use dependencyCheck {
analyzers(closureOf<AnalyzerExtension> {
assemblyEnabled = false
})
} |
… non-Groovy consumers (dependency-check#187)
Could someone please document the use of Action iface as it is not intuitive enough for Gradle/Groovy users? |
If you're using configuring the plugin using Java code, you really want to write things like this:
But currently you can't, because the
cve
method only takesClosure
, making it only callable from Groovy.All methods to configure extensions should have overloads taking
Action<T>
. This might affect Kotlin build scripts too but I haven't found out yet because other things break those anyway.The text was updated successfully, but these errors were encountered: