Browse Source

Update for k/wasm (#4009)

This a comanion PR to
https://github.com/JetBrains/compose-multiplatform-core/pull/914

Resources lib doesn't contain k/wasm target yet. It will be added in a
separate PR

---------

Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
pull/4027/head
Oleksandr Karpovich 1 year ago committed by GitHub
parent
commit
93b513458d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      examples/html/compose-bird/build.gradle.kts
  2. 3
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerKotlinSupportPlugin.kt
  3. 1
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/internal/checkExperimentalTargets.kt
  4. 12
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt
  5. 14
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt
  6. 8
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/KotlinCompatibilityTest.kt
  7. 2
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestKotlinVersions.kt
  8. 1
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/gradle.properties
  9. 1
      gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/gradle.properties
  10. 1
      html/benchmark-core/build.gradle.kts
  11. 2
      html/build.gradle.kts
  12. 4
      html/buildSrc/build.gradle.kts
  13. 2
      html/buildSrc/gradle.properties
  14. 1
      html/compose-compiler-integration/build.gradle.kts
  15. 1
      html/compose-compiler-integration/main-template/build.gradle.kts
  16. 1
      html/compose-compiler-integration/main-template/lib/build.gradle.kts
  17. 1
      html/core/build.gradle.kts
  18. 4
      html/gradle.properties
  19. 2
      html/gradle/wrapper/gradle-wrapper.properties
  20. 1
      html/integration-core/build.gradle.kts
  21. 1
      html/internal-html-core-runtime/build.gradle.kts
  22. 673
      html/kotlin-js-store/yarn.lock
  23. 15
      html/settings.gradle.kts
  24. 1
      html/svg/build.gradle.kts
  25. 1
      html/test-utils/build.gradle.kts

1
examples/html/compose-bird/build.gradle.kts

@ -24,6 +24,7 @@ kotlin {
dependencies { dependencies {
implementation(compose.html.core) implementation(compose.html.core)
implementation(compose.runtime) implementation(compose.runtime)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0-RC")
} }
} }
} }

3
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerKotlinSupportPlugin.kt

@ -92,7 +92,8 @@ class ComposeCompilerKotlinSupportPlugin : KotlinCompilerPluginSupportPlugin {
} }
private val platformPluginOptions = mapOf( private val platformPluginOptions = mapOf(
KotlinPlatformType.js to options("generateDecoys" to "true") KotlinPlatformType.js to options("generateDecoys" to "false"),
KotlinPlatformType.wasm to options("generateDecoys" to "false")
) )
private fun options(vararg options: Pair<String, String>): List<SubpluginOption> = private fun options(vararg options: Pair<String, String>): List<SubpluginOption> =

1
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/internal/checkExperimentalTargets.kt

