Moved all wasmJs to runningOnLinuxx in gradle, deleted unneded TODOS and dependencies
This commit is contained in:
1 parent
f548a162e7
commit
c5e91fc8ee
6 files changed
+67
-113
No files matched your search
@@ -18,6 +18,7 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
|
||||
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
|
||||
@@ -88,20 +89,11 @@ kotlin {
|
||||
}
|
||||
|
||||
jvm()
|
||||
|
||||
val projectRef = project
|
||||
runningOnLinuxx86_64 {
|
||||
println("Configuring Linux X86-64 targets")
|
||||
|
||||
wasmJs {
|
||||
browser {
|
||||
testTask {
|
||||
useKarma {
|
||||
useChromeHeadless()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
js {
|
||||
browser {
|
||||
testTask {
|
||||
@@ -119,6 +111,18 @@ kotlin {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalWasmDsl::class)
|
||||
wasmJs {
|
||||
browser {
|
||||
testTask {
|
||||
useKarma {
|
||||
useChrome()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
linuxX64() {
|
||||
compilations.getByName("main") {
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@@ -302,10 +306,8 @@ kotlin {
|
||||
implementation(kotlin(Deps.Common.test))
|
||||
implementation(kotlin(Deps.Common.testAnnotation))
|
||||
implementation(Deps.Common.coroutines)
|
||||
|
||||
// implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
|
||||
implementation(Deps.Common.coroutinesTest)
|
||||
implementation(kotlin("test"))
|
||||
// implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,24 +333,6 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: это скопипасчено с блока runningOnLinuxx86_64 (примерно 590 строка)
|
||||
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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Set up shared source sets
|
||||
//linux, linuxArm32Hfp, linuxArm64
|
||||
val linux64Bit = setOf(
|
||||
@@ -600,6 +584,17 @@ kotlin {
|
||||
implementation(npm(Deps.Js.Npm.libsodiumWrappers.first, Deps.Js.Npm.libsodiumWrappers.second))
|
||||
}
|
||||
}
|
||||
val wasmJsMain by getting {
|
||||
dependencies {
|
||||
implementation(npm(Deps.wasmJs.Npm.libsodiumWrappers.first, Deps.wasmJs.Npm.libsodiumWrappers.second))
|
||||
}
|
||||
}
|
||||
val wasmJsTest by getting {
|
||||
dependencies {
|
||||
implementation(npm(Deps.wasmJs.Npm.libsodiumWrappers.first, Deps.wasmJs.Npm.libsodiumWrappers.second))
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
|
||||
}
|
||||
}
|
||||
val linuxX64Main by getting {
|
||||
isRunningInIdea {
|
||||
kotlin.srcDir("src/nativeMain/kotlin")
|
||||
@@ -738,13 +733,12 @@ tasks {
|
||||
// }
|
||||
// }
|
||||
|
||||
// TODO: ваще не жс тест, помогите
|
||||
val wasmJsBrowserTest by getting(KotlinJsTest::class) {
|
||||
testLogging {
|
||||
events("PASSED", "FAILED", "SKIPPED")
|
||||
showStandardStreams = true
|
||||
}
|
||||
}
|
||||
// val wasmJsBrowserTest by getting(KotlinJsTest::class) {
|
||||
// testLogging {
|
||||
// events("PASSED", "FAILED", "SKIPPED")
|
||||
// showStandardStreams = true
|
||||
// }
|
||||
// }
|
||||
|
||||
val jsBrowserTest by getting(KotlinJsTest::class) {
|
||||
testLogging {
|
||||
|
||||
-3
@@ -97,9 +97,6 @@ external object JsSodiumInterface: JsAny {
|
||||
@JsName("crypto_secretstream_xchacha20poly1305_init_push")
|
||||
fun crypto_secretstream_xchacha20poly1305_init_push(key: Uint8Array) : SecretStreamStateAndHeaderType
|
||||
@JsName("crypto_secretstream_xchacha20poly1305_push")
|
||||
// TODO: два варианта: \/
|
||||
// 1. Меняем юбайт на байт и юинт на инт \/
|
||||
// 2. Меняем юбайт на инт и юинт на лонг \/ и далее по списку
|
||||
fun crypto_secretstream_xchacha20poly1305_push(state: SecretStreamStateType, message: Uint8Array, associatedData: Uint8Array, tag: Byte) : Uint8Array
|
||||
|
||||
//decrypt
|
||||
|
||||
-1
@@ -22,7 +22,6 @@ object JsSodiumLoader {
|
||||
|
||||
}
|
||||
|
||||
// TODO: попробовать сделать из этого suspend вместо continuation
|
||||
suspend fun load(): Unit = suspendCoroutine { continuation ->
|
||||
if (!getSodiumLoaded()) {
|
||||
_libsodiumPromise.then<JsAny?> {
|
||||
|
||||
Reference in new issue
Block a user