Problem with 1.9.23 KMP version. It's been fixed in 2.0 so it needs to be updated
This commit is contained in:
1 parent
bd83e9aee0
commit
59f2d77890
11 files changed
+132
-34
No files matched your search
+48
-2
@@ -17,9 +17,9 @@
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
|
||||
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
|
||||
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
|
||||
import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask
|
||||
|
||||
plugins {
|
||||
@@ -82,6 +82,36 @@ kotlin {
|
||||
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalWasmDsl::class)
|
||||
wasmJs {
|
||||
browser {
|
||||
webpackTask {
|
||||
|
||||
}
|
||||
testTask {
|
||||
useKarma {
|
||||
useChrome()
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.executable()
|
||||
// browser {
|
||||
// val rootDirPath = project.rootDir.path
|
||||
// val projectDirPath = project.projectDir.path
|
||||
// commonWebpackConfig {
|
||||
// outputFileName = "composeApp.js"
|
||||
// devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
|
||||
//// static = (static ?: mutableListOf()).apply {
|
||||
//// // Serve sources to debug inside browser
|
||||
//// add(rootDirPath)
|
||||
//// add(projectDirPath)
|
||||
//// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// binaries.executable()
|
||||
}
|
||||
|
||||
|
||||
linuxX64("linux") {
|
||||
binaries {
|
||||
@@ -207,6 +237,22 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
val wasmJsMain by getting {
|
||||
dependencies {
|
||||
// implementation(kotlin(Deps.wasmJs.stdLib))
|
||||
implementation(npm(Deps.wasmJs.Npm.libsodiumWrappers.first, Deps.wasmJs.Npm.libsodiumWrappers.second))
|
||||
}
|
||||
}
|
||||
val wasmJsTest by getting {
|
||||
dependencies {
|
||||
dependsOn(commonTest)
|
||||
implementation(npm(Deps.wasmJs.Npm.libsodiumWrappers.first, Deps.wasmJs.Npm.libsodiumWrappers.second))
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
|
||||
|
||||
implementation(kotlin("test"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// val nativeMain by creating {
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
import com.ionspin.kotlin.crypto.LibsodiumInitializer
|
||||
|
||||
|
||||
fun main() {
|
||||
LibsodiumInitializer.initializeWithCallback {
|
||||
// val hash = Hash.sha512("123".encodeToUByteArray())
|
||||
// println("Hash (SHA512) of 123: ${hash.toHexString()}")
|
||||
println("Hello")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Libsodium bindings sample app!</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="sample.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user