From 2ae7740c460796b49eb4425dd7e7b70661ef356e Mon Sep 17 00:00:00 2001 From: Alexander Likhachev Date: Tue, 9 Mar 2021 16:21:03 +0300 Subject: [PATCH] Set explicit lang version 1.3 for kotlin-native-utils & kotlin-util-io Without explicit version we cannot use those modules in buildscripts with Gradle 6.8+ because Gradle doesn't set flag `skipPrereleaseCheck` (previously was named `skipMetadataVersionCheck`). This way we make it compatible with all supported versions of Gradle. --- compiler/util-io/build.gradle.kts | 7 +++++++ native/utils/build.gradle.kts | 7 +++++++ .../utils/src/org/jetbrains/kotlin/konan/target/utils.kt | 4 +--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/compiler/util-io/build.gradle.kts b/compiler/util-io/build.gradle.kts index 2c6453178c6..fc64c1aeba3 100644 --- a/compiler/util-io/build.gradle.kts +++ b/compiler/util-io/build.gradle.kts @@ -15,6 +15,13 @@ sourceSets { "test" { projectDefault() } } +tasks { + withType { + kotlinOptions.languageVersion = "1.3" + kotlinOptions.apiVersion = "1.3" + } +} + publish() standardPublicJars() diff --git a/native/utils/build.gradle.kts b/native/utils/build.gradle.kts index 1fbf58a8622..b8f9fe79921 100644 --- a/native/utils/build.gradle.kts +++ b/native/utils/build.gradle.kts @@ -19,6 +19,13 @@ sourceSets { "test" { projectDefault() } } +tasks { + withType { + kotlinOptions.languageVersion = "1.3" + kotlinOptions.apiVersion = "1.3" + } +} + // TODO: this single known external consumer of this artifact is Kotlin/Native backend, // so publishing could be stopped after migration to monorepo publish() diff --git a/native/utils/src/org/jetbrains/kotlin/konan/target/utils.kt b/native/utils/src/org/jetbrains/kotlin/konan/target/utils.kt index 8254b14cb10..806341d5970 100644 --- a/native/utils/src/org/jetbrains/kotlin/konan/target/utils.kt +++ b/native/utils/src/org/jetbrains/kotlin/konan/target/utils.kt @@ -5,8 +5,6 @@ package org.jetbrains.kotlin.konan.target -import java.util.* - /** * Name of a preset used in the 'kotlin-multiplatform' Gradle plugin to represent this target. */ @@ -21,5 +19,5 @@ val KonanTarget.presetName: String private fun evaluatePresetName(targetName: String): String { val nameParts = targetName.split('_').mapNotNull { it.takeIf(String::isNotEmpty) } - return nameParts.asSequence().drop(1).joinToString("", nameParts.firstOrNull().orEmpty()) { it.capitalize(Locale.US) } + return nameParts.asSequence().drop(1).joinToString("", nameParts.firstOrNull().orEmpty()) { it.capitalize() } }