Exclude nested classes of private classes from ABI classes

This commit is contained in:
Alexey Tsvetkov
2018-12-03 20:33:25 +03:00
parent 64380f55d2
commit d54ce2da6f
14 changed files with 323 additions and 9 deletions
@@ -119,6 +119,10 @@ class DescriptorSerializer private constructor(
typeAliasProto(descriptor)?.let { builder.addTypeAlias(it) }
}
else {
if (descriptor is ClassDescriptor && !extension.shouldSerializeNestedClass(descriptor)) {
continue
}
val name = getSimpleNameIndex(descriptor.name)
if (isEnumEntry(descriptor)) {
builder.addEnumEntry(enumEntryProto(descriptor as ClassDescriptor))
@@ -25,6 +25,7 @@ abstract class SerializerExtension {
open fun shouldSerializeFunction(descriptor: FunctionDescriptor): Boolean = true
open fun shouldSerializeProperty(descriptor: PropertyDescriptor): Boolean = true
open fun shouldSerializeTypeAlias(descriptor: TypeAliasDescriptor): Boolean = true
open fun shouldSerializeNestedClass(descriptor: ClassDescriptor): Boolean = true
interface ClassMembersProducer {
fun getCallableMembers(classDescriptor: ClassDescriptor): Collection<CallableMemberDescriptor>