[Gradle, JS] Move JsCompilerType to Gradle Plugin API
This commit is contained in:
+31
@@ -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) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user