[Gradle][MPP] Promote several K/N targets deprecation level to error

This commit is contained in:
Alexander Shabalin
2023-05-17 14:05:14 +02:00
committed by Space Team
parent 1b1cfd45a0
commit 1ef198ead4
9 changed files with 95 additions and 95 deletions
@@ -62,7 +62,7 @@ private fun generateAbstractKotlinArtifactsExtensionImplementation() {
val deprecatedKonanTargetConstants = KonanTarget.predefinedTargets.values.filter { KonanTarget.deprecatedTargets.contains(it) }
.joinToString("\n") {
"\n@Deprecated(DEPRECATED_TARGET_MESSAGE)\n" + it.generateKonanTargetVal()
"\n@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)\n" + it.generateKonanTargetVal()
}.indented(4)
val code = listOf(
@@ -21,7 +21,7 @@ private fun generateKotlinTargetContainerWithPresetFunctionsInterface() {
// Generate KotlinMultiplatformExtension subclass with member functions for the presets:
val functions = nativePresetEntries.map { kotlinPreset ->
// magic indent is needed to make the result look pretty
val funPrefix = kotlinPreset.deprecation?.let { "\n $it\n @Suppress(\"DEPRECATION\")\n " } ?: ""
val funPrefix = kotlinPreset.deprecation?.let { "\n $it\n @Suppress(\"DEPRECATION_ERROR\")\n " } ?: ""
generatePresetFunctions(kotlinPreset, presetsProperty, "configureOrCreate", funPrefix)
}
@@ -63,7 +63,7 @@ internal val nativePresetEntries = HostManager().targets
else ->
Presets.simple to Targets.base
}
val deprecation = "@Deprecated(DEPRECATED_TARGET_MESSAGE)".takeIf { target in KonanTarget.deprecatedTargets }
val deprecation = "@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)".takeIf { target in KonanTarget.deprecatedTargets }
KotlinPresetEntry(target.presetName, typeName(presetType), typeName(targetType), deprecation)
}