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

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

There is a newer version: 0.2.15
Show newest version
package app.softwork.kobol.gradle

import org.gradle.api.*
import org.gradle.api.file.*
import org.gradle.api.provider.*
import org.gradle.api.tasks.*
import org.gradle.workers.*
import javax.inject.*

@CacheableTask
public abstract class KobolTask : DefaultTask() {
    init {
        group = "kobol"
    }

    @get:InputFiles
    @get:SkipWhenEmpty
    @get:IgnoreEmptyDirectories
    @get:PathSensitive(PathSensitivity.RELATIVE)
    public abstract val sources: ConfigurableFileCollection

    @get:OutputDirectory
    public abstract val outputFolder: DirectoryProperty

    @get:Optional
    @get:OutputDirectory
    public abstract val sqlFolder: DirectoryProperty

    @get:Classpath
    internal abstract val classpath: ConfigurableFileCollection

    @get:Input
    public abstract val pluginConfiguration: MapProperty>

    @get:Inject
    internal abstract val workerExecutor: WorkerExecutor

    @TaskAction
    internal fun generate() {
        workerExecutor.classLoaderIsolation {
            classpath.from([email protected])
        }.submit(ExecuteKobol::class.java) {
            inputFiles.setFrom(sources)
            outputFolder.set([email protected])
            sqlFolder.set([email protected])
            config.set(pluginConfiguration)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy