From 61dbe7fb75df20e35faa9f10d766b99eec62ec66 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Mon, 24 Jul 2023 12:09:06 +0200 Subject: [PATCH] [Gradle] temporarily change error to warning for linuxArm32Hfp ^KT-58864 --- .../generators/gradle/dsl/presetEntries.kt | 2 +- ...KotlinTargetContainerWithPresetFunctions.kt | 18 +++++++++--------- .../DeprecatedKotlinNativeTargetsChecker.kt | 3 ++- .../kotlin/konan/target/KonanTarget.kt | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-dsl-codegen/src/main/kotlin/org/jetbrains/kotlin/generators/gradle/dsl/presetEntries.kt b/libraries/tools/kotlin-gradle-plugin-dsl-codegen/src/main/kotlin/org/jetbrains/kotlin/generators/gradle/dsl/presetEntries.kt index 2acd9b6ef39..cb337128bdc 100644 --- a/libraries/tools/kotlin-gradle-plugin-dsl-codegen/src/main/kotlin/org/jetbrains/kotlin/generators/gradle/dsl/presetEntries.kt +++ b/libraries/tools/kotlin-gradle-plugin-dsl-codegen/src/main/kotlin/org/jetbrains/kotlin/generators/gradle/dsl/presetEntries.kt @@ -113,7 +113,7 @@ internal val nativePresetEntries = HostManager().targets val deprecation = KotlinPresetEntry.Deprecation( message = "DEPRECATED_TARGET_MESSAGE", - level = DeprecationLevel.ERROR + level = if (target in KonanTarget.toleratedDeprecatedTargets) DeprecationLevel.WARNING else DeprecationLevel.ERROR ).takeIf { target in KonanTarget.deprecatedTargets } KotlinPresetEntry(target.presetName, typeName(presetType), typeName(targetType), deprecation) } diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinTargetContainerWithPresetFunctions.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinTargetContainerWithPresetFunctions.kt index 43dcbdfc75e..1b12b7380de 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinTargetContainerWithPresetFunctions.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinTargetContainerWithPresetFunctions.kt @@ -475,7 +475,7 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP fun linuxArm64(configure: Action) = linuxArm64 { configure.execute(this) } - @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR) + @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.WARNING) fun linuxArm32Hfp( name: String = "linuxArm32Hfp", configure: KotlinNativeTarget.() -> Unit = { } @@ -487,20 +487,20 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP ) - @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR) - @Suppress("DEPRECATION_ERROR") + @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.WARNING) + @Suppress("DEPRECATION") fun linuxArm32Hfp() = linuxArm32Hfp("linuxArm32Hfp") { } - @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR) - @Suppress("DEPRECATION_ERROR") + @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.WARNING) + @Suppress("DEPRECATION") fun linuxArm32Hfp(name: String) = linuxArm32Hfp(name) { } - @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR) - @Suppress("DEPRECATION_ERROR") + @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.WARNING) + @Suppress("DEPRECATION") fun linuxArm32Hfp(name: String, configure: Action) = linuxArm32Hfp(name) { configure.execute(this) } - @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR) - @Suppress("DEPRECATION_ERROR") + @Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.WARNING) + @Suppress("DEPRECATION") fun linuxArm32Hfp(configure: Action) = linuxArm32Hfp { configure.execute(this) } diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/checkers/DeprecatedKotlinNativeTargetsChecker.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/checkers/DeprecatedKotlinNativeTargetsChecker.kt index e7a9ad0debf..ecc2e456d7e 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/checkers/DeprecatedKotlinNativeTargetsChecker.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/checkers/DeprecatedKotlinNativeTargetsChecker.kt @@ -16,7 +16,8 @@ internal object DeprecatedKotlinNativeTargetsChecker : KotlinGradleProjectChecke override suspend fun KotlinGradleProjectCheckerContext.runChecks(collector: KotlinToolingDiagnosticsCollector) { val targets = multiplatformExtension?.awaitTargets() ?: return val usedDeprecatedTargets = targets - .filter { it is KotlinNativeTarget && it.konanTarget in KonanTarget.deprecatedTargets } + .filterIsInstance() + .filter { it.konanTarget in KonanTarget.deprecatedTargets && it.konanTarget !in KonanTarget.toleratedDeprecatedTargets } .map { it.name } if (usedDeprecatedTargets.isEmpty()) return diff --git a/native/utils/src/org/jetbrains/kotlin/konan/target/KonanTarget.kt b/native/utils/src/org/jetbrains/kotlin/konan/target/KonanTarget.kt index 11f059a7ecd..f643d98fc54 100644 --- a/native/utils/src/org/jetbrains/kotlin/konan/target/KonanTarget.kt +++ b/native/utils/src/org/jetbrains/kotlin/konan/target/KonanTarget.kt @@ -67,5 +67,6 @@ sealed class KonanTarget(override val name: String, val family: Family, val arch } val deprecatedTargets = setOf(WATCHOS_X86, IOS_ARM32, LINUX_ARM32_HFP, MINGW_X86, LINUX_MIPS32, LINUX_MIPSEL32, WASM32) + val toleratedDeprecatedTargets = setOf(LINUX_ARM32_HFP) } }