• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 }
18 
<lambda>null19 kotlin {
20     targets {
21         jvm {
22             compilations.all {
23                 kotlinOptions.jvmTarget = "1.8"
24             }
25             testRuns["test"].executionTask.configure {
26                 useJUnit()
27             }
28         }
29         js {
30             nodejs()
31         }
32     }
33     sourceSets {
34         val commonMain by getting {
35             dependencies {
36                 implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
37             }
38         }
39         val commonTest by getting {
40             dependencies {
41                 implementation(kotlin("test-common"))
42                 implementation(kotlin("test-annotations-common"))
43             }
44         }
45         val jvmMain by getting {
46             dependencies {
47                 implementation(kotlin("stdlib"))
48             }
49         }
50         val jvmTest by getting {
51             dependencies {
52                 implementation(kotlin("test-junit"))
53             }
54         }
55         val jsMain by getting {
56             dependencies {
57                 implementation("org.jetbrains.kotlin:kotlin-stdlib-js")
58             }
59         }
60         val jsTest by getting {
61             dependencies {
62                 implementation("org.jetbrains.kotlin:kotlin-test-js")
63             }
64         }
65     }
66 
67     tasks.named("compileTestKotlinJvm") {
68         doLast {
69             file("$buildDir/test_compile_jvm_classpath.txt").writeText(
70                 targets["jvm"].compilations["test"].compileDependencyFiles.joinToString("\n")
71             )
72         }
73     }
74 
75     tasks.named("jvmTest") {
76         doLast {
77             file("$buildDir/test_runtime_jvm_classpath.txt").writeText(
78                 (targets["jvm"].compilations["test"] as KotlinCompilationToRunnableFiles).runtimeDependencyFiles.joinToString("\n")
79             )
80         }
81     }
82 
83     tasks.named("compileTestKotlinJs") {
84         doLast {
85             file("$buildDir/test_compile_js_classpath.txt").writeText(
86                 targets["js"].compilations["test"].compileDependencyFiles.joinToString("\n")
87             )
88         }
89     }
90 }
91