Refactor compiler arguments to configuration conversion:

extract into independent functions, rearrange logic
This commit is contained in:
Ilya Chernikov
2019-01-08 18:00:45 +01:00
parent 298aaf999e
commit 04b04ea0ee
11 changed files with 431 additions and 333 deletions
@@ -97,7 +97,7 @@ private fun getLanguageSettingsForScripts(project: Project, scriptDefinition: Ko
val compilerArguments = K2JVMCompilerArguments()
parseCommandLineArguments(args.toList(), compilerArguments)
// TODO: reporting
val verSettings = compilerArguments.configureLanguageVersionSettings(MessageCollector.NONE)
val verSettings = compilerArguments.toLanguageVersionSettings(MessageCollector.NONE)
val jvmTarget = compilerArguments.jvmTarget?.let { JvmTarget.fromString(it) } ?: TargetPlatformVersion.NoVersion
ScriptLanguageSettings(verSettings, jvmTarget)
}.also { scriptDefinition.putUserData(SCRIPT_LANGUAGE_SETTINGS, it) }