[Gradle, JS] Rename public KotlinJsCompilerType

This commit is contained in:
Ilya Goncharov
2020-02-19 16:04:13 +03:00
parent 488538889b
commit 203ca018e5
17 changed files with 54 additions and 56 deletions
@@ -10,7 +10,7 @@ import java.io.Serializable
// For Gradle attributes
@Suppress("EnumEntryName")
enum class JsCompilerType : Named, Serializable {
enum class KotlinJsCompilerType : Named, Serializable {
legacy,
ir,
both;
@@ -24,13 +24,13 @@ enum class JsCompilerType : Named, Serializable {
companion object {
const val jsCompilerProperty = "kotlin.js.compiler"
fun byArgument(argument: String): JsCompilerType? =
JsCompilerType
fun byArgument(argument: String): KotlinJsCompilerType? =
KotlinJsCompilerType
.values().firstOrNull { it.name.equals(argument, ignoreCase = true) }
}
}
fun String.removeJsCompilerSuffix(compilerType: JsCompilerType): String {
fun String.removeJsCompilerSuffix(compilerType: KotlinJsCompilerType): String {
val truncatedString = removeSuffix(compilerType.name)
if (this != truncatedString) {
return truncatedString
@@ -6,5 +6,5 @@
package org.jetbrains.kotlin.gradle.plugin
interface KotlinJsCompilerTypeHolder {
val defaultJsCompilerType: JsCompilerType
val defaultJsCompilerType: KotlinJsCompilerType
}