From 9876ecd6df7ec22aee8cc6b79366af9803a47f6b Mon Sep 17 00:00:00 2001 From: Dmitry Savvinov Date: Tue, 27 Mar 2018 12:36:39 +0300 Subject: [PATCH] Minor: reformat CommonCompilerArguments --- .../arguments/CommonCompilerArguments.kt | 63 ++++++++++--------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt index da92f82d1f1..326b2804db3 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt @@ -25,7 +25,8 @@ import java.util.* @SuppressWarnings("WeakerAccess") abstract class CommonCompilerArguments : CommonToolArguments() { companion object { - @JvmStatic private val serialVersionUID = 0L + @JvmStatic + private val serialVersionUID = 0L const val PLUGIN_OPTION_FORMAT = "plugin::=" @@ -39,9 +40,9 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @GradleOption(DefaultValues.LanguageVersions::class) @Argument( - value = "-language-version", - valueDescription = "", - description = "Provide source compatibility with specified language version" + value = "-language-version", + valueDescription = "", + description = "Provide source compatibility with specified language version" ) var languageVersion: String? by FreezableVar(null) @@ -50,16 +51,16 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @GradleOption(DefaultValues.LanguageVersions::class) @Argument( - value = "-api-version", - valueDescription = "", - description = "Allow to use declarations only from the specified version of bundled libraries" + value = "-api-version", + valueDescription = "", + description = "Allow to use declarations only from the specified version of bundled libraries" ) var apiVersion: String? by FreezableVar(null) @Argument( - value = "-kotlin-home", - valueDescription = "", - description = "Path to Kotlin compiler home directory, used for runtime libraries discovery" + value = "-kotlin-home", + valueDescription = "", + description = "Path to Kotlin compiler home directory, used for runtime libraries discovery" ) var kotlinHome: String? by FreezableVar(null) @@ -72,12 +73,15 @@ abstract class CommonCompilerArguments : CommonToolArguments() { var noInline: Boolean by FreezableVar(false) @Argument( - value = "-Xskip-metadata-version-check", - description = "Load classes with bad metadata version anyway (incl. pre-release classes)" + value = "-Xskip-metadata-version-check", + description = "Load classes with bad metadata version anyway (incl. pre-release classes)" ) var skipMetadataVersionCheck: Boolean by FreezableVar(false) - @Argument(value = "-Xallow-kotlin-package", description = "Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info") + @Argument( + value = "-Xallow-kotlin-package", + description = "Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info" + ) var allowKotlinPackage: Boolean by FreezableVar(false) @Argument(value = "-Xreport-output-files", description = "Report source to output files mapping") @@ -93,34 +97,34 @@ abstract class CommonCompilerArguments : CommonToolArguments() { var noCheckActual: Boolean by FreezableVar(false) @Argument( - value = "-Xintellij-plugin-root", - valueDescription = "", - description = "Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found" + value = "-Xintellij-plugin-root", + valueDescription = "", + description = "Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found" ) var intellijPluginRoot: String? by FreezableVar(null) @Argument( - value = "-Xcoroutines", - valueDescription = "{enable|warn|error}", - description = "Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier" + value = "-Xcoroutines", + valueDescription = "{enable|warn|error}", + description = "Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier" ) var coroutinesState: String? by FreezableVar(WARN) @Argument( - value = "-Xnew-inference", - description = "Enable new experimental generic type inference algorithm" + value = "-Xnew-inference", + description = "Enable new experimental generic type inference algorithm" ) var newInference: Boolean by FreezableVar(false) @Argument( - value = "-Xlegacy-smart-cast-after-try", - description = "Allow var smart casts despite assignment in try block" + value = "-Xlegacy-smart-cast-after-try", + description = "Allow var smart casts despite assignment in try block" ) var legacySmartCastAfterTry: Boolean by FreezableVar(false) @Argument( - value = "-Xeffect-system", - description = "Enable experimental language feature: effect system" + value = "-Xeffect-system", + description = "Enable experimental language feature: effect system" ) var effectSystem: Boolean by FreezableVar(false) @@ -131,9 +135,9 @@ abstract class CommonCompilerArguments : CommonToolArguments() { var readDeserializedContracts: Boolean by FreezableVar(false) @Argument( - value = "-Xexperimental", - valueDescription = "", - description = "Enable and propagate usages of experimental API for marker annotation with the given fully qualified name" + value = "-Xexperimental", + valueDescription = "", + description = "Enable and propagate usages of experimental API for marker annotation with the given fully qualified name" ) var experimental: Array? by FreezableVar(null) @@ -190,7 +194,8 @@ abstract class CommonCompilerArguments : CommonToolArguments() { when (coroutinesState) { CommonCompilerArguments.ERROR -> put(LanguageFeature.Coroutines, LanguageFeature.State.ENABLED_WITH_ERROR) CommonCompilerArguments.ENABLE -> put(LanguageFeature.Coroutines, LanguageFeature.State.ENABLED) - CommonCompilerArguments.WARN -> {} + CommonCompilerArguments.WARN -> { + } else -> { val message = "Invalid value of -Xcoroutines (should be: enable, warn or error): " + coroutinesState collector.report(CompilerMessageSeverity.ERROR, message, null)