xref: /aosp_15_r20/external/kotlinx.serialization/formats/json/build.gradle (revision 57b5a4a64c534cf7f27ac9427ceab07f3d8ed3d8)
1import static KotlinVersion.isKotlinVersionAtLeast
2
3/*
4 * Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
5 */
6
7apply plugin: 'kotlin-multiplatform'
8apply plugin: 'kotlinx-serialization'
9apply from: rootProject.file("gradle/native-targets.gradle")
10apply from: rootProject.file("gradle/configure-source-sets.gradle")
11
12// disable kover tasks because there are no tests in the project
13tasks.named("koverHtmlReport") {
14    enabled = false
15}
16tasks.named("koverXmlReport") {
17    enabled = false
18}
19tasks.named("koverVerify") {
20    enabled = false
21}
22
23kotlin {
24    sourceSets {
25        configureEach {
26            languageSettings {
27                optIn("kotlinx.serialization.internal.CoreFriendModuleApi")
28                optIn("kotlinx.serialization.json.internal.JsonFriendModuleApi")
29            }
30        }
31        commonMain {
32            dependencies {
33                api project(":kotlinx-serialization-core")
34            }
35        }
36        jsWasmMain {
37            dependsOn(sourceSets.commonMain)
38        }
39        jsMain {
40            dependsOn(sourceSets.jsWasmMain)
41        }
42        wasmJsMain {
43            dependsOn(sourceSets.jsWasmMain)
44        }
45        wasmWasiMain {
46            dependsOn(sourceSets.jsWasmMain)
47        }
48    }
49}
50
51Java9Modularity.configureJava9ModuleInfo(project)
52
53// This task should be disabled because of no need to build and publish intermediate JsWasm sourceset
54tasks.whenTaskAdded { task ->
55    if (task.name == 'compileJsWasmMainKotlinMetadata') {
56        task.enabled = false
57    }
58}
59