Rework DescriptorSerializerPlugin to be a part of Project's extensions

instead of statically registering it.

Static registering can cause subtle errors when plugin implementation
(e.g. SerializationDescriptorPluginForKotlinxSerialization) is registered
from multiple classloaders: in multi-module with daemon compilation scenario

 #KT-41857 Fixed
This commit is contained in:
Leonid Startsev
2020-10-15 17:01:37 +03:00
parent ef907e0c46
commit 4ec90b18bc
23 changed files with 115 additions and 67 deletions
@@ -125,7 +125,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
descriptor, extension,
parentCodegen instanceof ImplementationBodyCodegen
? ((ImplementationBodyCodegen) parentCodegen).serializer
: DescriptorSerializer.createTopLevel(extension)
: DescriptorSerializer.createTopLevel(extension),
state.getProject()
);
this.constructorCodegen = new ConstructorCodegen(