diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-11-28 16:02:13 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-11-28 16:10:36 +0100 |
commit | d59f77a81fcbc94a074e7b481af299765342a7a2 (patch) | |
tree | da64c51930bfbc13b71a54c8cad1cf54fe3ad49e /core/src/main/kotlin/Kotlin | |
parent | 00f92bd73bfd8cb1e6da40e0bafe43db3f443e5e (diff) | |
download | dokka-d59f77a81fcbc94a074e7b481af299765342a7a2.tar.gz dokka-d59f77a81fcbc94a074e7b481af299765342a7a2.tar.bz2 dokka-d59f77a81fcbc94a074e7b481af299765342a7a2.zip |
Fix package suppression
Package suppression depended on the order of `perPackageOption`s. That should not be the case. Fixes https://github.com/Kotlin/dokka/issues/521
Diffstat (limited to 'core/src/main/kotlin/Kotlin')
-rw-r--r-- | core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 3168e033..666f22fa 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -423,7 +423,7 @@ class DocumentationBuilder fun DocumentationModule.appendFragments(fragments: Collection<PackageFragmentDescriptor>, packageContent: Map<String, Content>, packageDocumentationBuilder: PackageDocumentationBuilder) { - val allFqNames = fragments.filter{ it.isDocumented(passConfiguration) }.map { it.fqName }.distinct() + val allFqNames = fragments.filter { it.isDocumented(passConfiguration) }.map { it.fqName }.distinct() for (packageName in allFqNames) { if (packageName.isRoot && !passConfiguration.includeRootPackage) continue @@ -1157,7 +1157,9 @@ fun ClassDescriptor.supertypesWithAnyPrecise(): Collection<KotlinType> { fun PassConfiguration.effectivePackageOptions(pack: String): DokkaConfiguration.PackageOptions { val rootPackageOptions = PackageOptionsImpl("", includeNonPublic, reportUndocumented, skipDeprecated, false) - return perPackageOptions.firstOrNull { pack == it.prefix || pack.startsWith(it.prefix + ".") } ?: rootPackageOptions + return perPackageOptions.firstOrNull { pack == it.prefix } + ?: perPackageOptions.firstOrNull { pack.startsWith(it.prefix + ".") } + ?: rootPackageOptions } fun PassConfiguration.effectivePackageOptions(pack: FqName): DokkaConfiguration.PackageOptions = effectivePackageOptions(pack.asString()) |