|
| 1 | +import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget |
1 | 2 | import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget |
2 | 3 |
|
3 | | -val coroutinesVersion = "1.3.9" |
4 | | -val atomicfuVersion = "0.14.4" |
| 4 | +val coroutinesVersion = "1.4.3" |
| 5 | +val atomicfuVersion = "0.15.0" |
5 | 6 |
|
6 | 7 | plugins { |
7 | | - kotlin("multiplatform") version "1.4.21" |
| 8 | + kotlin("multiplatform") version "1.4.32" |
8 | 9 | id("org.jetbrains.dokka") version "0.10.0" |
9 | 10 | id("maven-publish") |
10 | 11 | id("signing") |
@@ -36,19 +37,28 @@ kotlin { |
36 | 37 | browser() |
37 | 38 | nodejs() |
38 | 39 | } |
| 40 | + } |
39 | 41 |
|
40 | | - val nativeTargets = mutableListOf<KotlinNativeTarget>() |
| 42 | + iosX64() |
| 43 | + iosArm64() |
| 44 | + iosArm32() |
| 45 | + macosX64() |
| 46 | + mingwX64() |
| 47 | + linuxX64() |
41 | 48 |
|
42 | | - iosX64 { nativeTargets.add(this) } |
43 | | - iosArm64 { nativeTargets.add(this) } |
44 | | - iosArm32 { nativeTargets.add(this) } |
45 | | - macosX64 { nativeTargets.add(this) } |
46 | | - mingwX64 { nativeTargets.add(this) } |
47 | | - linuxX64 { nativeTargets.add(this) } |
| 49 | + targets.withType<KotlinNativeTarget> { |
| 50 | + val main by compilations.getting { |
| 51 | + kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") |
| 52 | + } |
| 53 | + } |
48 | 54 |
|
49 | | - nativeTargets.forEach { |
50 | | - val main by it.compilations.getting { |
51 | | - kotlinOptions.freeCompilerArgs = listOf("-Xuse-experimental=kotlin.Experimental") |
| 55 | + // do this in afterEvaluate, when nativeMain compilation becomes available |
| 56 | + afterEvaluate { |
| 57 | + targets.withType<KotlinMetadataTarget> { |
| 58 | + for (compilation in compilations) { |
| 59 | + if (compilation.name == "nativeMain") { |
| 60 | + compilation.kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") |
| 61 | + } |
52 | 62 | } |
53 | 63 | } |
54 | 64 | } |
@@ -103,7 +113,7 @@ kotlin { |
103 | 113 | val ktlintConfig by configurations.creating |
104 | 114 |
|
105 | 115 | dependencies { |
106 | | - ktlintConfig("com.pinterest:ktlint:0.40.0") |
| 116 | + ktlintConfig("com.pinterest:ktlint:0.41.0") |
107 | 117 | } |
108 | 118 |
|
109 | 119 | val ktlint by tasks.registering(JavaExec::class) { |
|
0 commit comments