Arkadii Ivanov
05/04/2022, 11:08 PMjavaMain
), but keep assembling a normal iOS framework (to be consumed from an XCode project with SwiftUI), and also use Kotlin/React for UI in jsMain
. I managed to put the Compose code into javaMain
and android
and desktop
target compile just fine. I also managed to disable the Compose plugin for JS by adding compose.web.targets()
, and it also compiles just fine. But I can't find a way to disable the Compose plugin for iOS. My iOS build fails with:
Compilation failed: Cannot find the Composer class in the classpath
Is there any workaround? I'm using Compose 1.1.1
.Thomas
05/04/2022, 11:21 PMconfigurations.all {
// Exclude native compiler
exclude("org.jetbrains.compose.compiler", "compiler-hosted")
}
Arkadii Ivanov
05/04/2022, 11:24 PMThomas
05/04/2022, 11:25 PMArkadii Ivanov
07/14/2022, 6:36 PMThomas
07/14/2022, 7:02 PMimport org.jetbrains.compose.ComposeCompilerKotlinSupportPlugin
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerPluginSupportPlugin
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
plugins {
// ... other plugins
id("org.jetbrains.compose") version "1.2.0-alpha01-dev741"
}
// Exclude native compiler
plugins.removeAll { it is ComposeCompilerKotlinSupportPlugin }
class ComposeNoNativePlugin : KotlinCompilerPluginSupportPlugin by ComposeCompilerKotlinSupportPlugin() {
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
return when (kotlinCompilation.target.platformType) {
KotlinPlatformType.native -> false
else -> ComposeCompilerKotlinSupportPlugin().isApplicable(kotlinCompilation)
}
}
}
apply<ComposeNoNativePlugin>()
Arkadii Ivanov
07/14/2022, 7:13 PM