@ -27,6 +27,7 @@ private val TargetType.gradlePropertyName get() = "org.jetbrains.compose.experim
private val EXPERIMENTAL_TARGETS: Set<TargetType> = setOf( private val EXPERIMENTAL_TARGETS: Set<TargetType> = setOf(
TargetType("macos", presets = listOf("macosX64", "macosArm64")), TargetType("macos", presets = listOf("macosX64", "macosArm64")),
TargetType("jscanvas", presets = listOf("jsIr", "js")), TargetType("jscanvas", presets = listOf("jsIr", "js")),
TargetType("wasm", presets = listOf("wasm", "wasmJs")),
) )
private sealed interface CheckResult { private sealed interface CheckResult {

12
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt

@ -77,15 +77,15 @@ class DesktopApplicationTest : GradlePluginTestBase() {
@Test @Test
fun testSettingLatestCompiler() = testProject( fun testSettingLatestCompiler() = testProject(
TestProjects.customCompiler, defaultTestEnvironment.copy( TestProjects.customCompiler, defaultTestEnvironment.copy(
kotlinVersion = "1.7.20", kotlinVersion = "1.8.20",
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.7.20\")", composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.8.20\")",
) )
).checkCustomComposeCompiler() ).checkCustomComposeCompiler()
@Test @Test
fun testSettingAutoCompiler() = testProject( fun testSettingAutoCompiler() = testProject(
TestProjects.customCompiler, defaultTestEnvironment.copy( TestProjects.customCompiler, defaultTestEnvironment.copy(
kotlinVersion = "1.7.10", kotlinVersion = "1.8.10",
composeCompilerPlugin = "dependencies.compiler.auto", composeCompilerPlugin = "dependencies.compiler.auto",
) )
).checkCustomComposeCompiler() ).checkCustomComposeCompiler()
@ -93,9 +93,9 @@ class DesktopApplicationTest : GradlePluginTestBase() {
@Test @Test
fun testKotlinCheckDisabled() = testProject( fun testKotlinCheckDisabled() = testProject(
TestProjects.customCompilerArgs, defaultTestEnvironment.copy( TestProjects.customCompilerArgs, defaultTestEnvironment.copy(
kotlinVersion = "1.7.21", kotlinVersion = "1.9.21",
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.7.20\")", composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.9.20\")",
composeCompilerArgs = "\"suppressKotlinVersionCompatibilityCheck=1.7.21\"" composeCompilerArgs = "\"suppressKotlinVersionCompatibilityCheck=1.9.21\""
) )
).checkCustomComposeCompiler(checkKJS = true) ).checkCustomComposeCompiler(checkKJS = true)

14
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt

@ -10,7 +10,9 @@ import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.PreviewLogger
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.RemoteConnection import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.RemoteConnection
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.receiveConfigFromGradle import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.receiveConfigFromGradle
import org.jetbrains.compose.experimental.internal.kotlinVersionNumbers import org.jetbrains.compose.experimental.internal.kotlinVersionNumbers
import org.jetbrains.compose.internal.utils.Arch
import org.jetbrains.compose.internal.utils.OS import org.jetbrains.compose.internal.utils.OS
import org.jetbrains.compose.internal.utils.currentArch
import org.jetbrains.compose.internal.utils.currentOS import org.jetbrains.compose.internal.utils.currentOS
import org.jetbrains.compose.test.utils.* import org.jetbrains.compose.test.utils.*
import org.junit.jupiter.api.Assumptions import org.junit.jupiter.api.Assumptions
@ -122,8 +124,12 @@ class GradlePluginTest : GradlePluginTestBase() {
defaultTestEnvironment.copy(kotlinVersion = kotlinVersion, useGradleConfigurationCache = false) defaultTestEnvironment.copy(kotlinVersion = kotlinVersion, useGradleConfigurationCache = false)
) )
val task = ":subproject:linkDebugFrameworkIosX64" val task = if (currentArch == Arch.X64) {
with(nativeCacheKindProject(kotlinVersion = TestKotlinVersions.v1_8_20)) { ":subproject:linkDebugFrameworkIosX64"
} else {
":subproject:linkDebugFrameworkIosArm64"
}
with(nativeCacheKindProject(kotlinVersion = TestKotlinVersions.v1_9_0)) {
gradle(task, "--info").checks { gradle(task, "--info").checks {
check.taskSuccessful(task) check.taskSuccessful(task)
check.logDoesntContain("-Xauto-cache-from=") check.logDoesntContain("-Xauto-cache-from=")
@ -131,7 +137,7 @@ class GradlePluginTest : GradlePluginTestBase() {
} }
testWorkDir.deleteRecursively() testWorkDir.deleteRecursively()
testWorkDir.mkdirs() testWorkDir.mkdirs()
with(nativeCacheKindProject(kotlinVersion = TestKotlinVersions.v1_9_0) ) { with(nativeCacheKindProject(kotlinVersion = TestKotlinVersions.v1_9_10) ) {
gradle(task, "--info").checks { gradle(task, "--info").checks {
check.taskSuccessful(task) check.taskSuccessful(task)
check.logDoesntContain("-Xauto-cache-from=") check.logDoesntContain("-Xauto-cache-from=")
@ -205,7 +211,7 @@ class GradlePluginTest : GradlePluginTestBase() {
} }
} }
testKotlinVersion(TestKotlinVersions.v1_9_20_Beta) testKotlinVersion(TestKotlinVersions.v1_9_21)
} }
@Test @Test

8
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/KotlinCompatibilityTest.kt

@ -12,16 +12,16 @@ import org.junit.jupiter.api.Test
class KotlinCompatibilityTest : GradlePluginTestBase() { class KotlinCompatibilityTest : GradlePluginTestBase() {
@Test @Test
fun testKotlinMpp_1_7_10() = testMpp("1.7.10") fun testKotlinMpp_1_9_10() = testMpp("1.9.10")
@Test @Test
fun testKotlinJsMpp_1_7_10() = testJsMpp("1.7.10") fun testKotlinJsMpp_1_9_10() = testJsMpp("1.9.10")
@Test @Test
fun testKotlinMpp_1_7_20() = testMpp("1.7.20") fun testKotlinMpp_1_9_20() = testMpp("1.9.20")
@Test @Test
fun testKotlinJsMpp_1_7_20() = testJsMpp("1.7.20") fun testKotlinJsMpp_1_9_20() = testJsMpp("1.9.20")
private fun testMpp(kotlinVersion: String) = with( private fun testMpp(kotlinVersion: String) = with(
testProject( testProject(

2
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestKotlinVersions.kt

@ -9,5 +9,7 @@ object TestKotlinVersions {
val Default = TestProperties.composeCompilerCompatibleKotlinVersion val Default = TestProperties.composeCompilerCompatibleKotlinVersion
val v1_8_20 = "1.8.20" val v1_8_20 = "1.8.20"
val v1_9_0 = "1.9.0" val v1_9_0 = "1.9.0"
val v1_9_10 = "1.9.10"
val v1_9_20_Beta = "1.9.20-Beta" val v1_9_20_Beta = "1.9.20-Beta"
val v1_9_21 = "1.9.21"
} }

1
gradle-plugins/compose/src/test/test-projects/misc/commonResources/gradle.properties

@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx8096M
android.useAndroidX=true android.useAndroidX=true

1
gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/gradle.properties

@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx8096M
org.jetbrains.compose.experimental.uikit.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true

1
html/benchmark-core/build.gradle.kts

@ -23,6 +23,7 @@ kotlin {
implementation(compose.runtime) implementation(compose.runtime)
implementation(project(":html-core")) implementation(project(":html-core"))
implementation(kotlin("stdlib-common")) implementation(kotlin("stdlib-common"))
implementation(libs.kotlinx.coroutines.core)
} }
} }

2
html/build.gradle.kts

@ -172,7 +172,7 @@ subprojects {
configurations.all { configurations.all {
resolutionStrategy.dependencySubstitution { resolutionStrategy.dependencySubstitution {
substitute(module("org.jetbrains.compose.html:html-core")).apply { substitute(module("org.jetbrains.compose.html:html-core")).apply {
with(project(":html-core")) using(project(":html-core"))
} }
} }
} }

4
html/buildSrc/build.gradle.kts

@ -15,8 +15,8 @@ plugins {
java { java {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_17
} }
dependencies { dependencies {

2
html/buildSrc/gradle.properties

@ -1 +1 @@
kotlin.version=1.8.21 kotlin.version=1.9.21

1
html/compose-compiler-integration/build.gradle.kts

@ -25,6 +25,7 @@ kotlin {
implementation(kotlin("stdlib-js")) implementation(kotlin("stdlib-js"))
implementation(compose.runtime) implementation(compose.runtime)
implementation(project(":html-core")) implementation(project(":html-core"))
implementation(libs.kotlinx.coroutines.core)
} }
} }

1
html/compose-compiler-integration/main-template/build.gradle.kts

@ -22,6 +22,7 @@ kotlin {
implementation(kotlin("stdlib-common")) implementation(kotlin("stdlib-common"))
implementation(compose.runtime) implementation(compose.runtime)
implementation(project(":lib")) implementation(project(":lib"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0-RC")
} }
} }
} }

1
html/compose-compiler-integration/main-template/lib/build.gradle.kts

@ -21,6 +21,7 @@ kotlin {
dependencies { dependencies {
implementation(kotlin("stdlib-common")) implementation(kotlin("stdlib-common"))
implementation(compose.runtime) implementation(compose.runtime)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0-RC")
} }
} }
} }

1
html/core/build.gradle.kts

@ -23,6 +23,7 @@ kotlin {
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
implementation(compose.runtime) implementation(compose.runtime)
implementation(libs.kotlinx.coroutines.core)
} }
} }

