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 bf00e031570..f968fe8a627 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 @@ -43,7 +43,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-language-version", valueDescription = "", - description = "Provide source compatibility with the specified version of Kotlin" + description = "Provide source compatibility with the specified version of Kotlin." ) var languageVersion: String? = null set(value) { @@ -66,7 +66,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-api-version", valueDescription = "", - description = "Allow using declarations only from the specified version of bundled libraries" + description = "Allow using declarations from only the specified version of bundled libraries." ) var apiVersion: String? = null set(value) { @@ -77,7 +77,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-kotlin-home", valueDescription = "", - description = "Path to the home directory of Kotlin compiler used for discovery of runtime libraries" + description = "Path to the Kotlin compiler home directory used for the discovery of runtime libraries." ) var kotlinHome: String? = null set(value) { @@ -92,11 +92,11 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-progressive", deprecatedName = "-Xprogressive", - description = "Enable progressive compiler mode.\n" + - "In this mode, deprecations and bug fixes for unstable code take effect immediately,\n" + - "instead of going through a graceful migration cycle.\n" + - "Code written in the progressive mode is backward compatible; however, code written in\n" + - "non-progressive mode may cause compilation errors in the progressive mode." + description = """Enable progressive compiler mode. +In this mode, deprecations and bug fixes for unstable code take effect immediately +instead of going through a graceful migration cycle. +Code written in progressive mode is backward compatible; however, code written without +progressive mode enabled may cause compilation errors in progressive mode.""" ) var progressiveMode = false set(value) { @@ -104,7 +104,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { field = value } - @Argument(value = "-script", description = "Evaluate the given Kotlin script (*.kts) file") + @Argument(value = "-script", description = "Evaluate the given Kotlin script (*.kts) file.") var script = false set(value) { checkFrozen() @@ -119,7 +119,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { value = "-opt-in", deprecatedName = "-Xopt-in", valueDescription = "", - description = "Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name" + description = "Enable API usages that require opt-in with an opt-in requirement marker with the given fully qualified name." ) var optIn: Array? = null set(value) { @@ -129,7 +129,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { // Advanced options - @Argument(value = "-Xno-inline", description = "Disable method inlining") + @Argument(value = "-Xno-inline", description = "Disable method inlining.") var noInline = false set(value) { checkFrozen() @@ -138,7 +138,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xskip-metadata-version-check", - description = "Allow to load classes with bad metadata version and pre-release classes" + description = "Allow loading classes with bad metadata versions and pre-release classes." ) var skipMetadataVersionCheck = false set(value) { @@ -146,7 +146,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { field = value } - @Argument(value = "-Xskip-prerelease-check", description = "Allow to load pre-release classes") + @Argument(value = "-Xskip-prerelease-check", description = "Allow loading pre-release classes.") var skipPrereleaseCheck = false set(value) { checkFrozen() @@ -155,7 +155,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xallow-kotlin-package", - description = "Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info" + description = "Allow compiling code in the 'kotlin' package, and allow not requiring 'kotlin.stdlib' in 'module-info'." ) var allowKotlinPackage = false set(value) { @@ -163,21 +163,21 @@ abstract class CommonCompilerArguments : CommonToolArguments() { field = value } - @Argument(value = "-Xreport-output-files", description = "Report source to output files mapping") + @Argument(value = "-Xreport-output-files", description = "Report the source-to-output file mapping.") var reportOutputFiles = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xplugin", valueDescription = "", description = "Load plugins from the given classpath") + @Argument(value = "-Xplugin", valueDescription = "", description = "Load plugins from the given classpath.") var pluginClasspaths: Array? = null set(value) { checkFrozen() field = value } - @Argument(value = "-P", valueDescription = PLUGIN_OPTION_FORMAT, description = "Pass an option to a plugin") + @Argument(value = "-P", valueDescription = PLUGIN_OPTION_FORMAT, description = "Pass an option to a plugin.") var pluginOptions: Array? = null set(value) { checkFrozen() @@ -187,7 +187,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xcompiler-plugin", valueDescription = ",:=,=", - description = "Register compiler plugin", + description = "Register a compiler plugin.", delimiter = Argument.Delimiters.none ) var pluginConfigurations: Array? = null @@ -196,14 +196,14 @@ abstract class CommonCompilerArguments : CommonToolArguments() { field = value } - @Argument(value = "-Xmulti-platform", description = "Enable language support for multi-platform projects") + @Argument(value = "-Xmulti-platform", description = "Enable language support for multiplatform projects.") var multiPlatform = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xno-check-actual", description = "Do not check presence of 'actual' modifier in multi-platform projects") + @Argument(value = "-Xno-check-actual", description = "Do not check for the presence of the 'actual' modifier in multiplatform projects.") var noCheckActual = false set(value) { checkFrozen() @@ -213,7 +213,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xintellij-plugin-root", valueDescription = "", - description = "Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found" + description = "Path to 'kotlin-compiler.jar' or the directory where the IntelliJ IDEA configuration files can be found." ) var intellijPluginRoot: String? = null set(value) { @@ -223,7 +223,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xnew-inference", - description = "Enable new experimental generic type inference algorithm" + description = "Enable the new experimental generic type inference algorithm." ) var newInference = false set(value) { @@ -233,7 +233,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xinline-classes", - description = "Enable experimental inline classes" + description = "Enable experimental inline classes." ) var inlineClasses = false set(value) { @@ -243,7 +243,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xlegacy-smart-cast-after-try", - description = "Allow var smart casts despite assignment in try block" + description = "Allow 'var' smart casts even in the presence of assignments in 'try' blocks." ) var legacySmartCastAfterTry = false set(value) { @@ -253,7 +253,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xeffect-system", - description = "Enable experimental language feature: effect system" + description = "Enable experimental language feature: effect system." ) var effectSystem = false set(value) { @@ -263,7 +263,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xread-deserialized-contracts", - description = "Enable reading of contracts from metadata" + description = "Enable reading contracts from metadata." ) var readDeserializedContracts = false set(value) { @@ -293,7 +293,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xproper-ieee754-comparisons", - description = "Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types" + description = "Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types." ) var properIeee754Comparisons = false set(value) { @@ -301,7 +301,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { field = value } - @Argument(value = "-Xreport-perf", description = "Report detailed performance statistics") + @Argument(value = "-Xreport-perf", description = "Report detailed performance statistics.") var reportPerf = false set(value) { checkFrozen() @@ -311,7 +311,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xdump-perf", valueDescription = "", - description = "Dump detailed performance statistics to the specified file" + description = "Dump detailed performance statistics to the specified file." ) var dumpPerf: String? = null set(value) { @@ -321,7 +321,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xmetadata-version", - description = "Change metadata version of the generated binary files" + description = "Change the metadata version of the generated binary files." ) var metadataVersion: String? = null set(value) { @@ -332,8 +332,8 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xcommon-sources", valueDescription = "", - description = "Sources of the common module that need to be compiled together with this module in the multi-platform mode.\n" + - "Should be a subset of sources passed as free arguments" + description = """Sources of the common module that need to be compiled together with this module in multiplatform mode. +They should be a subset of sources passed as free arguments.""" ) var commonSources: Array? = null set(value) { @@ -343,7 +343,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xallow-result-return-type", - description = "Allow compiling code when `kotlin.Result` is used as a return type" + description = "Allow compiling code when 'kotlin.Result' is used as a return type." ) var allowResultReturnType = false set(value) { @@ -353,7 +353,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xlist-phases", - description = "List backend phases" + description = "List backend phases." ) var listPhases = false set(value) { @@ -363,7 +363,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xdisable-phases", - description = "Disable backend phases" + description = "Disable backend phases." ) var disablePhases: Array? = null set(value) { @@ -373,7 +373,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xverbose-phases", - description = "Be verbose while performing these backend phases" + description = "Be verbose while performing the given backend phases." ) var verbosePhases: Array? = null set(value) { @@ -383,7 +383,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xphases-to-dump-before", - description = "Dump backend state before these phases" + description = "Dump the backend's state before these phases." ) var phasesToDumpBefore: Array? = null set(value) { @@ -393,7 +393,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xphases-to-dump-after", - description = "Dump backend state after these phases" + description = "Dump the backend's state after these phases." ) var phasesToDumpAfter: Array? = null set(value) { @@ -403,7 +403,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xphases-to-dump", - description = "Dump backend state both before and after these phases" + description = "Dump the backend's state both before and after these phases." ) var phasesToDump: Array? = null set(value) { @@ -413,7 +413,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xdump-directory", - description = "Dump backend state into directory" + description = "Dump the backend state into this directory." ) var dumpDirectory: String? = null set(value) { @@ -423,7 +423,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xdump-fqname", - description = "FqName of declaration that should be dumped" + description = "Dump the declaration with the given FqName." ) var dumpOnlyFqName: String? = null set(value) { @@ -433,7 +433,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xphases-to-validate-before", - description = "Validate backend state before these phases" + description = "Validate the backend's state before these phases." ) var phasesToValidateBefore: Array? = null set(value) { @@ -443,7 +443,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xphases-to-validate-after", - description = "Validate backend state after these phases" + description = "Validate the backend's state after these phases." ) var phasesToValidateAfter: Array? = null set(value) { @@ -453,7 +453,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xphases-to-validate", - description = "Validate backend state both before and after these phases" + description = "Validate the backend's state both before and after these phases." ) var phasesToValidate: Array? = null set(value) { @@ -463,7 +463,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xprofile-phases", - description = "Profile backend phases" + description = "Profile backend phases." ) var profilePhases = false set(value) { @@ -473,7 +473,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xcheck-phase-conditions", - description = "Check pre- and postconditions on phases" + description = "Check pre- and postconditions of IR lowering phases." ) var checkPhaseConditions = false set(value) { @@ -483,7 +483,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xcheck-sticky-phase-conditions", - description = "Run sticky condition checks on subsequent phases as well. Implies -Xcheck-phase-conditions" + description = "Run sticky condition checks on subsequent phases. Implicitly enables '-Xcheck-phase-conditions'." ) var checkStickyPhaseConditions = false set(value) { @@ -504,7 +504,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xuse-k2", deprecatedName = "-Xuse-fir", - description = "Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided" + description = "Compile using the experimental K2 compiler pipeline. No compatibility guarantees are provided yet." ) var useK2 = false set(value) { @@ -514,7 +514,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xuse-fir-extended-checkers", - description = "Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready" + description = "Use extended analysis mode based on the frontend IR.\nWarning: This feature is not yet production-ready." ) var useFirExtendedCheckers = false set(value) { @@ -524,7 +524,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xuse-fir-ic", - description = "Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready" + description = "Compile using frontend IR internal incremental compilation.\nWarning: This feature is not yet production-ready." ) var useFirIC = false set(value) { @@ -534,7 +534,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xuse-fir-lt", - description = "Compile using LightTree parser with Front-end IR" + description = "Compile using the LightTree parser with the frontend IR." ) var useFirLT = true set(value) { @@ -554,7 +554,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xdisable-ultra-light-classes", - description = "Do not use the ultra light classes implementation" + description = "Don't use ultra-light classes." ) var disableUltraLightClasses = false set(value) { @@ -564,7 +564,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xuse-mixed-named-arguments", - description = "Enable Support named arguments in their own position even if the result appears as mixed" + description = "Allow mixing named and unnamed arguments when the arguments appear in their default order." ) var useMixedNamedArguments = false set(value) { @@ -574,7 +574,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xmetadata-klib", - description = "Produce a klib that only contains the declarations metadata", + description = "Produce a klib that only contains the metadata of declarations.", deprecatedName = "-Xexpect-actual-linker" ) var metadataKlib: Boolean = false @@ -583,7 +583,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { field = value } - @Argument(value = "-Xdisable-default-scripting-plugin", description = "Do not enable scripting plugin by default") + @Argument(value = "-Xdisable-default-scripting-plugin", description = "Don't enable the scripting plugin by default.") var disableDefaultScriptingPlugin = false set(value) { checkFrozen() @@ -593,8 +593,8 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xexplicit-api", valueDescription = "{strict|warning|disable}", - description = "Force compiler to report errors on all public API declarations without explicit visibility or return type.\n" + - "Use 'warning' level to issue warnings instead of errors." + description = """Force the compiler to report errors on all public API declarations without an explicit visibility or a return type. +Use the 'warning' level to issue warnings instead of errors.""" ) var explicitApi: String = ExplicitApiMode.DISABLED.state set(value) { @@ -604,7 +604,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xinference-compatibility", - description = "Enable compatibility changes for generic type inference algorithm" + description = "Enable compatibility changes for the generic type inference algorithm." ) var inferenceCompatibility = false set(value) { @@ -614,7 +614,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xsuppress-version-warnings", - description = "Suppress warnings about outdated, inconsistent or experimental language or API versions" + description = "Suppress warnings about outdated, inconsistent, or experimental language or API versions." ) var suppressVersionWarnings = false set(value) { @@ -624,8 +624,8 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xextended-compiler-checks", - description = "Enable additional compiler checks that might provide verbose diagnostic information for certain errors.\n" + - "Warning: this mode is not backward-compatible and might cause compilation errors in previously compiled code." + description = """Enable additional compiler checks that might provide verbose diagnostic information for certain errors. +Warning: This mode is not backward compatible and might cause compilation errors in previously compiled code.""" ) var extendedCompilerChecks = false set(value) { @@ -635,7 +635,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xbuiltins-from-sources", - description = "Compile builtIns from sources" + description = "Compile built-ins from sources." ) var builtInsFromSources = false set(value) { @@ -645,8 +645,8 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xexpect-actual-classes", - description = "'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta.\n" + - "Kotlin reports a warning every time you use them. You can use this flag to mute the warning." + description = """'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. +Kotlin reports a warning every time you use one of them. You can use this flag to mute the warning.""" ) var expectActualClasses = false set(value) { @@ -656,7 +656,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xunrestricted-builder-inference", - description = "Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call" + description = "Eliminate builder inference restrictions, for example by allowing type variables to be returned from builder inference calls." ) var unrestrictedBuilderInference = false set(value) { @@ -666,8 +666,8 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xenable-builder-inference", - description = "Use the builder inference by default, for all calls with lambdas which can't be resolved without it.\n" + - "The corresponding calls' declarations may not be marked with @BuilderInference." + description = """Use builder inference by default for all calls with lambdas that can't be resolved without it. +The corresponding calls' declarations may not be marked with @BuilderInference.""" ) var enableBuilderInference = false set(value) { @@ -677,7 +677,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xself-upper-bound-inference", - description = "Support inferring type arguments based on only self upper bounds of the corresponding type parameters" + description = "Support inferring type arguments from the self-type upper bounds of the corresponding type parameters." ) var selfUpperBoundInference = false set(value) { @@ -687,7 +687,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xcontext-receivers", - description = "Enable experimental context receivers" + description = "Enable experimental context receivers." ) var contextReceivers = false set(value) { @@ -697,7 +697,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xklib-relative-path-base", - description = "Provide a base paths to compute source's relative paths in klib (default is empty)" + description = "Provide a base path to compute the source's relative paths in klib (default is empty)." ) var relativePathBases: Array? = null set(value) { @@ -707,7 +707,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xklib-normalize-absolute-path", - description = "Normalize absolute paths in klibs" + description = "Normalize absolute paths in klibs." ) var normalizeAbsolutePath = false set(value) { @@ -717,7 +717,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xklib-enable-signature-clash-checks", - description = "Enable the checks on uniqueness of signatures" + description = "Enable signature uniqueness checks." ) var enableSignatureClashChecks = true set(value) { @@ -725,21 +725,21 @@ abstract class CommonCompilerArguments : CommonToolArguments() { field = value } - @Argument(value = "-Xenable-incremental-compilation", description = "Enable incremental compilation") + @Argument(value = "-Xenable-incremental-compilation", description = "Enable incremental compilation.") var incrementalCompilation: Boolean? = null set(value) { checkFrozen() field = value } - @Argument(value = "-Xrender-internal-diagnostic-names", description = "Render internal names of warnings and errors") + @Argument(value = "-Xrender-internal-diagnostic-names", description = "Render the internal names of warnings and errors.") var renderInternalDiagnosticNames = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xallow-any-scripts-in-source-roots", description = "Allow to compile any scripts along with regular Kotlin sources") + @Argument(value = "-Xallow-any-scripts-in-source-roots", description = "Allow compiling scripts along with regular Kotlin sources.") var allowAnyScriptsInSourceRoots = false set(value) { checkFrozen() @@ -749,14 +749,14 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xfragments", valueDescription = "", - description = "Declares all known fragments of a multiplatform compilation" + description = "Declare all known fragments of a multiplatform compilation." ) var fragments: Array? = null @Argument( value = "-Xfragment-sources", valueDescription = ":", - description = "Adds sources to a specific fragment of a multiplatform compilation", + description = "Add sources to a specific fragment of a multiplatform compilation.", ) var fragmentSources: Array? = null set(value) { @@ -767,7 +767,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xfragment-refines", valueDescription = ":", - description = "Declares that refines with dependsOn/refines relation", + description = "Declare that refines with the dependsOn/refines relation.", ) var fragmentRefines: Array? = null set(value) { @@ -787,7 +787,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-Xdont-warn-on-error-suppression", - description = "Don't report a warning when an error is suppressed. Only affects K2." + description = "Don't report warnings when errors are suppressed. This only affects K2." ) var dontWarnOnErrorSuppression = false set(value) { diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt index 1608ebbbf1b..1b2372836d7 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt @@ -35,21 +35,21 @@ abstract class CommonToolArguments : Freezable(), Serializable { @Transient var errors: ArgumentParseErrors? = null - @Argument(value = "-help", shortName = "-h", description = "Print a synopsis of standard options") + @Argument(value = "-help", shortName = "-h", description = "Print a synopsis of standard options.") var help = false set(value) { checkFrozen() field = value } - @Argument(value = "-X", description = "Print a synopsis of advanced options") + @Argument(value = "-X", description = "Print a synopsis of advanced options.") var extraHelp = false set(value) { checkFrozen() field = value } - @Argument(value = "-version", description = "Display compiler version") + @Argument(value = "-version", description = "Display the compiler version.") var version = false set(value) { checkFrozen() @@ -61,7 +61,7 @@ abstract class CommonToolArguments : Freezable(), Serializable { gradleInputType = GradleInputTypes.INTERNAL, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-verbose", description = "Enable verbose logging output") + @Argument(value = "-verbose", description = "Enable verbose logging output.") var verbose = false set(value) { checkFrozen() @@ -73,7 +73,7 @@ abstract class CommonToolArguments : Freezable(), Serializable { gradleInputType = GradleInputTypes.INTERNAL, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-nowarn", description = "Generate no warnings") + @Argument(value = "-nowarn", description = "Don't generate any warnings.") var suppressWarnings = false set(value) { checkFrozen() @@ -85,7 +85,7 @@ abstract class CommonToolArguments : Freezable(), Serializable { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-Werror", description = "Report an error if there are any warnings") + @Argument(value = "-Werror", description = "Report an error if there are any warnings.") var allWarningsAsErrors = false set(value) { checkFrozen() diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt index 60202748f26..b6f903f9fa0 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt @@ -26,14 +26,14 @@ class K2JSCompilerArguments : CommonCompilerArguments() { level = DeprecationLevel.WARNING, removeAfter = "1.9.0" ) - @Argument(value = "-output", valueDescription = "", description = "Destination *.js file for the compilation result") + @Argument(value = "-output", valueDescription = "", description = "Destination *.js file for the compilation result.") var outputFile: String? = null set(value) { checkFrozen() field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-ir-output-dir", valueDescription = "", description = "Destination for generated files") + @Argument(value = "-ir-output-dir", valueDescription = "", description = "Destination for generated files.") var outputDir: String? = null set(value) { checkFrozen() @@ -45,7 +45,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-ir-output-name", description = "Base name of generated files") + @Argument(value = "-ir-output-name", description = "Base name of generated files.") var moduleName: String? = null set(value) { checkFrozen() @@ -57,7 +57,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-no-stdlib", description = "Don't automatically include the default Kotlin/JS stdlib into compilation dependencies") + @Argument(value = "-no-stdlib", description = "Don't automatically include the default Kotlin/JS stdlib in compilation dependencies.") var noStdlib = false set(value) { checkFrozen() @@ -67,7 +67,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-libraries", valueDescription = "", - description = "Paths to Kotlin libraries with .meta.js and .kjsm files, separated by system path separator" + description = "Paths to Kotlin libraries with .meta.js and .kjsm files, separated by the system path separator." ) var libraries: String? = null set(value) { @@ -80,7 +80,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-source-map", description = "Generate source map") + @Argument(value = "-source-map", description = "Generate a source map.") var sourceMap = false set(value) { checkFrozen() @@ -92,7 +92,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-source-map-prefix", description = "Add the specified prefix to paths in the source map") + @Argument(value = "-source-map-prefix", description = "Add the specified prefix to the paths in the source map.") var sourceMapPrefix: String? = null set(value) { checkFrozen() @@ -103,7 +103,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { value = "-source-map-base-dirs", deprecatedName = "-source-map-source-roots", valueDescription = "", - description = "Base directories for calculating relative paths to source files in source map" + description = "Base directories for calculating relative paths to source files in the source map." ) var sourceMapBaseDirs: String? = null set(value) { @@ -123,7 +123,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-source-map-embed-sources", valueDescription = "{always|never|inlining}", - description = "Embed source files into source map" + description = "Embed source files into the source map." ) var sourceMapEmbedSources: String? = null set(value) { @@ -139,7 +139,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-source-map-names-policy", valueDescription = "{no|simple-names|fully-qualified-names}", - description = "How to map generated names to original names (IR backend only)" + description = "Mode for mapping generated names to original names (IR backend only)." ) var sourceMapNamesPolicy: String? = null set(value) { @@ -152,7 +152,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-meta-info", description = "Generate .meta.js and .kjsm files with metadata. Use to create a library") + @Argument(value = "-meta-info", description = "Generate .meta.js and .kjsm files with metadata. Use this to create a library.") var metaInfo = false set(value) { checkFrozen() @@ -164,7 +164,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-target", valueDescription = "{ v5 }", description = "Generate JS files for specific ECMA version") + @Argument(value = "-target", valueDescription = "{ v5 }", description = "Generate JS files for the specified ECMA version.") var target: String? = null set(value) { checkFrozen() @@ -173,7 +173,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-keep", - description = "Comma-separated list of fully-qualified names to not be eliminated by DCE (if it can be reached), " + + description = "Comma-separated list of fully qualified names not to be eliminated by DCE (if it can be reached), " + "and for which to keep non-minified names." ) var irKeep: String? = null @@ -190,7 +190,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-module-kind", valueDescription = "{plain|amd|commonjs|umd|es}", - description = "Kind of the JS module generated by the compiler" + description = "The kind of JS module generated by the compiler." ) var moduleKind: String? = MODULE_PLAIN set(value) { @@ -206,7 +206,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-main", valueDescription = "{$CALL|$NO_CALL}", - description = "Define whether the `main` function should be called upon execution" + description = "Specify whether the 'main' function should be called upon execution." ) var main: String? = null set(value) { @@ -217,7 +217,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-output-prefix", valueDescription = "", - description = "Add the content of the specified file to the beginning of output file" + description = "Add the content of the specified file to the beginning of the output file." ) var outputPrefix: String? = null set(value) { @@ -228,7 +228,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-output-postfix", valueDescription = "", - description = "Add the content of the specified file to the end of output file" + description = "Add the content of the specified file to the end of the output file." ) var outputPostfix: String? = null set(value) { @@ -240,8 +240,8 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-produce-klib-dir", - description = "Generate unpacked KLIB into parent directory of output JS file.\n" + - "In combination with -meta-info generates both IR and pre-IR versions of library." + description = """Generate an unpacked klib into the parent directory of the output JS file. +In combination with '-meta-info', this generates both IR and pre-IR versions of the library.""" ) var irProduceKlibDir = false set(value) { @@ -251,7 +251,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-produce-klib-file", - description = "Generate packed klib into file specified by -output. Disables pre-IR backend" + description = "Generate a packed klib into the file specified by '-output'. This disables the pre-IR backend." ) var irProduceKlibFile = false set(value) { @@ -259,14 +259,14 @@ class K2JSCompilerArguments : CommonCompilerArguments() { field = value } - @Argument(value = "-Xir-produce-js", description = "Generates JS file using IR backend. Also disables pre-IR backend") + @Argument(value = "-Xir-produce-js", description = "Generate a JS file using the IR backend. This option also disables the pre-IR backend.") var irProduceJs = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xir-dce", description = "Perform experimental dead code elimination") + @Argument(value = "-Xir-dce", description = "Perform experimental dead code elimination.") var irDce = false set(value) { checkFrozen() @@ -276,7 +276,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-dce-runtime-diagnostic", valueDescription = "{$RUNTIME_DIAGNOSTIC_LOG|$RUNTIME_DIAGNOSTIC_EXCEPTION}", - description = "Enable runtime diagnostics when performing DCE instead of removing declarations" + description = "Enable runtime diagnostics instead of removing declarations when performing DCE." ) var irDceRuntimeDiagnostic: String? = null set(value) { @@ -286,7 +286,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-dce-print-reachability-info", - description = "Print declarations' reachability info to stdout during performing DCE" + description = "Print reachability information about declarations to 'stdout' while performing DCE." ) var irDcePrintReachabilityInfo = false set(value) { @@ -297,9 +297,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-dce-dump-reachability-info-to-file", valueDescription = "", - description = "Dump declarations' reachability info collected during performing DCE to a file. " + + description = "Dump reachability information collected about declarations while performing DCE to a file. " + "The format will be chosen automatically based on the file extension. " + - "Supported output formats include JSON for .json, JS const initialized with a plain object containing information for .js, " + + "Supported output formats include JSON for .json, a JS const initialized with a plain object containing information for .js, " + "and plain text for all other file types." ) var irDceDumpReachabilityInfoToFile: String? = null @@ -311,9 +311,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-dump-declaration-ir-sizes-to-file", valueDescription = "", - description = "Dump the IR size of each declaration to a file. " + + description = "Dump the IR size of each declaration into a file. " + "The format will be chosen automatically depending on the file extension. " + - "Supported output formats include JSON for .json, JS const initialized with a plain object containing information for .js, " + + "Supported output formats include JSON for .json, a JS const initialized with a plain object containing information for .js, " + "and plain text for all other file types." ) var irDceDumpDeclarationIrSizesToFile: String? = null @@ -322,21 +322,21 @@ class K2JSCompilerArguments : CommonCompilerArguments() { field = value } - @Argument(value = "-Xir-property-lazy-initialization", description = "Perform lazy initialization for properties") + @Argument(value = "-Xir-property-lazy-initialization", description = "Perform lazy initialization for properties.") var irPropertyLazyInitialization = true set(value) { checkFrozen() field = value } - @Argument(value = "-Xir-minimized-member-names", description = "Perform minimization for names of members") + @Argument(value = "-Xir-minimized-member-names", description = "Minimize the names of members.") var irMinimizedMemberNames = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xir-only", description = "Disables pre-IR backend") + @Argument(value = "-Xir-only", description = "Disable the pre-IR backend.") var irOnly = false set(value) { checkFrozen() @@ -346,7 +346,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-module-name", valueDescription = "", - description = "Specify a compilation module name for IR backend" + description = "Specify the name of the compilation module for the IR backend." ) var irModuleName: String? = null set(value) { @@ -354,7 +354,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xir-base-class-in-metadata", description = "Write base class into metadata") + @Argument(value = "-Xir-base-class-in-metadata", description = "Write base classes into metadata.") var irBaseClassInMetadata = false set(value) { checkFrozen() @@ -363,7 +363,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-safe-external-boolean", - description = "Safe access via Boolean() to Boolean properties in externals to safely cast falsy values." + description = "Wrap access to external 'Boolean' properties with an explicit conversion to 'Boolean'." ) var irSafeExternalBoolean = false set(value) { @@ -374,7 +374,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-safe-external-boolean-diagnostic", valueDescription = "{$RUNTIME_DIAGNOSTIC_LOG|$RUNTIME_DIAGNOSTIC_EXCEPTION}", - description = "Enable runtime diagnostics when access safely to boolean in external declarations" + description = "Enable runtime diagnostics when accessing external 'Boolean' properties." ) var irSafeExternalBooleanDiagnostic: String? = null set(value) { @@ -382,28 +382,28 @@ class K2JSCompilerArguments : CommonCompilerArguments() { field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xir-per-module", description = "Splits generated .js per-module") + @Argument(value = "-Xir-per-module", description = "Generate one .js file per module.") var irPerModule = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xir-per-module-output-name", description = "Adds a custom output name to the splitted js files") + @Argument(value = "-Xir-per-module-output-name", description = "Add a custom output name to the split .js files.") var irPerModuleOutputName: String? = null set(value) { checkFrozen() field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xir-per-file", description = "Splits generated .js per-file") + @Argument(value = "-Xir-per-file", description = "Generate one .js file per source file.") var irPerFile = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xir-new-ir2js", description = "New fragment-based ir2js") + @Argument(value = "-Xir-new-ir2js", description = "New fragment-based 'ir2js'.") var irNewIr2Js = true set(value) { checkFrozen() @@ -412,7 +412,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-generate-inline-anonymous-functions", - description = "Lambda expressions that capture values are translated into in-line anonymous JavaScript functions" + description = "Lambda expressions that capture values are translated into in-line anonymous JavaScript functions." ) var irGenerateInlineAnonymousFunctions = false set(value) { @@ -423,7 +423,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xinclude", valueDescription = "", - description = "A path to an intermediate library that should be processed in the same manner as source files." + description = "Path to an intermediate library that should be processed in the same manner as source files." ) var includes: String? = null set(value) { @@ -434,7 +434,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xcache-directory", valueDescription = "", - description = "A path to cache directory" + description = "Path to the cache directory." ) var cacheDirectory: String? = null set(value) { @@ -442,7 +442,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xir-build-cache", description = "Use compiler to build cache") + @Argument(value = "-Xir-build-cache", description = "Use the compiler to build the cache.") var irBuildCache = false set(value) { checkFrozen() @@ -451,7 +451,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xgenerate-dts", - description = "Generate TypeScript declarations .d.ts file alongside JS file. Available in IR backend only." + description = "Generate a TypeScript declaration .d.ts file alongside the JS file. This is available only in the IR backend." ) var generateDts = false set(value) { @@ -471,7 +471,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xstrict-implicit-export-types", - description = "Generate strict types for implicitly exported entities inside d.ts files. Available in IR backend only." + description = "Generate strict types for implicitly exported entities inside d.ts files. This is available in the IR backend only." ) var strictImplicitExportType = false set(value) { @@ -486,7 +486,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { ) @Argument( value = "-Xes-classes", - description = "Generated JavaScript will use ES2015 classes." + description = "Let generated JavaScript code use ES2015 classes." ) var useEsClasses = false set(value) { @@ -499,7 +499,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-Xtyped-arrays", description = "Translate primitive arrays to JS typed arrays") + @Argument(value = "-Xtyped-arrays", description = "Translate primitive arrays into JS typed arrays.") var typedArrays = true set(value) { checkFrozen() @@ -511,7 +511,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-Xfriend-modules-disabled", description = "Disable internal declaration export") + @Argument(value = "-Xfriend-modules-disabled", description = "Disable internal declaration export.") var friendModulesDisabled = false set(value) { checkFrozen() @@ -521,7 +521,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xfriend-modules", valueDescription = "", - description = "Paths to friend modules" + description = "Paths to friend modules." ) var friendModules: String? = null set(value) { @@ -531,7 +531,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xenable-extension-functions-in-externals", - description = "Enable extensions functions members in external interfaces" + description = "Enable extension function members in external interfaces." ) var extensionFunctionsInExternals = false set(value) { @@ -539,91 +539,91 @@ class K2JSCompilerArguments : CommonCompilerArguments() { field = value } - @Argument(value = "-Xmetadata-only", description = "Generate *.meta.js and *.kjsm files only") + @Argument(value = "-Xmetadata-only", description = "Generate .meta.js and .kjsm files only.") var metadataOnly = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xenable-js-scripting", description = "Enable experimental support of .kts files using K/JS (with -Xir only)") + @Argument(value = "-Xenable-js-scripting", description = "Enable experimental support for .kts files using K/JS (with '-Xir' only).") var enableJsScripting = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xfake-override-validator", description = "Enable IR fake override validator") + @Argument(value = "-Xfake-override-validator", description = "Enable the IR fake override validator.") var fakeOverrideValidator = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xerror-tolerance-policy", description = "Set up error tolerance policy (NONE, SEMANTIC, SYNTAX, ALL)") + @Argument(value = "-Xerror-tolerance-policy", description = "Set up an error tolerance policy (NONE, SEMANTIC, SYNTAX, ALL).") var errorTolerancePolicy: String? = null set(value) { checkFrozen() field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xpartial-linkage", valueDescription = "{enable|disable}", description = "Use partial linkage mode") + @Argument(value = "-Xpartial-linkage", valueDescription = "{enable|disable}", description = "Use partial linkage mode.") var partialLinkageMode: String? = null set(value) { checkFrozen() field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xpartial-linkage-loglevel", valueDescription = "{info|warning|error}", description = "Partial linkage compile-time log level") + @Argument(value = "-Xpartial-linkage-loglevel", valueDescription = "{info|warning|error}", description = "Define the compile-time log level for partial linkage.") var partialLinkageLogLevel: String? = null set(value) { checkFrozen() field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xwasm", description = "Use experimental WebAssembly compiler backend") + @Argument(value = "-Xwasm", description = "Use the experimental WebAssembly compiler backend.") var wasm = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xwasm-debug-info", description = "Add debug info to WebAssembly compiled module") + @Argument(value = "-Xwasm-debug-info", description = "Add debug info to the compiled WebAssembly module.") var wasmDebug = true set(value) { checkFrozen() field = value } - @Argument(value = "-Xwasm-kclass-fqn", description = "Enable support for FQ names in KClass") + @Argument(value = "-Xwasm-kclass-fqn", description = "Enable support for 'KClass.qualifiedName'.") var wasmKClassFqn = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xwasm-enable-array-range-checks", description = "Turn on range checks for the array access functions") + @Argument(value = "-Xwasm-enable-array-range-checks", description = "Turn on range checks for array access functions.") var wasmEnableArrayRangeChecks = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xwasm-enable-asserts", description = "Turn on asserts") + @Argument(value = "-Xwasm-enable-asserts", description = "Turn on asserts.") var wasmEnableAsserts = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xwasm-generate-wat", description = "Generate wat file") + @Argument(value = "-Xwasm-generate-wat", description = "Generate a .wat file.") var wasmGenerateWat = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xwasm-target", description = "Set up Wasm target (wasm-js or wasm-wasi)") + @Argument(value = "-Xwasm-target", description = "Set up the Wasm target (wasm-js or wasm-wasi).") var wasmTarget: String? = null set(value) { checkFrozen() @@ -632,7 +632,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xwasm-use-traps-instead-of-exceptions", - description = "Trap instead of throwing exceptions" + description = "Use traps instead of throwing exceptions." ) var wasmUseTrapsInsteadOfExceptions = false set(value) { @@ -642,7 +642,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xforce-deprecated-legacy-compiler-usage", - description = "The flag is used only for our inner infrastructure. It will be removed soon, so it's unsafe to use it nowadays." + description = "This flag is used only for our inner infrastructure. It will soon be removed, so it's no longer safe to use." ) var forceDeprecatedLegacyCompilerUsage = false set(value) { @@ -652,7 +652,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xoptimize-generated-js", - description = "Perform additional optimizations on the generated JS code" + description = "Perform additional optimizations on the generated JS code." ) var optimizeGeneratedJs = true set(value) { diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSDceArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSDceArguments.kt index 3d415a1ec35..e5bb2aa299f 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSDceArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSDceArguments.kt @@ -26,7 +26,7 @@ class K2JSDceArguments : CommonToolArguments() { @Argument( value = "-output-dir", valueDescription = "", - description = "Output directory" + description = "Output directory." ) var outputDirectory: String? = null set(value) { @@ -37,7 +37,7 @@ class K2JSDceArguments : CommonToolArguments() { @Argument( value = "-keep", valueDescription = "", - description = "List of fully-qualified names of declarations that shouldn't be eliminated" + description = "List of fully-qualified names of declarations that shouldn't be eliminated." ) var declarationsToKeep: Array? = null set(value) { @@ -47,7 +47,7 @@ class K2JSDceArguments : CommonToolArguments() { @Argument( value = "-Xprint-reachability-info", - description = "Print declarations marked as reachable" + description = "Print declarations marked as reachable." ) var printReachabilityInfo = false set(value) { @@ -62,7 +62,7 @@ class K2JSDceArguments : CommonToolArguments() { ) @Argument( value = "-dev-mode", - description = "Development mode: don't strip out any code, just copy dependencies" + description = "Development mode: don't strip out any code, just copy dependencies." ) var devMode = false set(value) { @@ -73,7 +73,7 @@ class K2JSDceArguments : CommonToolArguments() { @Argument( value = "-Xdev-mode-overwriting-strategy", valueDescription = "{$OLDER|$ALL}", - description = "Overwriting strategy during copy dependencies in development mode" + description = "Overwriting strategy when copying dependencies in development mode." ) var devModeOverwritingStrategy: String? = null set(value) { diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index 7520bace294..146457dcae7 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -15,7 +15,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { private val serialVersionUID = 0L } - @Argument(value = "-d", valueDescription = "", description = "Destination for generated class files") + @Argument(value = "-d", valueDescription = "", description = "Destination for generated class files.") var destination: String? = null set(value) { checkFrozen() @@ -26,7 +26,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { value = "-classpath", shortName = "-cp", valueDescription = "", - description = "List of directories and JAR/ZIP archives to search for user class files" + description = "List of directories and JAR/ZIP archives to search for user class files." ) var classpath: String? = null set(value) { @@ -34,7 +34,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-include-runtime", description = "Include Kotlin runtime into the resulting JAR") + @Argument(value = "-include-runtime", description = "Include the Kotlin runtime in the resulting JAR.") var includeRuntime = false set(value) { checkFrozen() @@ -44,7 +44,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-jdk-home", valueDescription = "", - description = "Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME" + description = "Include a custom JDK from the specified location in the classpath instead of the default 'JAVA_HOME'." ) var jdkHome: String? = null set(value) { @@ -57,7 +57,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-no-jdk", description = "Don't automatically include the Java runtime into the classpath") + @Argument(value = "-no-jdk", description = "Don't automatically include the Java runtime in the classpath.") var noJdk = false set(value) { checkFrozen() @@ -66,7 +66,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-no-stdlib", - description = "Don't automatically include the Kotlin/JVM stdlib and Kotlin reflection into the classpath" + description = "Don't automatically include the Kotlin/JVM stdlib and Kotlin reflection dependencies in the classpath." ) var noStdlib = false set(value) { @@ -74,7 +74,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { field = value } - @Argument(value = "-no-reflect", description = "Don't automatically include Kotlin reflection into the classpath") + @Argument(value = "-no-reflect", description = "Don't automatically include the Kotlin reflection dependency in the classpath.") var noReflect = false set(value) { checkFrozen() @@ -84,7 +84,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-expression", shortName = "-e", - description = "Evaluate the given string as a Kotlin script" + description = "Evaluate the given string as a Kotlin script." ) var expression: String? = null set(value) { @@ -95,7 +95,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-script-templates", valueDescription = "", - description = "Script definition template classes" + description = "Script definition template classes." ) var scriptTemplates: Array? = null set(value) { @@ -108,7 +108,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-module-name", valueDescription = "", description = "Name of the generated .kotlin_module file") + @Argument(value = "-module-name", valueDescription = "", description = "Name of the generated '.kotlin_module' file.") var moduleName: String? = null set(value) { checkFrozen() @@ -123,7 +123,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-jvm-target", valueDescription = "", - description = "Target version of the generated JVM bytecode (${JvmTarget.SUPPORTED_VERSIONS_DESCRIPTION}), default is 1.8", + description = "The target version of the generated JVM bytecode (${JvmTarget.SUPPORTED_VERSIONS_DESCRIPTION}), with 1.8 as the default.", ) var jvmTarget: String? = null set(value) { @@ -136,7 +136,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { gradleInputType = GradleInputTypes.INPUT, shouldGenerateDeprecatedKotlinOptions = true, ) - @Argument(value = "-java-parameters", description = "Generate metadata for Java 1.8 reflection on method parameters") + @Argument(value = "-java-parameters", description = "Generate metadata for Java 1.8 reflection on method parameters.") var javaParameters = false set(value) { checkFrozen() @@ -145,7 +145,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { // Advanced options - @Argument(value = "-Xuse-old-backend", description = "Use the old JVM backend") + @Argument(value = "-Xuse-old-backend", description = "Use the old JVM backend.") var useOldBackend = false set(value) { checkFrozen() @@ -154,7 +154,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xallow-unstable-dependencies", - description = "Do not report errors on classes in dependencies, which were compiled by an unstable version of the Kotlin compiler" + description = "Do not report errors on classes in dependencies that were compiled by an unstable version of the Kotlin compiler." ) var allowUnstableDependencies = false set(value) { @@ -165,10 +165,10 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xabi-stability", valueDescription = "{stable|unstable}", - description = "When using unstable compiler features such as FIR, use 'stable' to mark generated class files as stable\n" + - "to prevent diagnostics from stable compilers at the call site.\n" + - "When using the JVM IR backend, conversely, use 'unstable' to mark generated class files as unstable\n" + - "to force diagnostics to be reported." + description = """When using unstable compiler features such as FIR, use 'stable' to mark generated class files as stable +to prevent diagnostics from being reported when using stable compilers at the call site. +When using the JVM IR backend, conversely, use 'unstable' to mark generated class files as unstable +to force diagnostics to be reported.""" ) var abiStability: String? = null set(value) { @@ -178,7 +178,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xir-do-not-clear-binding-context", - description = "When using the IR backend, do not clear BindingContext between psi2ir and lowerings" + description = "When using the IR backend, do not clear BindingContext between 'psi2ir' and lowerings." ) var doNotClearBindingContext = false set(value) { @@ -189,9 +189,9 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xbackend-threads", valueDescription = "", - description = "When using the IR backend, run lowerings by file in N parallel threads.\n" + - "0 means use a thread per processor core.\n" + - "Default value is 1" + description = """When using the IR backend, run lowerings by file in N parallel threads. +0 means use one thread per processor core. +The default value is 1.""" ) var backendThreads: String = "1" set(value) { @@ -199,7 +199,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { field = value } - @Argument(value = "-Xmodule-path", valueDescription = "", description = "Paths where to find Java 9+ modules") + @Argument(value = "-Xmodule-path", valueDescription = "", description = "Paths to Java 9+ modules.") var javaModulePath: String? = null set(value) { checkFrozen() @@ -209,8 +209,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xadd-modules", valueDescription = "", - description = "Root modules to resolve in addition to the initial modules,\n" + - "or all modules on the module path if is ALL-MODULE-PATH" + description = """Root modules to resolve in addition to the initial modules, or all modules on the module path if is ALL-MODULE-PATH.""" ) var additionalJavaModules: Array? = null set(value) { @@ -218,7 +217,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { field = value } - @Argument(value = "-Xno-call-assertions", description = "Don't generate not-null assertions for arguments of platform types") + @Argument(value = "-Xno-call-assertions", description = "Don't generate not-null assertions for arguments of platform types.") var noCallAssertions = false set(value) { checkFrozen() @@ -227,7 +226,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xno-receiver-assertions", - description = "Don't generate not-null assertion for extension receiver arguments of platform types" + description = "Don't generate not-null assertions for extension receiver arguments of platform types." ) var noReceiverAssertions = false set(value) { @@ -237,7 +236,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xno-param-assertions", - description = "Don't generate not-null assertions on parameters of methods accessible from Java" + description = "Don't generate not-null assertions on parameters of methods accessible from Java." ) var noParamAssertions = false set(value) { @@ -245,7 +244,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { field = value } - @Argument(value = "-Xno-optimize", description = "Disable optimizations") + @Argument(value = "-Xno-optimize", description = "Disable optimizations.") var noOptimize = false set(value) { checkFrozen() @@ -254,12 +253,12 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xassertions", valueDescription = "{always-enable|always-disable|jvm|legacy}", - description = "Assert calls behaviour\n" + - "-Xassertions=always-enable: enable, ignore jvm assertion settings;\n" + - "-Xassertions=always-disable: disable, ignore jvm assertion settings;\n" + - "-Xassertions=jvm: enable, depend on jvm assertion settings;\n" + - "-Xassertions=legacy: calculate condition on each call, check depends on jvm assertion settings in the kotlin package;\n" + - "default: legacy" + description = """'kotlin.assert' call behavior: +-Xassertions=always-enable: enable, ignore JVM assertion settings; +-Xassertions=always-disable: disable, ignore JVM assertion settings; +-Xassertions=jvm: enable, depend on JVM assertion settings; +-Xassertions=legacy: calculate the condition on each call, the behavior depends on JVM assertion settings in the kotlin package; +default: legacy""" ) var assertionsMode: String? = JVMAssertionsMode.DEFAULT.description set(value) { @@ -271,7 +270,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { value = "-Xbuild-file", deprecatedName = "-module", valueDescription = "", - description = "Path to the .xml build file to compile" + description = "Path to the .xml build file to compile." ) var buildFile: String? = null set(value) { @@ -279,14 +278,14 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { field = if (value.isNullOrEmpty()) null else value } - @Argument(value = "-Xmultifile-parts-inherit", description = "Compile multifile classes as a hierarchy of parts and facade") + @Argument(value = "-Xmultifile-parts-inherit", description = "Compile multifile classes as a hierarchy of parts and a facade.") var inheritMultifileParts = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xuse-type-table", description = "Use type table in metadata serialization") + @Argument(value = "-Xuse-type-table", description = "Use a type table in metadata serialization.") var useTypeTable = false set(value) { checkFrozen() @@ -295,8 +294,8 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xuse-old-class-files-reading", - description = "Use old class files reading implementation. This may slow down the build and cause problems with Groovy interop.\n" + - "Should be used in case of problems with the new implementation" + description = """Use the old implementation for reading class files. This may slow down the compilation and cause problems with Groovy interop. +This can be used in the event of problems with the new implementation.""" ) var useOldClassFilesReading = false set(value) { @@ -306,7 +305,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xuse-fast-jar-file-system", - description = "Use fast implementation on Jar FS. This may speed up compilation time, but currently it's an experimental mode" + description = "Use the fast implementation of Jar FS. This may speed up compilation time, but it is experimental." ) var useFastJarFileSystem = false set(value) { @@ -317,7 +316,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xdump-declarations-to", valueDescription = "", - description = "Path to JSON file to dump Java to Kotlin declaration mappings" + description = "Path to the JSON file where Java-to-Kotlin declaration mappings should be dumped." ) var declarationsOutputPath: String? = null set(value) { @@ -327,7 +326,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xsuppress-missing-builtins-error", - description = "Suppress the \"cannot access built-in declaration\" error (useful with -no-stdlib)" + description = """Suppress the "cannot access built-in declaration" error (useful with '-no-stdlib').""" ) var suppressMissingBuiltinsError = false set(value) { @@ -338,7 +337,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xscript-resolver-environment", valueDescription = "", - description = "Script resolver environment in key-value pairs (the value could be quoted and escaped)" + description = "Set the script resolver environment in key-value pairs (the value can be quoted and escaped)." ) var scriptResolverEnvironment: Array? = null set(value) { @@ -347,14 +346,14 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { } // Javac options - @Argument(value = "-Xuse-javac", description = "Use javac for Java source and class files analysis") + @Argument(value = "-Xuse-javac", description = "Use javac for Java source and class file analysis.") var useJavac = false set(value) { checkFrozen() field = value } - @Argument(value = "-Xcompile-java", description = "Reuse javac analysis and compile Java source files") + @Argument(value = "-Xcompile-java", description = "Reuse 'javac' analysis and compile Java source files.") var compileJava = false set(value) { checkFrozen() @@ -364,7 +363,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xjavac-arguments", valueDescription = "", - description = "Java compiler arguments" + description = "Java compiler arguments." ) var javacArguments: Array? = null set(value) { @@ -376,7 +375,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xjava-source-roots", valueDescription = "", - description = "Paths to directories with Java source files" + description = "Paths to directories with Java source files." ) var javaSourceRoots: Array? = null set(value) { @@ -386,7 +385,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xjava-package-prefix", - description = "Package prefix for Java files" + description = "Package prefix for Java files." ) var javaPackagePrefix: String? = null set(value) { @@ -400,14 +399,14 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { valueDescription = "{ignore/strict/warn}" + "|under-migration:{ignore/strict/warn}" + "|@:{ignore/strict/warn}", - description = "Specify behavior for JSR-305 nullability annotations:\n" + - "-Xjsr305={ignore/strict/warn} globally (all non-@UnderMigration annotations)\n" + - "-Xjsr305=under-migration:{ignore/strict/warn} all @UnderMigration annotations\n" + - "-Xjsr305=@:{ignore/strict/warn} annotation with the given fully qualified class name\n" + - "Modes:\n" + - " * ignore\n" + - " * strict (experimental; treat as other supported nullability annotations)\n" + - " * warn (report a warning)" + description = """Specify the behavior of 'JSR-305' nullability annotations: +-Xjsr305={ignore/strict/warn} global (all non-@UnderMigration annotations) +-Xjsr305=under-migration:{ignore/strict/warn} all @UnderMigration annotations +-Xjsr305=@:{ignore/strict/warn} annotation with the given fully qualified class name +Modes: +* ignore +* strict (experimental; treat like other supported nullability annotations) +* warn (report a warning)""" ) var jsr305: Array? = null set(value) { @@ -418,11 +417,11 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xnullability-annotations", valueDescription = "@:{ignore/strict/warn}", - description = "Specify behavior for specific Java nullability annotations (provided with fully qualified package name)\n" + - "Modes:\n" + - " * ignore\n" + - " * strict\n" + - " * warn (report a warning)" + description = """Specify the behavior for specific Java nullability annotations (provided with fully qualified package name). +Modes: +* ignore +* strict +* warn (report a warning)""" ) var nullabilityAnnotations: Array? = null set(value) { @@ -433,8 +432,8 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xsupport-compatqual-checker-framework-annotations", valueDescription = "enable|disable", - description = "Specify behavior for Checker Framework compatqual annotations (NullableDecl/NonNullDecl).\n" + - "Default value is 'enable'" + description = """Specify the behavior for Checker Framework 'compatqual' annotations ('NullableDecl'/'NonNullDecl'). +The default value is 'enable'.""" ) var supportCompatqualCheckerFrameworkAnnotations: String? = null set(value) { @@ -445,8 +444,8 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xjspecify-annotations", valueDescription = "ignore|strict|warn", - description = "Specify behavior for jspecify annotations.\n" + - "Default value is 'warn'" + description = """Specify the behavior of 'jspecify' annotations. +The default value is 'warn'.""" ) var jspecifyAnnotations: String? = null set(value) { @@ -457,25 +456,25 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xjvm-default", valueDescription = "{all|all-compatibility|disable}", - description = """Emit JVM default methods for interface declarations with bodies. Default is 'disable'. + description = """Emit JVM default methods for interface declarations with bodies. The default is 'disable'. -Xjvm-default=all Generate JVM default methods for all interface declarations with bodies in the module. - Do not generate DefaultImpls stubs for interface declarations with bodies, which are generated by default - in the 'disable' mode. If interface inherits a method with body from an interface compiled in the 'disable' - mode and doesn't override it, then a DefaultImpls stub will be generated for it. - BREAKS BINARY COMPATIBILITY if some client code relies on the presence of DefaultImpls classes. + Do not generate 'DefaultImpls' stubs for interface declarations with bodies. If an interface inherits a method with a + body from an interface compiled in 'disable' mode and doesn't override it, then a 'DefaultImpls' stub will be + generated for it. + This BREAKS BINARY COMPATIBILITY if some client code relies on the presence of 'DefaultImpls' classes. Note that if interface delegation is used, all interface methods are delegated. --Xjvm-default=all-compatibility In addition to the 'all' mode, generate compatibility stubs in the DefaultImpls classes. - Compatibility stubs could be useful for library and runtime authors to keep backward binary compatibility +-Xjvm-default=all-compatibility Like 'all', but additionally generate compatibility stubs in the 'DefaultImpls' classes. + Compatibility stubs can help library and runtime authors maintain backward binary compatibility for existing clients compiled against previous library versions. - 'all' and 'all-compatibility' modes are changing the library ABI surface that will be used by clients after - the recompilation of the library. In that sense, clients might be incompatible with previous library - versions. This usually means that proper library versioning is required, e.g. major version increase in SemVer. - In case of inheritance from a Kotlin interface compiled in 'all' or 'all-compatibility' modes, DefaultImpls + 'all' and 'all-compatibility' modes change the library ABI surface that will be used by clients after + the recompilation of the library. Because of this, clients might be incompatible with previous library + versions. This usually means that proper library versioning is required, for example with major version increases in SemVer. + In subtypes of Kotlin interfaces compiled in 'all' or 'all-compatibility' mode, 'DefaultImpls' compatibility stubs will invoke the default method of the interface with standard JVM runtime resolution semantics. - Perform additional compatibility checks for classes inheriting generic interfaces where in some cases - additional implicit method with specialized signatures was generated in the 'disable' mode: - unlike in the 'disable' mode, the compiler will report an error if such method is not overridden explicitly - and the class is not annotated with @JvmDefaultWithoutCompatibility (see KT-39603 for more details). + Perform additional compatibility checks for classes inheriting generic interfaces where in some cases an + additional implicit method with specialized signatures was generated in 'disable' mode. + Unlike in 'disable' mode, the compiler will report an error if such a method is not overridden explicitly + and the class is not annotated with '@JvmDefaultWithoutCompatibility' (see KT-39603 for more details). -Xjvm-default=disable Default behavior. Do not generate JVM default methods.""" ) var jvmDefault: String = JvmDefaultMode.DEFAULT.description @@ -487,7 +486,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xdefault-script-extension", valueDescription = "