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

com.github.bmsantos.gradle.cola.AbstractColaCompileTask.groovy Maven / Gradle / Ivy

Go to download

COLA Tests is a plugin that automatically injects BDD stories into normal JUnit POJOs.

There is a newer version: 0.5.0
Show newest version
package com.github.bmsantos.gradle.cola

import com.github.bmsantos.gradle.cola.provider.GradleColaProvider
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.incremental.IncrementalTaskInputs
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.TaskAction
import org.gradle.api.artifacts.ProjectDependency

import com.github.bmsantos.core.cola.main.ColaMain

abstract class AbstractColaCompileTask extends DefaultTask {

    def executeTask(String destinationDir, List deltas) {
        def classpathElements = []

        project.sourceSets.each { i ->
            String path = (i.output.classesDir as File).absolutePath
            classpathElements.add(path)
        }

        project.configurations.testRuntime.resolve().each { i ->
            classpathElements.add(i.absolutePath)
        }

        def provider = new GradleColaProvider(destinationDir, classpathElements, project.cola.includes, project.cola.excludes, deltas)

        def main = new ColaMain(project.cola.ideBaseClass, project.cola.ideTestMethod)
        main.execute(provider)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy