mirror of
https://github.com/bitsycore/skiko.git
synced 2026-10-07 07:27:26 +00:00
* add k/wasm support * ES6 for skiko wasm Fix build files Add SkikoCallbacks external funs Add GL external object * cleanup * Update SkiaMultiplatformSample Composite build to run with k/wasm * Update SkiaJsSample * Update CI config * cleanup * Fix CI * Add -O2 flag to emcc link stage * cleanup * cleanup * update wasm.yml * update maven repositories * fixes after rebase * enable supportJs when supportWasm is true * Add a temporary coroutines version substitution for non-wasm * Apply PR review suggestions * Use coroutines 1.8.0-RC * Workaround an issue with atomicfu 0.23.1 - Add an explicit dependency on atomicfu from nativeMain * Fix typo * Renamed SKIKO_COMPOSITE_BUILD to skiko.composite.build in SkiaJsSample * Remove wasm/experimental maven repo * Remove wasm/experimental maven repo * Add wasmArtifactId to skikoArtifactIds * Remove redundant comment --------- Co-authored-by: igoriakovlev <54274820+igoriakovlev@users.noreply.github.com> Co-authored-by: Ilya Goncharov <ilya.goncharov@jetbrains.com> Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
95 lines
2.3 KiB
Kotlin
95 lines
2.3 KiB
Kotlin
plugins {
|
|
kotlin("multiplatform")
|
|
}
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
|
}
|
|
|
|
var version = "0.0.0-SNAPSHOT"
|
|
if (project.hasProperty("skiko.version")) {
|
|
version = project.properties["skiko.version"] as String
|
|
}
|
|
|
|
val resourcesDir = "$buildDir/resources/"
|
|
|
|
val skikoWasm by configurations.creating
|
|
|
|
val isCompositeBuild = extra.properties.getOrDefault("skiko.composite.build", "") == "1"
|
|
|
|
dependencies {
|
|
if (isCompositeBuild) {
|
|
val filePath = gradle.includedBuild("skiko").projectDir
|
|
.resolve("./build/libs/skiko-wasm-$version.jar")
|
|
skikoWasm(files(filePath))
|
|
} else {
|
|
skikoWasm("org.jetbrains.skiko:skiko-js-wasm-runtime:$version")
|
|
}
|
|
}
|
|
|
|
val unzipTask = tasks.register("unzipWasm", Copy::class) {
|
|
destinationDir = file(resourcesDir)
|
|
from(skikoWasm.map { zipTree(it) })
|
|
|
|
if (isCompositeBuild) {
|
|
val skikoWasmJarTask = gradle.includedBuild("skiko").task(":skikoWasmJar")
|
|
dependsOn(skikoWasmJarTask)
|
|
}
|
|
}
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>().configureEach {
|
|
dependsOn(unzipTask)
|
|
}
|
|
|
|
kotlin {
|
|
|
|
js(IR) {
|
|
moduleName = "jsApp"
|
|
browser {
|
|
commonWebpackConfig {
|
|
outputFileName = "jsApp.js"
|
|
}
|
|
}
|
|
binaries.executable()
|
|
}
|
|
|
|
wasmJs() {
|
|
moduleName = "wasmApp"
|
|
browser {
|
|
commonWebpackConfig {
|
|
outputFileName = "wasmApp.js"
|
|
}
|
|
}
|
|
binaries.executable()
|
|
}
|
|
|
|
sourceSets {
|
|
val commonMain by getting {
|
|
dependencies {
|
|
implementation("org.jetbrains.skiko:skiko:$version")
|
|
}
|
|
}
|
|
|
|
val jsWasmMain by creating {
|
|
dependsOn(commonMain)
|
|
resources.setSrcDirs(resources.srcDirs)
|
|
resources.srcDirs(unzipTask.map { it.destinationDir })
|
|
}
|
|
|
|
val jsMain by getting {
|
|
dependsOn(jsWasmMain)
|
|
}
|
|
|
|
|
|
val wasmJsMain by getting {
|
|
dependsOn(jsWasmMain)
|
|
}
|
|
}
|
|
}
|
|
|
|
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
|
|
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = "16.0.0"
|
|
}
|