Browse Source
* Add a check that compose is used along with kotlinx.serialization There's a known issue that both plugins can't be used in the same module (specifically for kotlin/js targets). The compose gradle plugin will check for `kotlinx.serialization` and will show a warning. * Fix PR suggestions * Update WarnAboutComposeWithSerialization.kt Update the link for the issue Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>pull/942/head
Oleksandr Karpovich
3 years ago
committed by
GitHub
2 changed files with 21 additions and 0 deletions
@ -0,0 +1,18 @@
|
||||
package org.jetbrains.compose.internal |
||||
|
||||
import org.gradle.api.Project |
||||
|
||||
internal fun Project.checkAndWarnAboutComposeWithSerialization() { |
||||
project.plugins.withId("org.jetbrains.kotlin.plugin.serialization") { |
||||
val warningMessage = """ |
||||
|
||||
>>> COMPOSE WARNING |
||||
>>> Project `${project.name}` has `compose` and `kotlinx.serialization` plugins applied! |
||||
>>> Consider using these plugins in separate modules to avoid compilation errors |
||||
>>> Check more details here: https://github.com/JetBrains/compose-jb/issues/738 |
||||
|
||||
""".trimIndent() |
||||
|
||||
logger.warn(warningMessage) |
||||
} |
||||
} |
Loading…
Reference in new issue