Skip to content

Commit

Permalink
wasm example, fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhirkevich Alexander Y authored and Zhirkevich Alexander Y committed Feb 29, 2024
1 parent 14532c4 commit 58dc6d6
Show file tree
Hide file tree
Showing 9 changed files with 2,908 additions and 7 deletions.
3 changes: 3 additions & 0 deletions compottie/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,20 @@ kotlin {
}

val desktopMain by getting
val wasmJsMain by getting

androidMain.dependencies {
api(libs.lottie.android)
}


val skikoMain by creating {
dependsOn(commonMain.get())
desktopMain.dependsOn(this)
iosMain.get().dependsOn(this)
macosMain.get().dependsOn(this)
jsMain.get().dependsOn(this)
wasmJsMain.dependsOn(this)
dependencies {
implementation(libs.serialization)
}
Expand Down
3 changes: 3 additions & 0 deletions example/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ kotlin {
js(IR) {
browser()
}
wasmJs(){
browser()
}

listOf(
iosX64(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ kotlin {
binaries.executable()
}

wasmJs(){
browser()
binaries.executable()
}
sourceSets {
val jsMain by getting {
dependencies {
implementation(compose.ui)
implementation(project(":example:shared"))
}

commonMain.dependencies {
implementation(compose.ui)
implementation(project(":example:shared"))
}
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</head>
<body>
<canvas id="ComposeTarget"></canvas>
<script src="webJsApp.js"></script>
<script src="webApp.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions example/webApp/src/wasmJsMain/kotlin/main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@file:OptIn(ExperimentalComposeUiApi::class)

import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.CanvasBasedWindow

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
CanvasBasedWindow {
App()
}
}
12 changes: 12 additions & 0 deletions example/webApp/src/wasmJsMain/resources/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>QRose example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="skiko.js"></script>
</head>
<body>
<canvas id="ComposeTarget"></canvas>
<script src="webApp.js"></script>
</body>
</html>
Loading

0 comments on commit 58dc6d6

Please sign in to comment.