diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-05-16 18:26:22 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-05-16 19:37:32 +0300 |
commit | 177aff68f26b01c20508a51272607829c831d323 (patch) | |
tree | 44c974c95037af1f003fa09352a3e3408968b2b7 /core/src/main/kotlin/Kotlin | |
parent | f9baebebf36904caea48fa45292874f53c4986ab (diff) | |
download | dokka-177aff68f26b01c20508a51272607829c831d323.tar.gz dokka-177aff68f26b01c20508a51272607829c831d323.tar.bz2 dokka-177aff68f26b01c20508a51272607829c831d323.zip |
Fix runner parameters for consistency, add default link to stdlib
Diffstat (limited to 'core/src/main/kotlin/Kotlin')
-rw-r--r-- | core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 5049f42d..0fc87a8e 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -44,7 +44,8 @@ class DocumentationOptions(val outputDir: String, val impliedPlatforms: List<String> = emptyList(), // Sorted by pattern length perPackageOptions: List<PackageOptions> = emptyList(), - externalDocumentationLinks: List<ExternalDocumentationLink> = emptyList()) { + externalDocumentationLinks: List<ExternalDocumentationLink> = emptyList(), + noStdlibLink: Boolean) { init { if (perPackageOptions.any { it.prefix == "" }) throw IllegalArgumentException("Please do not register packageOptions with all match pattern, use global settings instead") @@ -53,10 +54,17 @@ class DocumentationOptions(val outputDir: String, val perPackageOptions = perPackageOptions.sortedByDescending { it.prefix.length } val rootPackageOptions = PackageOptionsImpl("", includeNonPublic, reportUndocumented, skipDeprecated) - fun effectivePackageOptions(pack: String): PackageOptions = perPackageOptions.firstOrNull { pack.startsWith(it.prefix + ".") } ?: rootPackageOptions + fun effectivePackageOptions(pack: String): PackageOptions = perPackageOptions.firstOrNull { pack == it.prefix || pack.startsWith(it.prefix + ".") } ?: rootPackageOptions fun effectivePackageOptions(pack: FqName): PackageOptions = effectivePackageOptions(pack.asString()) - val externalDocumentationLinks = listOf(ExternalDocumentationLink.Builder("http://docs.oracle.com/javase/$jdkVersion/docs/api/").build()) + externalDocumentationLinks + val defaultLinks = run { + val links = mutableListOf(ExternalDocumentationLink.Builder("http://docs.oracle.com/javase/$jdkVersion/docs/api/").build()) + if (!noStdlibLink) + links += ExternalDocumentationLink.Builder("https://kotlinlang.org/api/latest/jvm/stdlib/").build() + links + } + + val externalDocumentationLinks = defaultLinks + externalDocumentationLinks } private fun isExtensionForExternalClass(extensionFunctionDescriptor: DeclarationDescriptor, |