Could this be a good approach?
# gradle
j
Could this be a good approach?
g
yes, looks better for me to have separate dsl for this
but again, same problem with not configurable configurations. But if you don’t need this, than it’s nice and will work on groovy and kotlin
j
Configuration over simplicity ⚖️
Do you have any idea how convert the code snippet to Kotlin?
g
yes, just create new extension for that
there is Java code, but Kotlin plugin can convert it to Kotlin
you register new extension and this extension has functions, such as
useSpringBootWeb
j
I figured that one out already.
Copy code
void useSpock(final String version = '0.7-groovy-2.0') {
        project.dependencies {
            testCompile "org.spockframework:spock-core:$version"
        }
    }
`
I mean this one.
This is what I’ve got right now
Copy code
open class SpringDependenciesDsl(private val project: Project) {
    init {
        project.repositories.mavenCentral()
    }

    fun useSpringBoot(version: String = "2.1.0") {
        project.dependencies (???)
    }