From 6b88c726e2fe2009f23fee12d3423b0fdfccc912 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 18 Jul 2024 11:35:07 +0200 Subject: [PATCH] Cleanup OciRepositoryHandler --- .../oci/internal/registry/OciRepositoryHandler.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/registry/OciRepositoryHandler.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/registry/OciRepositoryHandler.kt index 9491660a..b0ca592f 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/registry/OciRepositoryHandler.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/registry/OciRepositoryHandler.kt @@ -372,24 +372,18 @@ private fun JsonObjectStringBuilder.addCapabilities( componentId: VersionedCoordinates, ) { if (capabilities != setOf(componentId)) { - addCapabilities(key, capabilities, "") + addCapabilities(key, capabilities, null) } } private fun JsonObjectStringBuilder.addCapabilities( key: String, capabilities: Set, - platform: Platform, -) = addCapabilities(key, capabilities, createPlatformPostfix(platform)) - -private fun JsonObjectStringBuilder.addCapabilities( - key: String, - capabilities: Set, - featureName: String, + platform: Platform?, ) = addArray(key, capabilities) { capability -> addObject { addString("group", capability.group) - addString("name", capability.name + featureName) + addString("name", capability.name + createPlatformPostfix(platform)) addString("version", capability.version) } }