From a08411f92564207b5b987311dd7275380ac9b734 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Fri, 31 Oct 2014 17:24:08 +0300 Subject: [PATCH] Process normally when no plugins were found --- .../cli/src/org/jetbrains/jet/cli/jvm/PluginCliParser.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/PluginCliParser.kt b/compiler/cli/src/org/jetbrains/jet/cli/jvm/PluginCliParser.kt index 55e34640f59..c7288b45276 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/PluginCliParser.kt +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/PluginCliParser.kt @@ -33,9 +33,9 @@ public object PluginCliParser { public val PLUGIN_ARGUMENT_PREFIX: String = "plugin:" private fun getCommandLineProcessors(arguments: CommonCompilerArguments): Collection { - return arguments.pluginClasspaths!!.map { + return arguments.pluginClasspaths?.map { loadCommandLineProcessor(JarFile(it).getManifest()?.getAttributes("org.jetbrains.kotlin.compiler.plugin")) - }.filterNotNull() + }?.filterNotNull() ?: listOf() } private fun loadCommandLineProcessor(attributes: Attributes?): CommandLineProcessor? { @@ -55,10 +55,10 @@ public object PluginCliParser { [platformStatic] fun processPluginOptions(arguments: CommonCompilerArguments, configuration: CompilerConfiguration) { - val optionValuesByPlugin = arguments.pluginOptions!!.map { parsePluginOption(it) }.groupBy { + val optionValuesByPlugin = arguments.pluginOptions?.map { parsePluginOption(it) }?.groupBy { if (it == null) throw CliOptionProcessingException("Wrong plugin option format: $it, should be ${CommonCompilerArguments.PLUGIN_OPTION_FORMAT}") it.optionName - } + } ?: mapOf() val processors = getCommandLineProcessors(arguments) for (processor in processors) {