From c09bde34ff729ef9b1f3bea602fb53cd4e6dca42 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Fri, 13 Mar 2020 10:46:33 +0100 Subject: Gradle Task supporting multimodular projects --- core/src/main/kotlin/DokkaBootstrapImpl.kt | 32 ++++++++++++++++++---------- core/src/main/kotlin/defaultConfiguration.kt | 2 +- 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'core/src') 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 { 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 = it.externalDocumentationLinks + defaultLinks(it) + configuration.copy( + passesConfigurations = + passesConfigurations.map { + val links: List = + it.externalDocumentationLinks + defaultLinks(it) it.copy(externalDocumentationLinks = links) } ) @@ -94,8 +102,10 @@ class DokkaBootstrapImpl : DokkaBootstrap { generator = DokkaGenerator(configurationWithLinks, logger) } - override fun configure(logger: BiConsumer, serializedConfigurationJSON: String) - = configure(DokkaProxyLogger(logger), gson.fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java)) + override fun configure(logger: BiConsumer, 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, override val passesConfigurations: List, - override val pluginsClasspath: List + override var pluginsClasspath: List ) : DokkaConfiguration data class PassConfigurationImpl ( -- cgit