[Gradle][MPP] Promote several K/N targets deprecation level to error
This commit is contained in:
committed by
Space Team
parent
1b1cfd45a0
commit
1ef198ead4
+1
-1
@@ -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(
|
||||
|
||||
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user