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

ru.tinkoff.plugins.buildmetrics.api.extensions.BuildMetricsExtension.kt Maven / Gradle / Ivy

The newest version!
package ru.tinkoff.plugins.buildmetrics.api.extensions

import org.gradle.api.Action
import org.gradle.api.model.ObjectFactory
import org.gradle.kotlin.dsl.newInstance
import ru.tinkoff.plugins.buildmetrics.api.extensions.handlers.BuildHandlersHandler
import ru.tinkoff.plugins.buildmetrics.api.extensions.handlers.LabelsHandler
import ru.tinkoff.plugins.buildmetrics.api.extensions.handlers.MetricsHandler
import ru.tinkoff.plugins.buildmetrics.api.extensions.handlers.PublishersHandler
import javax.inject.Inject

open class BuildMetricsExtension @Inject constructor(objectFactory: ObjectFactory) {

    val metrics: MetricsHandler = objectFactory.newInstance()

    val labels: LabelsHandler = objectFactory.newInstance()

    val publishers: PublishersHandler = objectFactory.newInstance()

    val buildHandlers: BuildHandlersHandler = objectFactory.newInstance()

    fun metrics(action: Action) = action.execute(metrics)

    fun labels(action: Action) = action.execute(labels)

    fun publishers(action: Action) = action.execute(publishers)

    fun buildHandlers(action: Action) = action.execute(buildHandlers)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy