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

com.teamscale.config.extension.TeamscaleTestImpactedTaskExtension.kt Maven / Gradle / Ivy

Go to download

A Gradle plugin that supports collecting Testwise Coverage and uploading reports to Teamscale.

There is a newer version: 29.0.0
Show newest version
package com.teamscale.config.extension

import com.teamscale.TestImpacted
import com.teamscale.config.AgentConfiguration
import com.teamscale.config.TestwiseCoverageConfiguration
import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension
import java.io.Serializable

/**
 * Holds all user configuration regarding testwise coverage report uploads.
 */
open class TeamscaleTestImpactedTaskExtension(
    val project: Project,
    jacocoExtension: JacocoTaskExtension,
    testImpactedTask: TestImpacted
) : Serializable {

    val report = TestwiseCoverageConfiguration(project, testImpactedTask)

    /** Configures the reports to be uploaded. */
    fun report(action: Action) {
        action.execute(report)
    }

    /** Overload for Groovy DSL compatibility. */
    fun report(closure: Closure<*>) {
        report { o -> project.configure(o, closure) }
    }

    /** Settings regarding the teamscale jacoco agent. */
    val agent = AgentConfiguration(project, jacocoExtension)

    /** Configures the jacoco agent options. */
    fun agent(action: Action) {
        action.execute(agent)
    }

    /** Overload for Groovy DSL compatibility. */
    fun agent(closure: Closure<*>) {
        agent { o -> project.configure(o, closure) }
    }
}







© 2015 - 2024 Weber Informatics LLC | Privacy Policy