• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download

<lambda>null1 plugins {
2   kotlin("multiplatform")
3   id("build-support")
4 }
5 
<lambda>null6 kotlin {
7   configureOrCreateOkioPlatforms()
8 
9   sourceSets {
10     all {
11       languageSettings.apply {
12         optIn("kotlin.time.ExperimentalTime")
13       }
14     }
15 
16     val commonMain by getting {
17       dependencies {
18         api(projects.okio)
19         api(libs.kotlin.test)
20       }
21     }
22 
23     val nonWasmMain by creating {
24       dependsOn(commonMain)
25       dependencies {
26         api(libs.kotlin.time)
27         implementation(projects.okioFakefilesystem)
28       }
29     }
30 
31     val zlibMain by creating {
32       dependsOn(commonMain)
33     }
34 
35     if (kmpJsEnabled) {
36       val jsMain by getting {
37         dependsOn(nonWasmMain)
38       }
39     }
40 
41     val jvmMain by getting {
42       dependsOn(nonWasmMain)
43       dependsOn(zlibMain)
44       dependencies {
45         // On the JVM the kotlin-test library resolves to one of three implementations based on
46         // which testing framework is in use. JUnit is used downstream, but Gradle can't know that
47         // here and thus fails to select a variant automatically. Declare it manually instead.
48         api(libs.kotlin.test.junit)
49       }
50     }
51 
52     if (kmpNativeEnabled) {
53       createSourceSet("nativeMain", children = nativeTargets)
54         .also { nativeMain ->
55           nativeMain.dependsOn(nonWasmMain)
56           nativeMain.dependsOn(zlibMain)
57         }
58     }
59 
60     if (kmpWasmEnabled) {
61       createSourceSet("wasmMain", children = wasmTargets)
62         .also { wasmMain ->
63           wasmMain.dependsOn(commonMain)
64         }
65     }
66   }
67 }
68