Rewrite kotlin-reflect build script from Groovy to Kotlin

This commit is contained in:
Alexander Udalov
2017-11-22 11:11:59 +01:00
parent 885ddc49a2
commit a1f895bb1f
3 changed files with 164 additions and 109 deletions
+4
View File
@@ -1,5 +1,6 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import groovy.lang.Closure
import org.gradle.api.*
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
@@ -11,6 +12,9 @@ import java.io.File
inline fun <reified T : Task> Project.task(noinline configuration: T.() -> Unit) = tasks.creating(T::class, configuration)
fun Project.callGroovy(name: String, vararg args: Any?): Any? {
return (property(name) as Closure<*>).call(*args)
}
fun AbstractTask.dependsOnTaskIfExists(task: String, project: Project?, parentProject: Project?) {
val thisTask = this