Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the correct (program) order of properties after serializing/deserializing descriptors to kotlin metadata, which is needed for correct and stable json serialization of class hierarchies in incremental/multi-module scenario. It uses protobuf extensions.
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
+5
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.metadata
|
||||
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
|
||||
+5
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -98,9 +98,11 @@ abstract class KlibMetadataSerializer(
|
||||
val index = classSerializer.stringTable.getFqNameIndex(classDescriptor)
|
||||
//builder.addExtension(KlibMetadataProtoBuf.className, index)
|
||||
|
||||
val classes = serializeClasses(packageName/*, builder*/,
|
||||
val classes = serializeClasses(
|
||||
packageName/*, builder*/,
|
||||
classDescriptor.unsubstitutedInnerClassesScope
|
||||
.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS))
|
||||
.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS)
|
||||
)
|
||||
|
||||
classSerializer = previousSerializer
|
||||
return classes + Pair(classProto, index)
|
||||
|
||||
Reference in New Issue
Block a user