main.name.remal.gradle_plugins.plugins.dependencies.AbstractMavenCentralComponentCapabilities.kt Maven / Gradle / Ivy
package name.remal.gradle_plugins.plugins.dependencies
import com.fasterxml.jackson.core.type.TypeReference
import name.remal.gradle_plugins.dsl.utils.getGradleLogger
import name.remal.gradle_plugins.dsl.utils.getPluginIdForLogging
import name.remal.gradle_plugins.utils.JSON_OBJECT_MAPPER
import org.gradle.api.Project
import org.gradle.api.artifacts.ModuleVersionIdentifier
import org.gradle.api.capabilities.MutableCapabilitiesMetadata
import kotlin.LazyThreadSafetyMode.NONE
abstract class AbstractMavenCentralComponentCapabilities(scope: String, project: Project) : AbstractComponentCapabilities(project) {
private val capabilitiesJsonResourceName = "resolution-rules/maven-central/$scope-capabilities.json"
private val capabilitiesMap: Map> by lazy(NONE) {
AbstractMavenCentralComponentCapabilities::class.java.classLoader
?.getResourceAsStream(capabilitiesJsonResourceName)
?.use { inputStream ->
return@lazy JSON_OBJECT_MAPPER.readValue(
inputStream,
object : TypeReference
© 2015 - 2024 Weber Informatics LLC | Privacy Policy