summaryrefslogtreecommitdiff
path: root/formats/json-okio/build.gradle.kts
blob: a51fff0326b852f629e0e8f9ccc6b3e0ebbd4d1e (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
61
62
/*
 * 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.dokka.gradle.*
import java.net.*

plugins {
    kotlin("multiplatform")
    kotlin("plugin.serialization")
}

apply(from = rootProject.file("gradle/native-targets.gradle"))
apply(from = rootProject.file("gradle/configure-source-sets.gradle"))

kotlin {
    sourceSets {
        configureEach {
            languageSettings {
                optIn("kotlinx.serialization.internal.CoreFriendModuleApi")
                optIn("kotlinx.serialization.json.internal.JsonFriendModuleApi")
            }
        }
        val commonMain by getting {
            dependencies {
                api(project(":kotlinx-serialization-core"))
                api(project(":kotlinx-serialization-json"))
                implementation("com.squareup.okio:okio:${property("okio_version")}")
            }
        }
        val commonTest by getting {
            dependencies {
                implementation("com.squareup.okio:okio:${property("okio_version")}")
            }
        }
    }
}

project.configureJava9ModuleInfo()

tasks.named<DokkaTaskPartial>("dokkaHtmlPartial") {
    dokkaSourceSets {
        configureEach {
            externalDocumentationLink {
                url.set(URL("https://square.github.io/okio/3.x/okio/"))
                packageListUrl.set(
                    file("dokka/okio.package.list").toURI().toURL()
                )
            }
        }
    }
}


// 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}")
        }
    }
}