Don't skip empty packges of the current module when serializing.
This commit is contained in:
committed by
alexander-gorshenev
parent
57b1800354
commit
ff86c16fc9
+7
-7
@@ -205,19 +205,19 @@ internal class KonanSerializationUtil(val context: Context) {
|
|||||||
|
|
||||||
// TODO: ModuleDescriptor should be able to return
|
// TODO: ModuleDescriptor should be able to return
|
||||||
// the package only with the contents of that module, without dependencies
|
// the package only with the contents of that module, without dependencies
|
||||||
val skip: (DeclarationDescriptor) -> Boolean =
|
val keep: (DeclarationDescriptor) -> Boolean =
|
||||||
{ DescriptorUtils.getContainingModule(it) != module }
|
{ DescriptorUtils.getContainingModule(it) == module }
|
||||||
|
|
||||||
|
val fragments = packageView.fragments
|
||||||
|
if (fragments.filter(keep).isEmpty()) return null
|
||||||
|
|
||||||
val classifierDescriptors = KonanDescriptorSerializer
|
val classifierDescriptors = KonanDescriptorSerializer
|
||||||
.sort(packageView.memberScope.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS))
|
.sort(packageView.memberScope.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS))
|
||||||
.filterNot(skip)
|
.filter(keep)
|
||||||
|
|
||||||
val fragments = packageView.fragments
|
|
||||||
val members = fragments
|
val members = fragments
|
||||||
.flatMap { fragment -> DescriptorUtils.getAllDescriptors(fragment.getMemberScope()) }
|
.flatMap { fragment -> DescriptorUtils.getAllDescriptors(fragment.getMemberScope()) }
|
||||||
.filterNot(skip)
|
.filter(keep)
|
||||||
|
|
||||||
if (members.isEmpty() && classifierDescriptors.isEmpty()) return null
|
|
||||||
|
|
||||||
val classesBuilder = KonanLinkData.Classes.newBuilder()
|
val classesBuilder = KonanLinkData.Classes.newBuilder()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user