1 import org.jetbrains.kotlin.gradle.plugin.*
2 
<lambda>null3 buildscript {
4     dependencies {
5         classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.17.0")
6     }
7 }
8 
<lambda>null9 plugins {
10     kotlin("multiplatform")
11 }
12 
13 apply(plugin = "kotlinx-atomicfu")
14 
<lambda>null15 repositories {
16     mavenCentral()
17     (properties["kotlin_repo_url"] as? String)?.let { maven(it) }
18 }
19 
<lambda>null20 kotlin {
21     targets {
22         jvm {
23             compilations.all {
24                 kotlinOptions.jvmTarget = "1.8"
25             }
26             testRuns["test"].executionTask.configure {
27                 useJUnit()
28             }
29         }
30         js {
31             nodejs()
32         }
33     }
34     sourceSets {
35         val commonMain by getting {
36             dependencies {
37                 implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
38             }
39         }
40         val commonTest by getting {
41             dependencies {
42                 implementation(kotlin("test-common"))
43                 implementation(kotlin("test-annotations-common"))
44             }
45         }
46         val jvmMain by getting {
47             dependencies {
48                 implementation(kotlin("stdlib"))
49             }
50         }
51         val jvmTest by getting {
52             dependencies {
53                 implementation(kotlin("test-junit"))
54             }
55         }
56         val jsMain by getting {
57             dependencies {
58                 implementation("org.jetbrains.kotlin:kotlin-stdlib-js")
59             }
60         }
61         val jsTest by getting {
62             dependencies {
63                 implementation("org.jetbrains.kotlin:kotlin-test-js")
64             }
65         }
66     }
67 
68     tasks.named("compileTestKotlinJvm") {
69         doLast {
70             file("$buildDir/test_compile_jvm_classpath.txt").writeText(
71                 targets["jvm"].compilations["test"].compileDependencyFiles.joinToString("\n")
72             )
73         }
74     }
75 
76     tasks.named("jvmTest") {
77         doLast {
78             file("$buildDir/test_runtime_jvm_classpath.txt").writeText(
79                 (targets["jvm"].compilations["test"] as KotlinCompilationToRunnableFiles).runtimeDependencyFiles.joinToString("\n")
80             )
81         }
82     }
83 
84     tasks.named("compileTestKotlinJs") {
85         doLast {
86             file("$buildDir/test_compile_js_classpath.txt").writeText(
87                 targets["js"].compilations["test"].compileDependencyFiles.joinToString("\n")
88             )
89         }
90     }
91 }
92