diff options
author | Chris Rankin <chris.rankin@r3.com> | 2017-10-06 14:14:09 +0100 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-11-22 21:54:14 +0300 |
commit | f941d6adefa71d2b3b1cc69120edf7eae70187ba (patch) | |
tree | 0b943db512486c5cb39e0d3d59c3984090cf5c33 /core/src/main/kotlin | |
parent | 2a62816f1a50f03927dad34eb0ee80a889cb9e7e (diff) | |
download | dokka-f941d6adefa71d2b3b1cc69120edf7eae70187ba.tar.gz dokka-f941d6adefa71d2b3b1cc69120edf7eae70187ba.tar.bz2 dokka-f941d6adefa71d2b3b1cc69120edf7eae70187ba.zip |
Add new "suppress" per-package option.
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt | 4 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt index 6b1f8cb4..cf2b0514 100644 --- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt +++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt @@ -58,7 +58,7 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { } override fun appendFile(file: PsiJavaFile, module: DocumentationModule, packageContent: Map<String, Content>) { - if (file.classes.all { skipElement(it) }) { + if (skipFile(file) || file.classes.all { skipElement(it) }) { return } val packageNode = module.findOrCreatePackageNode(file.packageName, emptyMap(), refGraph) @@ -132,6 +132,8 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { } } + private fun skipFile(javaFile: PsiJavaFile): Boolean = options.effectivePackageOptions(javaFile.packageName).suppress + private fun skipElement(element: Any) = skipElementByVisibility(element) || hasSuppressDocTag(element) || diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 8f8c08a4..8d34a6f1 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -790,7 +790,7 @@ fun DeclarationDescriptor.isDocumented(options: DocumentationOptions): Boolean { return (options.effectivePackageOptions(fqNameSafe).includeNonPublic || this !is MemberDescriptor || this.visibility in visibleToDocumentation) && - !isDocumentationSuppressed(options) && + !isDocumentationSuppressed(options) && !options.effectivePackageOptions(fqNameSafe).suppress && (!options.effectivePackageOptions(fqNameSafe).skipDeprecated || !isDeprecated()) } |