Browse Source

VERY kludgy config for wasmReady

with_mpp_example
Shagen Ogandzhanian 3 years ago
parent
commit
b814693219
  1. 8
      web/core/build.gradle.kts
  2. 1
      web/gradle.properties
  3. 32
      web/test-utils/conf/karma.config.common.d/wasm.js

8
web/core/build.gradle.kts

@ -5,10 +5,12 @@ plugins {
id("org.jetbrains.compose")
}
val SKIKO_VERSION: String by project
val skikoWasm by configurations.creating
dependencies {
skikoWasm("org.jetbrains.skiko:skiko-js-wasm-runtime:0.0.0-SNAPSHOT")
skikoWasm("org.jetbrains.skiko:skiko-js-wasm-runtime:${SKIKO_VERSION}")
}
val copySkikoResources = tasks.register("copySkikoResources", Copy::class) {
@ -16,7 +18,7 @@ val copySkikoResources = tasks.register("copySkikoResources", Copy::class) {
include("skiko.wasm")
include("skiko.js")
}
destinationDir = file("${project.buildDir}/skiko")
destinationDir = file("${rootProject.buildDir}/skiko")
}
tasks.withType<org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest>().configureEach {
@ -42,7 +44,7 @@ kotlin {
implementation(compose.runtime)
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.skiko:skiko:0.0.0-SNAPSHOT")
implementation("org.jetbrains.skiko:skiko:${SKIKO_VERSION}")
}
}

1
web/gradle.properties

@ -1,6 +1,7 @@
#COMPOSE_CORE_VERSION=1.0.1-rc2
COMPOSE_CORE_VERSION=10.10.10
COMPOSE_WEB_VERSION=1.0.1-rc2
SKIKO_VERSION=0.0.0-SNAPSHOT
compose.web.buildSamples=false
compose.web.tests.integration.withFirefox
compose.web.tests.skip.benchmarks=false

32
web/test-utils/conf/karma.config.common.d/wasm.js

@ -0,0 +1,32 @@
// see https://kotlinlang.org/docs/js-project-setup.html#webpack-configuration-file
const path = require("path");
const fs = require("fs");
config.browserConsoleLogOptions.level = "debug";
const basePath = config.basePath;
const projectPath = path.resolve(basePath, "..", "..", "..", "..", "..");
const wasmPath = path.resolve(projectPath, "build", "out", "link", "Release-wasm-wasm")
//const debug = message => console.log(`[karma-config] ${message}`);
const debug = message => fs.appendFileSync('/Users/shagen/tmp/log.log', message + "\r\n");
const a = path.resolve(".");
const projectName = path.basename(path.dirname(basePath)).replace(/-test$/, '').replace(/^web-/,'');
if (projectName == "web-core") {
const rootBuildDir = path.resolve(__dirname, "..", "..", "..");
const wasmPath = path.resolve(rootBuildDir, "skiko");
config.proxies = {
"/wasm/": wasmPath
}
config.files = [
path.resolve(wasmPath, "skiko.js"),
{pattern: path.resolve(wasmPath, "skiko.wasm"), included: false, served: true, watched: false},
].concat(config.files);
}
Loading…
Cancel
Save