aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-03-13 10:46:33 +0100
committerBłażej Kardyś <bkardys@virtuslab.com>2020-03-23 13:57:07 +0100
commitc09bde34ff729ef9b1f3bea602fb53cd4e6dca42 (patch)
tree3a744a16c133b813ab1849761aef1ec3544f401f /core/src/main
parentcedf8b7594deef2cd26e981865daa8aae0155520 (diff)
downloaddokka-c09bde34ff729ef9b1f3bea602fb53cd4e6dca42.tar.gz
dokka-c09bde34ff729ef9b1f3bea602fb53cd4e6dca42.tar.bz2
dokka-c09bde34ff729ef9b1f3bea602fb53cd4e6dca42.zip
Gradle Task supporting multimodular projects
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/DokkaBootstrapImpl.kt32
-rw-r--r--core/src/main/kotlin/defaultConfiguration.kt2
2 files changed, 22 insertions, 12 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt
index fc1b6926..f164a3c1 100644
--- a/core/src/main/kotlin/DokkaBootstrapImpl.kt
+++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt
@@ -20,7 +20,13 @@ fun parsePerPackageOptions(arg: String): List<PackageOptions> {
val reportUndocumented = args.find { it.endsWith("warnUndocumented") }?.startsWith("+") ?: true
val privateApi = args.find { it.endsWith("privateApi") }?.startsWith("+") ?: false
val suppress = args.find { it.endsWith("suppress") }?.startsWith("+") ?: false
- PackageOptionsImpl(prefix, includeNonPublic = privateApi, reportUndocumented = reportUndocumented, skipDeprecated = !deprecated, suppress = suppress)
+ PackageOptionsImpl(
+ prefix,
+ includeNonPublic = privateApi,
+ reportUndocumented = reportUndocumented,
+ skipDeprecated = !deprecated,
+ suppress = suppress
+ )
}
}
@@ -52,10 +58,11 @@ class DokkaBootstrapImpl : DokkaBootstrap {
override fun report() {
if (warningsCount > 0 || errorsCount > 0) {
- println("Generation completed with $warningsCount warning" +
- (if(DokkaConsoleLogger.warningsCount == 1) "" else "s") +
- " and $errorsCount error" +
- if(DokkaConsoleLogger.errorsCount == 1) "" else "s"
+ println(
+ "Generation completed with $warningsCount warning" +
+ (if (DokkaConsoleLogger.warningsCount == 1) "" else "s") +
+ " and $errorsCount error" +
+ if (DokkaConsoleLogger.errorsCount == 1) "" else "s"
)
} else {
println("generation completed successfully")
@@ -83,10 +90,11 @@ class DokkaBootstrapImpl : DokkaBootstrap {
}
val configurationWithLinks =
- configuration.copy(passesConfigurations =
- passesConfigurations
- .map {
- val links: List<ExternalDocumentationLinkImpl> = it.externalDocumentationLinks + defaultLinks(it)
+ configuration.copy(
+ passesConfigurations =
+ passesConfigurations.map {
+ val links: List<ExternalDocumentationLinkImpl> =
+ it.externalDocumentationLinks + defaultLinks(it)
it.copy(externalDocumentationLinks = links)
}
)
@@ -94,8 +102,10 @@ class DokkaBootstrapImpl : DokkaBootstrap {
generator = DokkaGenerator(configurationWithLinks, logger)
}
- override fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String)
- = configure(DokkaProxyLogger(logger), gson.fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java))
+ override fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String) = configure(
+ DokkaProxyLogger(logger),
+ gson.fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java)
+ )
override fun generate() = generator.generate()
}
diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt
index 148bf830..b0c12015 100644
--- a/core/src/main/kotlin/defaultConfiguration.kt
+++ b/core/src/main/kotlin/defaultConfiguration.kt
@@ -10,7 +10,7 @@ data class DokkaConfigurationImpl(
override val cacheRoot: String?,
override val impliedPlatforms: List<String>,
override val passesConfigurations: List<PassConfigurationImpl>,
- override val pluginsClasspath: List<File>
+ override var pluginsClasspath: List<File>
) : DokkaConfiguration
data class PassConfigurationImpl (