All Downloads are FREE. Search and download functionalities are using the official Maven repository.

app.softwork.kobol.gradle.BuildTask.kt Maven / Gradle / Ivy

There is a newer version: 0.2.15
Show newest version
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)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy