KT-58862: Remove cinterop -mode option

metadata cinterop libraries perform pretty well for years,
so we can drop this flag.
This commit is contained in:
Sergey Bogolepov
2023-06-21 17:30:50 +03:00
committed by Space Team
parent 807e7f1c28
commit d433d1eb3f
8 changed files with 5 additions and 67 deletions
@@ -173,20 +173,6 @@ class NativeDownloadAndPlatformLibsIT : BaseGradleIT() {
}
}
@Test
fun testSettingGenerationMode() = with(platformLibrariesProject("linuxX64")) {
// Check that user can change generation mode used by the cinterop tool.
buildWithLightDist("tasks", "-Pkotlin.native.platform.libraries.mode=metadata") {
assertSuccessful()
assertTrue(
extractNativeCompilerCommandLineArguments(
taskOutput = output,
toolName = NativeToolKind.GENERATE_PLATFORM_LIBRARIES
).containsSequentially("-mode", "metadata")
)
}
}
@Test
fun testCompilerReinstallation() = with(platformLibrariesProject("linuxX64")) {
// Install the compiler at the first time. Don't build to reduce execution time.
@@ -73,7 +73,6 @@ data class BuildOptions(
val cocoapodsArchs: String? = null,
val distributionType: String? = null,
val distributionDownloadFromMaven: Boolean? = null,
val platformLibrariesMode: String? = null,
val reinstall: Boolean? = null,
val restrictedDistribution: Boolean? = null,
val useXcodeMessageStyle: Boolean? = null,
@@ -219,9 +218,6 @@ data class BuildOptions(
nativeOptions.distributionType?.let {
arguments.add("-Pkotlin.native.distribution.type=${it}")
}
nativeOptions.platformLibrariesMode?.let {
arguments.add("-Pkotlin.native.platform.libraries.mode=${it}")
}
nativeOptions.reinstall?.let {
arguments.add("-Pkotlin.native.reinstall=${it}")
}
@@ -303,13 +303,6 @@ internal class PropertiesProvider private constructor(private val project: Proje
val nativeDownloadFromMaven: Boolean
get() = this.booleanProperty("kotlin.native.distribution.downloadFromMaven") ?: false
/**
* Allows a user to force a particular cinterop mode for platform libraries generation. Available modes: sourcecode, metadata.
* A main purpose of this property is working around potential problems with the metadata mode.
*/
val nativePlatformLibrariesMode: String?
get() = this.property("kotlin.native.platform.libraries.mode")
/**
* Allows a user to provide a local Kotlin/Native distribution instead of a downloaded one.
*/
@@ -46,10 +46,6 @@ internal class PlatformLibrariesGenerator(val project: Project, val konanTarget:
private val shouldBuildCaches: Boolean =
konanPropertiesService.cacheWorksFor(konanTarget) && konanCacheKind != NativeCacheKind.NONE
private val mode: String? by lazy {
PropertiesProvider(project).nativePlatformLibrariesMode
}
private val presentDefs: Set<String> by lazy {
defDirectory
.listFiles { file -> file.extension == "def" }.orEmpty()
@@ -126,11 +122,6 @@ internal class PlatformLibrariesGenerator(val project: Project, val konanTarget:
args.addArg("-cache-arg", it)
}
}
mode?.let {
args.addArg("-mode", it)
}
KotlinNativeLibraryGenerationRunner.fromProject(this).run(args)
}