ru.tinkoff.plugins.buildmetrics.gradle.internal.utils.ConfigurationCacheData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of build-metrics-gradle Show documentation
Show all versions of build-metrics-gradle Show documentation
Extension for tinkoff build metrics gradle plugin.
package ru.tinkoff.plugins.buildmetrics.gradle.internal.utils
import org.gradle.internal.configurationcache.ConfigurationCacheLoadBuildOperationType
import org.gradle.internal.configurationcache.ConfigurationCacheStoreBuildOperationType
import ru.tinkoff.plugins.buildmetrics.api.builds.internal.BuildOperationData
internal class ConfigurationCacheData(
val loaded: Boolean,
val stored: Boolean,
val reused: Boolean,
) {
internal class Builder {
private var loaded: Boolean = false
private var stored: Boolean = false
fun onBuildOperationData(data: BuildOperationData) {
when (data.details) {
is ConfigurationCacheLoadBuildOperationType.Details -> {
loaded = true
}
is ConfigurationCacheStoreBuildOperationType.Details -> {
stored = true
}
}
}
fun build(): ConfigurationCacheData = ConfigurationCacheData(
loaded = loaded,
stored = stored,
reused = loaded && stored.not(),
)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy