From 6ba538c467b2a52ca7c4e930871292fd245323e7 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov <654232+AlexeyTsvetkov@users.noreply.github.com> Date: Fri, 4 Feb 2022 11:25:28 +0300 Subject: [PATCH] Fix publishing multiple platforms that use same alternative name (#1790) -Pcompose.platforms=macos only matched MacosX64, when it was expected to match both MacosX64 & MacosArm64 --- compose/buildSrc/src/main/kotlin/ComposePlatforms.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt b/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt index e92a146499..516f439da5 100644 --- a/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt +++ b/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt @@ -48,9 +48,9 @@ enum class ComposePlatforms(vararg val alternativeNames: String) { return ALL } - val publication = ALL.firstOrNull { it.matches(name) } - if (publication != null) { - platforms.add(publication) + val matchingPlatforms = ALL.filter { it.matches(name) } + if (matchingPlatforms.isNotEmpty()) { + platforms.addAll(matchingPlatforms) } else { unknownNames.add(name) }