app.softwork.kobol.gradle.BuildTask.kt Maven / Gradle / Ivy
package app.softwork.kobol.gradle
import org.gradle.api.provider.*
import org.gradle.api.tasks.*
import org.gradle.work.*
@DisableCachingByDefault
public abstract class BuildTask : KobolRunTask() {
@get:Internal
public abstract val c89Options: Property
@get:Internal
public abstract val c89: ListProperty
@get:Internal
public abstract val cob2Options: Property
@get:Internal
public abstract val cob2: ListProperty
private fun Provider>.options(options: Provider): Provider> =
zip(options) { list, options ->
list.map {
"$options $it"
}
}
private operator fun Provider>.plus(other: Provider>): Provider> =
zip(other) { a, b ->
a + b
}
init {
val c89cmd = c89.options(c89Options)
val cob2cmd = cob2.options(cob2Options)
cmds.convention(c89cmd + cob2cmd)
}
}