1 package org.jetbrains.dokka 2 3 import org.jetbrains.dokka.DokkaConfiguration.SourceLinkDefinition 4 import org.jetbrains.dokka.DokkaConfiguration.SourceRoot 5 import java.io.File 6 7 8 data class SourceLinkDefinitionImpl(override val path: String, 9 override val url: String, 10 override val lineSuffix: String?) : SourceLinkDefinition { 11 companion object { parseSourceLinkDefinitionnull12 fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinition { 13 val (path, urlAndLine) = srcLink.split('=') 14 return SourceLinkDefinitionImpl(File(path).absolutePath, 15 urlAndLine.substringBefore("#"), 16 urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#" + it }) 17 } 18 } 19 } 20 21 class SourceRootImpl(path: String, override val platforms: List<String> = emptyList()) : SourceRoot { 22 override val path: String = File(path).absolutePath 23 24 companion object { parseSourceRootnull25 fun parseSourceRoot(sourceRoot: String): SourceRoot { 26 val components = sourceRoot.split("::", limit = 2) 27 return SourceRootImpl(components.last(), if (components.size == 1) listOf() else components[0].split(',')) 28 } 29 } 30 } 31 32 data class PackageOptionsImpl(override val prefix: String, 33 override val includeNonPublic: Boolean = false, 34 override val reportUndocumented: Boolean = true, 35 override val skipDeprecated: Boolean = false, 36 override val suppress: Boolean = false) : DokkaConfiguration.PackageOptions 37 38 data class DokkaConfigurationImpl( 39 override val moduleName: String, 40 override val classpath: List<String>, 41 override val sourceRoots: List<SourceRootImpl>, 42 override val samples: List<String>, 43 override val includes: List<String>, 44 override val outputDir: String, 45 override val format: String, 46 override val includeNonPublic: Boolean, 47 override val includeRootPackage: Boolean, 48 override val reportUndocumented: Boolean, 49 override val skipEmptyPackages: Boolean, 50 override val skipDeprecated: Boolean, 51 override val jdkVersion: Int, 52 override val generateClassIndexPage: Boolean, 53 override val generatePackageIndexPage: Boolean, 54 override val sourceLinks: List<SourceLinkDefinitionImpl>, 55 override val impliedPlatforms: List<String>, 56 override val perPackageOptions: List<PackageOptionsImpl>, 57 override val externalDocumentationLinks: List<ExternalDocumentationLinkImpl>, 58 override val noStdlibLink: Boolean, 59 override val noJdkLink: Boolean, 60 override val cacheRoot: String?, 61 override val suppressedFiles: List<String>, 62 override val languageVersion: String?, 63 override val apiVersion: String?, 64 override val collectInheritedExtensionsFromLibraries: Boolean, 65 override val outlineRoot: String, 66 override val dacRoot: String 67 ) : DokkaConfiguration