From 2c967fb5389b0f7891b59d8a9334e4efca546b46 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Thu, 9 Jul 2020 16:30:36 +0200 Subject: Remove `format` from dokka DokkaConfiguration --- plugins/base/src/main/kotlin/DokkaBase.kt | 16 ++++++++-------- .../kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt | 2 +- plugins/gfm/src/main/kotlin/GfmPlugin.kt | 2 -- .../kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt | 4 ++-- plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt | 11 +++-------- plugins/jekyll/src/main/kotlin/JekyllPlugin.kt | 3 +-- 6 files changed, 15 insertions(+), 23 deletions(-) (limited to 'plugins') diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt index 8fed0afd..bcd2c93e 100644 --- a/plugins/base/src/main/kotlin/DokkaBase.kt +++ b/plugins/base/src/main/kotlin/DokkaBase.kt @@ -135,7 +135,7 @@ class DokkaBase : DokkaPlugin() { } val htmlRenderer by extending { - CoreExtensions.renderer providing ::HtmlRenderer applyIf { format == "html" } + CoreExtensions.renderer providing ::HtmlRenderer } val defaultKotlinAnalysis by extending { @@ -159,7 +159,7 @@ class DokkaBase : DokkaPlugin() { } val rootCreator by extending { - htmlPreprocessors with RootCreator applyIf { format == "html" } + htmlPreprocessors with RootCreator } val defaultSamplesTransformer by extending { @@ -182,19 +182,19 @@ class DokkaBase : DokkaPlugin() { } val navigationPageInstaller by extending { - htmlPreprocessors with NavigationPageInstaller order { after(rootCreator) } applyIf { format == "html" } + htmlPreprocessors with NavigationPageInstaller order { after(rootCreator) } } val searchPageInstaller by extending { - htmlPreprocessors with SearchPageInstaller order { after(rootCreator) } applyIf { format == "html" } + htmlPreprocessors with SearchPageInstaller order { after(rootCreator) } } val resourceInstaller by extending { - htmlPreprocessors with ResourceInstaller order { after(rootCreator) } applyIf { format == "html" } + htmlPreprocessors with ResourceInstaller order { after(rootCreator) } } val styleAndScriptsAppender by extending { - htmlPreprocessors with StyleAndScriptsAppender order { after(rootCreator) } applyIf { format == "html" } + htmlPreprocessors with StyleAndScriptsAppender order { after(rootCreator) } } val packageListCreator by extending { @@ -204,7 +204,7 @@ class DokkaBase : DokkaPlugin() { "html", "html" ) - } order { after(rootCreator) } applyIf { format == "html" } + } order { after(rootCreator) } } val sourcesetDependencyAppender by extending { @@ -216,4 +216,4 @@ class DokkaBase : DokkaPlugin() { MultimodulePageCreator(it) } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt index 5ac5aafa..397a9c45 100644 --- a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt +++ b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt @@ -24,7 +24,7 @@ abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase() { DokkaBase().externalLocationProviderFactory to { ::JavadocExternalLocationProviderFactory }, DokkaBase().externalLocationProviderFactory to { ::DokkaExternalLocationProviderFactory }, testConfiguration = DokkaConfigurationImpl( - "", "", null, false, emptyList(), emptyList(), emptyMap(), emptyList(), false + "", null, false, emptyList(), emptyList(), emptyMap(), emptyList(), false ) ) diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt index 15fe6943..a07a26f2 100644 --- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt +++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt @@ -24,14 +24,12 @@ class GfmPlugin : DokkaPlugin() { val renderer by extending { (CoreExtensions.renderer providing { CommonmarkRenderer(it) } - applyIf { format == "gfm" } override dokkaBase.htmlRenderer) } val locationProvider by extending { (dokkaBase.locationProviderFactory providing { MarkdownLocationProviderFactory(it) } - applyIf { format == "gfm" } override dokkaBase.locationProvider) } diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt index 64e55f4f..6d0dd3a6 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt @@ -22,11 +22,11 @@ abstract class GfmRenderingOnlyTestBase : RenderingOnlyTestBase() { GfmPlugin().gfmPreprocessors to { _ -> RootCreator }, testConfiguration = DokkaConfigurationImpl( - "", "", null, false, emptyList(), emptyList(), emptyMap(), emptyList(), false + "", null, false, emptyList(), emptyList(), emptyMap(), emptyList(), false ) ) override val renderedContent: String by lazy { files.contents.getValue("test-page.md") } -} \ No newline at end of file +} diff --git a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt index 1a14e97e..8283bd78 100644 --- a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt +++ b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt @@ -20,7 +20,6 @@ class JavadocPlugin : DokkaPlugin() { val dokkaJavadocPlugin by extending { (CoreExtensions.renderer providing { ctx -> KorteJavadocRenderer(dokkaBasePlugin.querySingle { outputWriter }, ctx, "views") } - applyIf { format == javadocFormat } override dokkaBasePlugin.htmlRenderer) } @@ -31,13 +30,13 @@ class JavadocPlugin : DokkaPlugin() { dokkaBasePlugin.querySingle { signatureProvider }, context.logger ) - } override dokkaBasePlugin.documentableToPageTranslator applyIf { format == javadocFormat } + } override dokkaBasePlugin.documentableToPageTranslator } val javadocLocationProviderFactory by extending { locationProviderFactory providing { context -> JavadocLocationProviderFactory(context) - } applyIf { format == javadocFormat } + } } val javadocSignatureProvider by extending { @@ -48,11 +47,7 @@ class JavadocPlugin : DokkaPlugin() { dokkaBasePlugin.commentsToContentConverter ), ctx.logger ) - } override kotinAsJavaPlugin.javaSignatureProvider applyIf { format == javadocFormat } - } - - companion object { - private val javadocFormat = "javadoc" + } override kotinAsJavaPlugin.javaSignatureProvider } } diff --git a/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt b/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt index ad83ca76..f6ea894c 100644 --- a/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt +++ b/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt @@ -21,7 +21,6 @@ class JekyllPlugin : DokkaPlugin() { val renderer by extending { (CoreExtensions.renderer providing { JekyllRenderer(it) } - applyIf { format == "jekyll" } override plugin().htmlRenderer) } @@ -54,4 +53,4 @@ class JekyllRenderer( content(builder, page) return builder.toString() } -} \ No newline at end of file +} -- cgit