summaryrefslogtreecommitdiff
path: root/formats/json-tests/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'formats/json-tests/build.gradle.kts')
-rw-r--r--formats/json-tests/build.gradle.kts60
1 files changed, 60 insertions, 0 deletions
diff --git a/formats/json-tests/build.gradle.kts b/formats/json-tests/build.gradle.kts
new file mode 100644
index 00000000..6be0a3a7
--- /dev/null
+++ b/formats/json-tests/build.gradle.kts
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2017-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
+ */
+import Java9Modularity.configureJava9ModuleInfo
+import org.jetbrains.kotlin.gradle.targets.js.testing.*
+
+plugins {
+ kotlin("multiplatform")
+ kotlin("plugin.serialization")
+}
+
+apply(from = rootProject.file("gradle/native-targets.gradle"))
+apply(from = rootProject.file("gradle/configure-source-sets.gradle"))
+
+// disable kover tasks because there are no non-test classes in the project
+tasks.named("koverHtmlReport") {
+ enabled = false
+}
+tasks.named("koverXmlReport") {
+ enabled = false
+}
+tasks.named("koverVerify") {
+ enabled = false
+}
+
+kotlin {
+ sourceSets {
+ configureEach {
+ languageSettings {
+ optIn("kotlinx.serialization.internal.CoreFriendModuleApi")
+ optIn("kotlinx.serialization.json.internal.JsonFriendModuleApi")
+ }
+ }
+ val commonTest by getting {
+ dependencies {
+ api(project(":kotlinx-serialization-json"))
+ api(project(":kotlinx-serialization-json-okio"))
+ implementation("com.squareup.okio:okio:${property("okio_version")}")
+ }
+ }
+
+ val jvmTest by getting {
+ dependencies {
+ implementation("com.google.code.gson:gson:2.8.5")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${property("coroutines_version")}")
+ }
+ }
+ }
+}
+
+project.configureJava9ModuleInfo()
+
+// TODO: Remove this after okio will be updated to the version with 1.9.20 stdlib dependency
+configurations.all {
+ resolutionStrategy.eachDependency {
+ if (requested.name == "kotlin-stdlib-wasm") {
+ useTarget("org.jetbrains.kotlin:kotlin-stdlib-wasm-js:${requested.version}")
+ }
+ }
+}