app.softwork.kobol.gradle.BuildTask.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-plugin Show documentation
Show all versions of gradle-plugin Show documentation
A Cobol to Kotlin converter
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)
}
}