Skip to content

Commit

Permalink
Add wasmJs and linuxArm64 targets (#388)
Browse files Browse the repository at this point in the history
These were unblocked by the JetBrains Compose 1.6.0 runtime update.
  • Loading branch information
JakeWharton authored Feb 28, 2024
1 parent d20a7b4 commit b13772c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

New:
- Support for `linuxArm64` and `wasmJs` targets.


## [1.4.0] - 2024-02-27

Expand Down
49 changes: 38 additions & 11 deletions molecule-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ kotlin {

jvm()

linuxArm64()
linuxX64()

macosArm64()
Expand All @@ -33,11 +34,17 @@ kotlin {
tvosSimulatorArm64()
tvosX64()

wasmJs {
browser()
}

watchosArm32()
watchosArm64()
watchosSimulatorArm64()
watchosX64()

applyDefaultHierarchyTemplate()

sourceSets {
configureEach {
languageSettings.optIn("kotlinx.cinterop.BetaInteropApi")
Expand All @@ -64,6 +71,15 @@ kotlin {
}
}

// We use a common folder instead of a common source set because there is no commonizer
// which exposes the browser APIs across these two targets.
jsMain {
kotlin.srcDir('src/browserMain/kotlin')
}
wasmJsMain {
kotlin.srcDir('src/browserMain/kotlin')
}

darwinMain {
dependsOn(commonMain)
}
Expand All @@ -78,21 +94,32 @@ kotlin {
quartzCoreMain {
dependsOn(displayLinkMain)
}

iosMain {
dependsOn(quartzCoreMain)
}
iosTest {
// TODO Link against XCTest in order to get frame pulses on iOS.
// dependsOn(displayLinkTest)
}

tvosMain {
dependsOn(quartzCoreMain)
}
tvosTest {
// TODO Link against XCTest in order to get frame pulses on tvOS.
// dependsOn(displayLinkTest)
}

macosMain {
dependsOn(displayLinkMain)
}
}
macosTest {
dependsOn(displayLinkTest)
}

targets.each { target ->
if (target.name.startsWith('ios') || target.name.startsWith('tvos')) {
target.compilations.main.defaultSourceSet.dependsOn(sourceSets.quartzCoreMain)
// TODO Link against XCTest in order to get frame pulses on iOS/tvOS.
// target.compilations.test.defaultSourceSet.dependsOn(sourceSets.displayLinkTest)
} else if (target.name.startsWith('macos')) {
target.compilations.main.defaultSourceSet.dependsOn(sourceSets.macosMain)
target.compilations.test.defaultSourceSet.dependsOn(sourceSets.displayLinkTest)
} else if (target.name.startsWith('watchos')) {
target.compilations.main.defaultSourceSet.dependsOn(sourceSets.darwinMain)
watchosMain {
dependsOn(darwinMain)
}
}
}
Expand Down

0 comments on commit b13772c

Please sign in to comment.