aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/defaultConfiguration.kt
blob: 8e38e8d5d02f444233ab414af92849e6ffeae2b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package org.jetbrains.dokka

import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import java.io.File
import java.net.URL

data class DokkaConfigurationImpl(
    override val outputDir: String = DokkaDefaults.outputDir,
    override val cacheRoot: String? = DokkaDefaults.cacheRoot,
    override val offlineMode: Boolean = DokkaDefaults.offlineMode,
    override val sourceSets: List<DokkaSourceSetImpl> = emptyList(),
    override val pluginsClasspath: List<File> = emptyList(),
    override val pluginsConfiguration: Map<String, String> = emptyMap(),
    override val modules: List<DokkaModuleDescriptionImpl> = emptyList(),
    override val failOnWarning: Boolean = DokkaDefaults.failOnWarning
) : DokkaConfiguration

data class DokkaSourceSetImpl(
    override val moduleDisplayName: String,
    override val displayName: String = DokkaDefaults.sourceSetDisplayName,
    override val sourceSetID: DokkaSourceSetID,
    override val classpath: List<String> = emptyList(),
    override val sourceRoots: List<SourceRootImpl>,
    override val dependentSourceSets: Set<DokkaSourceSetID> = emptySet(),
    override val samples: List<String> = emptyList(),
    override val includes: List<String> = emptyList(),
    override val includeNonPublic: Boolean = DokkaDefaults.includeNonPublic,
    override val includeRootPackage: Boolean = DokkaDefaults.includeRootPackage,
    override val reportUndocumented: Boolean = DokkaDefaults.reportUndocumented,
    override val skipEmptyPackages: Boolean = DokkaDefaults.skipEmptyPackages,
    override val skipDeprecated: Boolean = DokkaDefaults.skipDeprecated,
    override val jdkVersion: Int = DokkaDefaults.jdkVersion,
    override val sourceLinks: List<SourceLinkDefinitionImpl> = emptyList(),
    override val perPackageOptions: List<PackageOptionsImpl> = emptyList(),
    override var externalDocumentationLinks: List<ExternalDocumentationLinkImpl> = emptyList(),
    override val languageVersion: String? = null,
    override val apiVersion: String? = null,
    override val noStdlibLink: Boolean = DokkaDefaults.noStdlibLink,
    override val noJdkLink: Boolean = DokkaDefaults.noJdkLink,
    override val suppressedFiles: List<String> = emptyList(),
    override val analysisPlatform: Platform = DokkaDefaults.analysisPlatform
) : DokkaSourceSet

data class DokkaModuleDescriptionImpl(
    override val name: String,
    override val path: String,
    override val docFile: String
) : DokkaConfiguration.DokkaModuleDescription

data class SourceRootImpl(
    override val path: String
) : DokkaConfiguration.SourceRoot

data class SourceLinkDefinitionImpl(
    override val path: String,
    override val url: String,
    override val lineSuffix: String?
) : DokkaConfiguration.SourceLinkDefinition {
    companion object {
        fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinitionImpl {
            val (path, urlAndLine) = srcLink.split('=')
            return SourceLinkDefinitionImpl(
                File(path).canonicalPath,
                urlAndLine.substringBefore("#"),
                urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#$it" })
        }
    }
}

data class PackageOptionsImpl(
    override val prefix: String,
    override val includeNonPublic: Boolean,
    override val reportUndocumented: Boolean?,
    override val skipDeprecated: Boolean,
    override val suppress: Boolean
) : DokkaConfiguration.PackageOptions


data class ExternalDocumentationLinkImpl(
    override val url: URL,
    override val packageListUrl: URL
) : DokkaConfiguration.ExternalDocumentationLink