From 177ad3b526ee162bdf2c43ae3a3d0be547ad5446 Mon Sep 17 00:00:00 2001 From: Oleksandr Karpovich Date: Mon, 12 Sep 2022 14:20:09 +0200 Subject: [PATCH] Add NO_SKIKO platforms set in ComposePlatforms (#2307) * Add NO_SKIKO platforms set in ComposePlatforms They can be used to build and publish compose-runtime. Other compose modules can't be built for NO_SKIKO since those platforms are not supported by skiko yet. * Fix typi Co-authored-by: dima.avdeev <99798741+dima-avdeev-jb@users.noreply.github.com> Co-authored-by: Oleksandr Karpovich Co-authored-by: dima.avdeev <99798741+dima-avdeev-jb@users.noreply.github.com> --- compose/build.gradle.kts | 2 +- .../src/main/kotlin/ComposeComponent.kt | 4 +-- .../src/main/kotlin/ComposePlatforms.kt | 27 ++++++++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/compose/build.gradle.kts b/compose/build.gradle.kts index 6377e2773e..930f67e2c2 100644 --- a/compose/build.gradle.kts +++ b/compose/build.gradle.kts @@ -28,7 +28,7 @@ val mainComponents = ComposeComponent(":compose:material3:material3"), ComposeComponent(":compose:material:material-icons-core"), ComposeComponent(":compose:material:material-ripple"), - ComposeComponent(":compose:runtime:runtime"), + ComposeComponent(":compose:runtime:runtime", supportedPlatforms = ComposePlatforms.ALL), ComposeComponent(":compose:runtime:runtime-saveable"), ComposeComponent(":compose:ui:ui"), ComposeComponent(":compose:ui:ui-geometry"), diff --git a/compose/buildSrc/src/main/kotlin/ComposeComponent.kt b/compose/buildSrc/src/main/kotlin/ComposeComponent.kt index 752a99f0a8..2db69fd966 100644 --- a/compose/buildSrc/src/main/kotlin/ComposeComponent.kt +++ b/compose/buildSrc/src/main/kotlin/ComposeComponent.kt @@ -5,5 +5,5 @@ data class ComposeComponent( val path: String, - val supportedPlatforms: Set = ComposePlatforms.ALL -) \ No newline at end of file + val supportedPlatforms: Set = ComposePlatforms.ALL - ComposePlatforms.NO_SKIKO +) diff --git a/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt b/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt index 10930756c4..3abee57ad3 100644 --- a/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt +++ b/compose/buildSrc/src/main/kotlin/ComposePlatforms.kt @@ -15,7 +15,18 @@ enum class ComposePlatforms(vararg val alternativeNames: String) { MacosArm64("Macos"), UikitX64("UiKit"), UikitArm64("UiKit"), - UikitSimArm64("UiKit"); + UikitSimArm64("UiKit"), + TvosArm64("TvOs"), + TvosX64("TvOs"), + TvosSimulatorArm64("TvOs"), + WatchosArm64("WatchOs"), + WatchosArm32("WatchOs"), + WatchosX86("WatchOs"), + WatchosX64("WatchOs"), + WatchosSimulatorArm64("WatchOs"), + LinuxX64("Linux"), + MingwX64("Mingw"), + ; fun matches(nameCandidate: String): Boolean = listOf(name, *alternativeNames).any { it.equals(nameCandidate, ignoreCase = true) } @@ -34,6 +45,20 @@ enum class ComposePlatforms(vararg val alternativeNames: String) { ComposePlatforms.AndroidRelease ) + // These platforms are not supported by skiko yet + val NO_SKIKO = EnumSet.of( + ComposePlatforms.TvosArm64, + ComposePlatforms.TvosX64, + ComposePlatforms.TvosSimulatorArm64, + ComposePlatforms.WatchosArm64, + ComposePlatforms.WatchosArm32, + ComposePlatforms.WatchosX86, + ComposePlatforms.WatchosX64, + ComposePlatforms.WatchosSimulatorArm64, + ComposePlatforms.LinuxX64, + ComposePlatforms.MingwX64, + ) + /** * Maps comma separated list of platforms into a set of [ComposePlatforms] * The function is case- and whitespace-insensetive.