From 1c3ca74bf467c69200a56ab0c2c8d00e8c29185f Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 18 Jul 2024 09:54:57 +0200 Subject: [PATCH] Cleanup OciImageInput/SpecResolution.kt --- .../gradle/oci/internal/resolution/OciImageInputResolution.kt | 4 +--- .../gradle/oci/internal/resolution/OciImageSpecResolution.kt | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageInputResolution.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageInputResolution.kt index 03dce33e..d3916d37 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageInputResolution.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageInputResolution.kt @@ -16,9 +16,7 @@ internal fun ResolvableDependencies.resolveOciImageInputs( ): Provider> { val rootComponentResultProvider = resolutionResult.rootComponent val imageSpecsProvider = - rootComponentResultProvider.zipAbsentAsNull(platformSelectorProvider) { rootComponentResult, platformSelector -> - resolveOciImageSpecs(rootComponentResult, platformSelector) - } + rootComponentResultProvider.zipAbsentAsNull(platformSelectorProvider, ::resolveOciImageSpecs) val artifactResultsProvider = artifactView { componentFilter( ArtifactViewVariantFilter( diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageSpecResolution.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageSpecResolution.kt index 8c9065be..8e1e848a 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageSpecResolution.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/resolution/OciImageSpecResolution.kt @@ -25,7 +25,7 @@ internal fun resolveOciImageSpecs( platformSelector: PlatformSelector?, ): List { val rootNodesToReferenceSpecs = resolveOciVariantGraph(rootComponentResult) - return resolveOciImageSpecs(rootNodesToReferenceSpecs, platformSelector) + return collectOciImageSpecs(rootNodesToReferenceSpecs, platformSelector) } private fun resolveOciVariantGraph( @@ -134,7 +134,7 @@ private val ResolvedVariantResult.platformOrUniversalOrMulti: String return capabilities.first().name.substringAfterLast('@') } -private fun resolveOciImageSpecs( +private fun collectOciImageSpecs( rootNodesToReferenceSpecs: Map>, platformSelector: PlatformSelector?, ): List {