[K/N] Add kotlinx.cinterop.ExperimentalForeignApi opt-ins

Add more opt-ins in Samples, tests and Benchmarks.
This is a follow-up to KT-MR-9788 

Merge-request: KT-MR-9997
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
This commit is contained in:
Pavel Punegov
2023-05-09 09:39:40 +00:00
committed by Space Team
parent 14653799b5
commit 5a95d919c7
8 changed files with 24 additions and 9 deletions
@@ -2,6 +2,7 @@
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file. * that can be found in the LICENSE file.
*/ */
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlinx.cinterop.convert import kotlinx.cinterop.convert
import platform.posix.* import platform.posix.*
@@ -21,7 +21,10 @@ allprojects {
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile>().configureEach { tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile>().configureEach {
compilerOptions.freeCompilerArgs.add("-XXLanguage:+ImplicitSignedToUnsignedIntegerConversion") compilerOptions.freeCompilerArgs.addAll(
"-XXLanguage:+ImplicitSignedToUnsignedIntegerConversion",
"-opt-in=kotlinx.cinterop.ExperimentalForeignApi"
)
} }
} }
@@ -20,8 +20,14 @@ benchmark {
} }
val native = kotlin.targets.getByName("native") as KotlinNativeTarget val native = kotlin.targets.getByName("native") as KotlinNativeTarget
native.compilations["main"].cinterops { native.compilations["main"].apply {
create("macros") cinterops {
create("struct") create("macros")
create("types") create("struct")
create("types")
}
compilerOptions
.options
.freeCompilerArgs
.add("-opt-in=kotlinx.cinterop.ExperimentalForeignApi")
} }
@@ -2,6 +2,7 @@
* Copyright 2010-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * Copyright 2010-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file. * that can be found in the LICENSE file.
*/ */
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
package org.jetbrains.ring package org.jetbrains.ring
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2017 JetBrains s.r.o. * Copyright 2010-2023 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
package org.jetbrains.benchmarksLauncher package org.jetbrains.benchmarksLauncher
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2017 JetBrains s.r.o. * Copyright 2010-2023 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
package org.jetbrains.benchmarksLauncher package org.jetbrains.benchmarksLauncher
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2017 JetBrains s.r.o. * Copyright 2010-2023 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
package org.jetbrains.benchmarksLauncher package org.jetbrains.benchmarksLauncher
@@ -1,7 +1,8 @@
/* /*
* Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * Copyright 2010-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file. * that can be found in the LICENSE file.
*/ */
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
package org.jetbrains.analyzer package org.jetbrains.analyzer