Kotlin Facet: Get rid of duplicating data in facet configuration

This commit is contained in:
Alexey Sedunov
2017-03-04 14:35:20 +03:00
parent 19ea18a340
commit 641a9a7153
36 changed files with 857 additions and 408 deletions
@@ -28,10 +28,10 @@ internal fun modifyCompilerArgumentsForPlugin(
pluginName: String,
annotationOptionName: String
) {
val compileInfo = facet.configuration.settings.compilerInfo
val facetSettings = facet.configuration.settings
// investigate why copyBean() sometimes throws exceptions
val commonArguments = compileInfo.commonCompilerArguments ?: CommonCompilerArguments.DummyImpl()
val commonArguments = facetSettings.compilerArguments ?: CommonCompilerArguments.DummyImpl()
/** See [CommonCompilerArguments.PLUGIN_OPTION_FORMAT] **/
val annotationOptions = setup?.annotationFqNames?.map { "plugin:$compilerPluginId:$annotationOptionName=$it" } ?: emptyList()
@@ -48,5 +48,5 @@ internal fun modifyCompilerArgumentsForPlugin(
commonArguments.pluginOptions = newPluginOptions.toTypedArray()
commonArguments.pluginClasspaths = newPluginClasspaths.toTypedArray()
compileInfo.commonCompilerArguments = commonArguments
facetSettings.compilerArguments = commonArguments
}