jlleitschuh
01/09/2017, 5:32 PMval checkstyleConfig = configurations.getByName("checkstyle")
checkstyleConfig.dependencies.add(dependencies.create(group = "com.plexxi.plugins", name = "checkstyle-config", version = "1.1.2"))
val checkstyleResourcesDirectory = "${rootProject.buildDir}/checkstyleResources"
val copyCheckstyleResourcesTask = task<Sync>("copyCheckstyleResources") {
dependsOn(checkstyleConfig)
fun <T : Any> createClosure(action: Any.() -> T) =
object : groovy.lang.Closure<T>(this, this) {
fun doCall(): T = delegate.action()
}
from(createClosure {
checkstyleConfig.map(project::zipTree)
})
into(checkstyleResourcesDirectory)
}