Skip to content

Commit 0877255

Browse files
sbogolepovSpace Team
authored andcommitted
kotlin-test-native-xctest: refine KGP script
use compilerOptions DSL instead of sourceSets
1 parent 544f87b commit 0877255

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

native/kotlin-test-native-xctest/build.gradle.kts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ kotlin {
112112

113113
forEach {
114114
val copyTask = registerCopyFrameworkTask(it.konanTarget)
115-
it.compilations.getByName("main") {
115+
it.compilations.named("main") {
116116
cinterops {
117117
register("XCTest") {
118118
compilerOpts("-iframework", copyTask.map { it.destinationDir }.get().absolutePath)
@@ -125,13 +125,11 @@ kotlin {
125125
}
126126
}
127127
}
128-
sourceSets.all {
129-
languageSettings.apply {
130-
// Oh, yeah! So much experimental, so wow!
131-
optIn("kotlinx.cinterop.BetaInteropApi")
132-
optIn("kotlinx.cinterop.ExperimentalForeignApi")
133-
optIn("kotlin.experimental.ExperimentalNativeApi")
134-
}
128+
129+
compilerOptions {
130+
optIn.add("kotlinx.cinterop.BetaInteropApi")
131+
optIn.add("kotlinx.cinterop.ExperimentalForeignApi")
132+
optIn.add("kotlin.experimental.ExperimentalNativeApi")
135133
}
136134
}
137135

0 commit comments

Comments
 (0)