4
html/gradle.properties

@ -1,8 +1,8 @@
compose.version=1.5.1 compose.version=1.6.0-alpha01
compose.web.buildSamples=false compose.web.buildSamples=false
compose.web.tests.integration.withFirefox compose.web.tests.integration.withFirefox
compose.web.tests.skip.benchmarks=false compose.web.tests.skip.benchmarks=false
org.gradle.jvmargs=-Xmx8g org.gradle.jvmargs=-Xmx8g
# TODO: figure out why jvmTest (web driver tests) fail with timeout with kotlin 1.9.0 # TODO: figure out why jvmTest (web driver tests) fail with timeout with kotlin 1.9.0
integrationTestsEnabled=false integrationTestsEnabled=false

2
html/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

1
html/integration-core/build.gradle.kts

@ -39,6 +39,7 @@ kotlin {
implementation(compose.runtime) implementation(compose.runtime)
implementation(project(":html-core")) implementation(project(":html-core"))
implementation(kotlin("stdlib-common")) implementation(kotlin("stdlib-common"))
implementation(libs.kotlinx.coroutines.core)
} }
} }

1
html/internal-html-core-runtime/build.gradle.kts

@ -21,6 +21,7 @@ kotlin {
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
implementation(compose.runtime) implementation(compose.runtime)
implementation(libs.kotlinx.coroutines.core)
} }
} }

673
html/kotlin-js-store/yarn.lock

File diff suppressed because it is too large Load Diff

15
html/settings.gradle.kts

@ -48,6 +48,21 @@ pluginManagement {
} }
} }
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
}
versionCatalogs {
create("libs") {
library("kotlinx-coroutines-core", "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0-RC")
}
}
}
fun module(name: String, path: String) { fun module(name: String, path: String) {
include(name) include(name)
val projectDir = rootDir.resolve(path).normalize().absoluteFile val projectDir = rootDir.resolve(path).normalize().absoluteFile

1
html/svg/build.gradle.kts

@ -41,6 +41,7 @@ kotlin {
dependencies { dependencies {
implementation(project(":html-test-utils")) implementation(project(":html-test-utils"))
implementation(kotlin("test-js")) implementation(kotlin("test-js"))
implementation(libs.kotlinx.coroutines.core)
} }
} }
} }

1
html/test-utils/build.gradle.kts

@ -27,6 +27,7 @@ kotlin {
implementation(compose.runtime) implementation(compose.runtime)
implementation(kotlin("stdlib-common")) implementation(kotlin("stdlib-common"))
implementation(project(":internal-html-core-runtime")) implementation(project(":internal-html-core-runtime"))
implementation(libs.kotlinx.coroutines.core)
} }
} }
val jsTest by getting { val jsTest by getting {

Loading…
Cancel
Save