summaryrefslogtreecommitdiff
path: root/formats/json-tests/build.gradle.kts
blob: 6be0a3a79747b52aed57cf935dd557546f512db2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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}")
        }
    }
}