[Gradle, JS] Move JsCompilerType to Gradle Plugin API

This commit is contained in:
Ilya Goncharov
2020-02-13 19:55:21 +03:00
parent 82d31adb24
commit 1bebcd398e
14 changed files with 16 additions and 19 deletions
@@ -0,0 +1,31 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.plugin
import org.gradle.api.Named
import java.io.Serializable
// For Gradle attributes
@Suppress("EnumEntryName")
enum class JsCompilerType : Named, Serializable {
legacy,
ir,
both;
override fun getName(): String =
name.toLowerCase()
override fun toString(): String =
getName()
companion object {
const val jsCompilerProperty = "kotlin.js.compiler"
fun byArgument(argument: String): JsCompilerType? =
JsCompilerType
.values().firstOrNull { it.name.equals(argument, ignoreCase = true) }
}
}