Minor, generate trailing comma in enums in Gradle compiler types
This both simplifies the generator code and makes the generated code conform to the style guide (see https://kotlinlang.org/docs/coding-conventions.html#trailing-commas), in particular it improves version control diffs for generated enums.
This commit is contained in:
+2
-1
@@ -7,7 +7,8 @@ package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
enum class JsDiagnosticMode(val mode: String) {
|
||||
RUNTIME_DIAGNOSTIC_EXCEPTION("exception"),
|
||||
RUNTIME_DIAGNOSTIC_LOG("log");
|
||||
RUNTIME_DIAGNOSTIC_LOG("log"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun fromMode(mode: String): JsDiagnosticMode =
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
enum class JsMainFunctionExecutionMode(val mode: String) {
|
||||
CALL("call"),
|
||||
NO_CALL("noCall");
|
||||
NO_CALL("noCall"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun fromMode(mode: String): JsMainFunctionExecutionMode =
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ enum class JsModuleKind(val kind: String) {
|
||||
MODULE_PLAIN("plain"),
|
||||
MODULE_ES("es"),
|
||||
MODULE_COMMONJS("commonjs"),
|
||||
MODULE_UMD("umd");
|
||||
MODULE_UMD("umd"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun fromKind(kind: String): JsModuleKind =
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ package org.jetbrains.kotlin.gradle.dsl
|
||||
enum class JsSourceMapEmbedMode(val mode: String) {
|
||||
SOURCE_MAP_SOURCE_CONTENT_INLINING("inlining"),
|
||||
SOURCE_MAP_SOURCE_CONTENT_NEVER("never"),
|
||||
SOURCE_MAP_SOURCE_CONTENT_ALWAYS("always");
|
||||
SOURCE_MAP_SOURCE_CONTENT_ALWAYS("always"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun fromMode(mode: String): JsSourceMapEmbedMode =
|
||||
|
||||
+2
-1
@@ -16,7 +16,8 @@ enum class JvmTarget(val target: String) {
|
||||
JVM_15("15"),
|
||||
JVM_16("16"),
|
||||
JVM_17("17"),
|
||||
JVM_18("18");
|
||||
JVM_18("18"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun fromTarget(target: String): JvmTarget =
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@ enum class KotlinVersion(val version: String) {
|
||||
KOTLIN_1_6("1.6"),
|
||||
KOTLIN_1_7("1.7"),
|
||||
KOTLIN_1_8("1.8"),
|
||||
KOTLIN_1_9("1.9");
|
||||
KOTLIN_1_9("1.9"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun fromVersion(version: String): KotlinVersion =
|
||||
|
||||
Reference in New Issue
Block a user