Do not retain proxy-based components for compiler plugin settings in project model

This commit is contained in:
Yan Zhulanow
2018-05-16 00:14:19 +03:00
parent 29ef8650f7
commit 20cb4e91b3
4 changed files with 17 additions and 3 deletions
@@ -21,7 +21,11 @@ import org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginModel
import org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginModelBuilderService
import org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginProjectResolverExtension
interface AllOpenModel : AnnotationBasedPluginModel
interface AllOpenModel : AnnotationBasedPluginModel {
override fun copy(): AllOpenModel {
return AllOpenModelImpl(annotations.toList(), presets.toList())
}
}
class AllOpenModelImpl(
override val annotations: List<String>,
@@ -33,6 +33,8 @@ interface AnnotationBasedPluginModel : Serializable {
val annotations: List<String>
val presets: List<String>
fun copy(): AnnotationBasedPluginModel
val isEnabled get() = annotations.isNotEmpty() || presets.isNotEmpty()
}
@@ -56,7 +58,7 @@ abstract class AnnotationBasedPluginProjectResolverExtension<T : AnnotationBased
val model = resolverCtx.getExtraProject(gradleModule, modelClass)
if (model != null) {
ideModule.putCopyableUserData(userDataKey, model)
ideModule.putCopyableUserData(userDataKey, model.copy() as T)
}
super.populateModuleExtraModels(gradleModule, ideModule)
@@ -23,6 +23,10 @@ import org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginProjectRe
interface NoArgModel : AnnotationBasedPluginModel {
val invokeInitializers: Boolean
override fun copy(): NoArgModel {
return NoArgModelImpl(annotations.toList(), presets.toList(), invokeInitializers)
}
}
class NoArgModelImpl(
@@ -21,7 +21,11 @@ import org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginModel
import org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginModelBuilderService
import org.jetbrains.kotlin.annotation.plugin.ide.AnnotationBasedPluginProjectResolverExtension
interface SamWithReceiverModel : AnnotationBasedPluginModel
interface SamWithReceiverModel : AnnotationBasedPluginModel {
override fun copy(): SamWithReceiverModel {
return SamWithReceiverModelImpl(annotations.toList(), presets.toList())
}
}
class SamWithReceiverModelImpl(
override val annotations: List<String>,