mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Fix ComposeExtension.kotlinCompilerPluginArgs for non-jvm compilations (#2716)
This commit is contained in:
committed by
GitHub
parent
16bcc34b68
commit
e9789ba364
@@ -28,7 +28,7 @@ import org.jetbrains.compose.internal.utils.currentTarget
|
||||
import org.jetbrains.compose.web.WebExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
||||
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||
|
||||
internal val composeVersion get() = ComposeBuildConfig.composeVersion
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@ class DesktopApplicationTest : GradlePluginTestBase() {
|
||||
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.7.20\")",
|
||||
composeCompilerArgs = "\"suppressKotlinVersionCompatibilityCheck=1.7.21\""
|
||||
)
|
||||
).checkCustomComposeCompiler()
|
||||
).checkCustomComposeCompiler(checkKJS = true)
|
||||
|
||||
private fun TestProject.checkCustomComposeCompiler() {
|
||||
private fun TestProject.checkCustomComposeCompiler(checkKJS: Boolean = false) {
|
||||
gradle(":runDistributable").checks {
|
||||
val actualMainImage = file("main-image.actual.png")
|
||||
val expectedMainImage = file("main-image.expected.png")
|
||||
@@ -107,6 +107,11 @@ class DesktopApplicationTest : GradlePluginTestBase() {
|
||||
"The actual image '$actualMainImage' does not match the expected image '$expectedMainImage'"
|
||||
}
|
||||
}
|
||||
if (checkKJS) {
|
||||
gradle(":jsBrowserProductionWebpack").checks {
|
||||
check.taskSuccessful(":jsBrowserProductionWebpack")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -2,7 +2,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
||||
|
||||
plugins {
|
||||
id "org.jetbrains.kotlin.jvm"
|
||||
id "org.jetbrains.kotlin.multiplatform"
|
||||
id "org.jetbrains.compose"
|
||||
}
|
||||
|
||||
@@ -11,9 +11,27 @@ repositories {
|
||||
jetbrainsCompose()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
||||
implementation compose.desktop.currentOs
|
||||
kotlin {
|
||||
jvm("desktop")
|
||||
js(IR) {
|
||||
browser()
|
||||
binaries.executable()
|
||||
}
|
||||
sourceSets {
|
||||
desktopMain {
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
||||
implementation compose.desktop.currentOs
|
||||
}
|
||||
}
|
||||
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation compose.runtime
|
||||
implementation compose.web.core
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compose {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
pluginManagement {
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
|
||||
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
|
||||
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
|
||||
}
|
||||
repositories {
|
||||
@@ -8,4 +8,4 @@ pluginManagement {
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
rootProject.name = "simple"
|
||||
rootProject.name = "simple"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import org.jetbrains.compose.web.*
|
||||
import org.jetbrains.compose.web.dom.*
|
||||
fun main() {
|
||||
renderComposableInBody {
|
||||
Div { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user