diff options
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrapImpl.kt | 4 | ||||
-rw-r--r-- | core/src/main/kotlin/Generation/configurationImpl.kt | 3 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 14 |
3 files changed, 16 insertions, 5 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index 5ac1c57f..593c6db1 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -61,7 +61,9 @@ class DokkaBootstrapImpl : DokkaBootstrap { generateIndexPages, sourceLinks, impliedPlatforms, - perPackageOptions + perPackageOptions, + externalDocumentationLinks, + noStdlibLink ) ) } diff --git a/core/src/main/kotlin/Generation/configurationImpl.kt b/core/src/main/kotlin/Generation/configurationImpl.kt index b51857e7..cdc9752d 100644 --- a/core/src/main/kotlin/Generation/configurationImpl.kt +++ b/core/src/main/kotlin/Generation/configurationImpl.kt @@ -51,4 +51,5 @@ data class DokkaConfigurationImpl(override val moduleName: String, override val sourceLinks: List<SourceLinkDefinitionImpl>, override val impliedPlatforms: List<String>, override val perPackageOptions: List<PackageOptionsImpl>, - override val externalDocumentationLinks: List<ExternalDocumentationLinkImpl>) : DokkaConfiguration
\ No newline at end of file + override val externalDocumentationLinks: List<ExternalDocumentationLinkImpl>, + override val noStdlibLink: Boolean) : DokkaConfiguration
\ No newline at end of file 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, |