<@U1E691HFV>, the spring DependencyManagementExten...
# gradle
b
@michael.barker, the spring DependencyManagementExtension requires a bit of Groovy magic to work
Copy code
// digging deep into the dependency-management plugin:
// <https://github.com/spring-gradle-plugins/dependency-management-plugin/blob/master/src/main/groovy/io/spring/gradle/dependencymanagement/DependencyManagementExtension.groovy#L50>
// which then delegates to ImportHandler as we can see in
// <https://github.com/spring-gradle-plugins/dependency-management-plugin/blob/master/src/main/groovy/io/spring/gradle/dependencymanagement/DependencyManagementHandler.groovy#L44>
// we cannot use gradle-script-kotlin closureOf because it relies on at least one argument
// to be passed in
configure<DependencyManagementExtension> {
    imports(delegateClosureOf<ImportsHandler> {
        mavenBom("org.springframework.cloud:spring-cloud-dependencies:Camden.RELEASE")
    })
}

fun <T> delegateClosureOf(action: T.() -> Unit) =
    object : groovy.lang.Closure<Unit>(null, null) {
        fun doCall() = (delegate as T).action()
    }