mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Add checkAndWarnAboutUsingJsPlugin to gradle plugin (#1753)
* Add `checkAndWarnAboutUsingJsPlugin` to gradle plugin closes #1693 * PR review improvements Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
This commit is contained in:
committed by
GitHub
parent
26ce4099be
commit
fb715e6061
@@ -25,6 +25,9 @@ import org.jetbrains.compose.desktop.application.internal.currentTarget
|
||||
import org.jetbrains.compose.desktop.preview.internal.initializePreview
|
||||
import org.jetbrains.compose.experimental.dsl.ExperimentalExtension
|
||||
import org.jetbrains.compose.experimental.internal.configureExperimental
|
||||
import org.jetbrains.compose.internal.COMPOSE_PLUGIN_ID
|
||||
import org.jetbrains.compose.internal.KOTLIN_JS_PLUGIN_ID
|
||||
import org.jetbrains.compose.internal.KOTLIN_MPP_PLUGIN_ID
|
||||
import org.jetbrains.compose.web.WebExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
@@ -134,6 +137,17 @@ class ComposePlugin : Plugin<Project> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkAndWarnAboutUsingJsPlugin(project)
|
||||
}
|
||||
|
||||
private fun checkAndWarnAboutUsingJsPlugin(project: Project) {
|
||||
val msg = "'$COMPOSE_PLUGIN_ID' plugin is not compatible with '$KOTLIN_JS_PLUGIN_ID' plugin. " +
|
||||
"Use '$KOTLIN_MPP_PLUGIN_ID' instead"
|
||||
|
||||
project.plugins.withId(KOTLIN_JS_PLUGIN_ID) {
|
||||
project.logger.error(msg)
|
||||
}
|
||||
}
|
||||
|
||||
class RedirectAndroidVariants : ComponentMetadataRule {
|
||||
|
||||
@@ -6,4 +6,6 @@
|
||||
package org.jetbrains.compose.internal
|
||||
|
||||
internal const val KOTLIN_MPP_PLUGIN_ID = "org.jetbrains.kotlin.multiplatform"
|
||||
internal const val KOTLIN_JVM_PLUGIN_ID = "org.jetbrains.kotlin.jvm"
|
||||
internal const val KOTLIN_JVM_PLUGIN_ID = "org.jetbrains.kotlin.jvm"
|
||||
internal const val KOTLIN_JS_PLUGIN_ID = "org.jetbrains.kotlin.js"
|
||||
internal const val COMPOSE_PLUGIN_ID = "org.jetbrains.compose"
|
||||
|
||||
Reference in New Issue
Block a user