From db5913bbb615f2a6b7433a258e4cbc79bc5fe14f Mon Sep 17 00:00:00 2001 From: Ilya Muradyan Date: Fri, 9 Dec 2022 00:37:44 +0100 Subject: [PATCH] KTIJ-8463: add possibility to pass additional analyzer flags --- .../cli/common/arguments/CommonCompilerArguments.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 b551ce52bd7..b98dcd5d9de 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 @@ -598,6 +598,13 @@ abstract class CommonCompilerArguments : CommonToolArguments() { } fun toLanguageVersionSettings(collector: MessageCollector): LanguageVersionSettings { + return toLanguageVersionSettings(collector, emptyMap()) + } + + fun toLanguageVersionSettings( + collector: MessageCollector, + additionalAnalysisFlags: Map, Any> + ): LanguageVersionSettings { // If only "-api-version" is specified, language version is assumed to be the latest stable val languageVersion = parseVersion(collector, languageVersion, "language") ?: defaultLanguageVersion(collector) @@ -611,7 +618,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { val languageVersionSettings = LanguageVersionSettingsImpl( languageVersion, apiVersion, - configureAnalysisFlags(collector, languageVersion), + configureAnalysisFlags(collector, languageVersion) + additionalAnalysisFlags, configureLanguageFeatures(collector) )