summaryrefslogtreecommitdiff
path: root/formats/json/build.gradle
blob: d35bcb5dc1943fdd018902702949866b71737ab9 (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
import static KotlinVersion.isKotlinVersionAtLeast

/*
 * Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

apply plugin: 'kotlin-multiplatform'
apply plugin: 'kotlinx-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 tests 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")
            }
        }
        commonMain {
            dependencies {
                api project(":kotlinx-serialization-core")
            }
        }
        jsWasmMain {
            dependsOn(sourceSets.commonMain)
        }
        jsMain {
            dependsOn(sourceSets.jsWasmMain)
        }
        wasmJsMain {
            dependsOn(sourceSets.jsWasmMain)
        }
        wasmWasiMain {
            dependsOn(sourceSets.jsWasmMain)
        }
    }
}

Java9Modularity.configureJava9ModuleInfo(project)

// This task should be disabled because of no need to build and publish intermediate JsWasm sourceset
tasks.whenTaskAdded { task ->
    if (task.name == 'compileJsWasmMainKotlinMetadata') {
        task.enabled = false
    }
}