aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/kotlin/configuration.kt2
-rw-r--r--core/src/main/kotlin/plugability/DokkaContext.kt2
-rw-r--r--core/src/main/kotlin/renderers/PostAction.kt2
-rw-r--r--core/src/main/kotlin/renderers/Renderer.kt2
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt2
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt2
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt2
-rw-r--r--core/src/main/kotlin/transformers/pages/PageTransformer.kt2
-rw-r--r--core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt12
-rw-r--r--core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt2
-rw-r--r--core/src/main/kotlin/validity/PreGenerationChecker.kt2
-rw-r--r--plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProviderFactory.kt22
-rw-r--r--plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProvider.kt2
-rw-r--r--plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt2
-rw-r--r--plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt37
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/LocationProviderFactory.kt2
-rw-r--r--plugins/base/src/main/kotlin/signatures/SignatureProvider.kt2
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/ExternalClasslikesTranslator.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/ExternalDocumentablesProvider.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt2
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt2
-rw-r--r--plugins/versioning/src/main/kotlin/versioning/VersionsNavigationCreator.kt2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt3
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayoutTest.kt6
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt6
26 files changed, 55 insertions, 71 deletions
diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt
index ebd6ed61..c7feb22e 100644
--- a/core/src/main/kotlin/configuration.kt
+++ b/core/src/main/kotlin/configuration.kt
@@ -61,7 +61,7 @@ enum class Platform(val key: String) {
}
}
-interface DokkaConfigurationBuilder<T : Any> {
+fun interface DokkaConfigurationBuilder<T : Any> {
fun build(): T
}
diff --git a/core/src/main/kotlin/plugability/DokkaContext.kt b/core/src/main/kotlin/plugability/DokkaContext.kt
index f8aa5969..06efeb1a 100644
--- a/core/src/main/kotlin/plugability/DokkaContext.kt
+++ b/core/src/main/kotlin/plugability/DokkaContext.kt
@@ -43,7 +43,7 @@ interface DokkaContext {
inline fun <reified T : DokkaPlugin> DokkaContext.plugin(): T = plugin(T::class)
?: throw java.lang.IllegalStateException("Plugin ${T::class.qualifiedName} is not present in context.")
-interface DokkaContextConfiguration {
+fun interface DokkaContextConfiguration {
fun installExtension(extension: Extension<*, *, *>)
}
diff --git a/core/src/main/kotlin/renderers/PostAction.kt b/core/src/main/kotlin/renderers/PostAction.kt
index e47d5d22..4237c6df 100644
--- a/core/src/main/kotlin/renderers/PostAction.kt
+++ b/core/src/main/kotlin/renderers/PostAction.kt
@@ -1,3 +1,3 @@
package org.jetbrains.dokka.renderers
-interface PostAction : () -> Unit \ No newline at end of file
+fun interface PostAction : () -> Unit \ No newline at end of file
diff --git a/core/src/main/kotlin/renderers/Renderer.kt b/core/src/main/kotlin/renderers/Renderer.kt
index 10235f21..73b08067 100644
--- a/core/src/main/kotlin/renderers/Renderer.kt
+++ b/core/src/main/kotlin/renderers/Renderer.kt
@@ -2,6 +2,6 @@ package org.jetbrains.dokka.renderers
import org.jetbrains.dokka.pages.RootPageNode
-interface Renderer {
+fun interface Renderer {
fun render(root: RootPageNode)
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt b/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt
index aa878873..358fdb1d 100644
--- a/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt
+++ b/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt
@@ -3,6 +3,6 @@ package org.jetbrains.dokka.transformers.documentation
import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.plugability.DokkaContext
-interface DocumentableMerger {
+fun interface DocumentableMerger {
operator fun invoke(modules: Collection<DModule>): DModule?
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt b/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt
index a4daba63..f8005cfe 100644
--- a/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt
+++ b/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt
@@ -4,6 +4,6 @@ import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.pages.ModulePageNode
import org.jetbrains.dokka.pages.RootPageNode
-interface DocumentableToPageTranslator {
+fun interface DocumentableToPageTranslator {
operator fun invoke(module: DModule): RootPageNode
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt b/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt
index d0570c7a..a808a224 100644
--- a/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt
+++ b/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt
@@ -4,6 +4,6 @@ import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.model.Documentable
import org.jetbrains.dokka.plugability.DokkaContext
-interface DocumentableTransformer {
+fun interface DocumentableTransformer {
operator fun invoke(original: DModule, context: DokkaContext): DModule
}
diff --git a/core/src/main/kotlin/transformers/pages/PageTransformer.kt b/core/src/main/kotlin/transformers/pages/PageTransformer.kt
index 68dc4bc8..b51eb31b 100644
--- a/core/src/main/kotlin/transformers/pages/PageTransformer.kt
+++ b/core/src/main/kotlin/transformers/pages/PageTransformer.kt
@@ -2,6 +2,6 @@ package org.jetbrains.dokka.transformers.pages
import org.jetbrains.dokka.pages.RootPageNode
-interface PageTransformer {
+fun interface PageTransformer {
operator fun invoke(input: RootPageNode): RootPageNode
}
diff --git a/core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt b/core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt
index 291b72ef..6797eae6 100644
--- a/core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt
+++ b/core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt
@@ -3,17 +3,11 @@ package org.jetbrains.dokka.transformers.pages
import org.jetbrains.dokka.pages.PageNode
import org.jetbrains.dokka.pages.RootPageNode
-fun pageScanner(block: PageNode.() -> Unit) = object : PageTransformer {
- override fun invoke(input: RootPageNode): RootPageNode = input.invokeOnAll(block) as RootPageNode
-}
+fun pageScanner(block: PageNode.() -> Unit) = PageTransformer { input -> input.invokeOnAll(block) as RootPageNode }
-fun pageMapper(block: PageNode.() -> PageNode) = object : PageTransformer {
- override fun invoke(input: RootPageNode): RootPageNode = input.alterChildren(block) as RootPageNode
-}
+fun pageMapper(block: PageNode.() -> PageNode) = PageTransformer { input -> input.alterChildren(block) as RootPageNode }
-fun pageStructureTransformer(block: RootPageNode.() -> RootPageNode) = object : PageTransformer {
- override fun invoke(input: RootPageNode): RootPageNode = block(input)
-}
+fun pageStructureTransformer(block: RootPageNode.() -> RootPageNode) = PageTransformer { input -> block(input) }
fun PageNode.invokeOnAll(block: PageNode.() -> Unit): PageNode =
this.also(block).also { it.children.forEach { it.invokeOnAll(block) } }
diff --git a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt
index 2252dde3..2f0ea031 100644
--- a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt
+++ b/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt
@@ -4,6 +4,6 @@ import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.plugability.DokkaContext
-interface SourceToDocumentableTranslator {
+fun interface SourceToDocumentableTranslator {
fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule
}
diff --git a/core/src/main/kotlin/validity/PreGenerationChecker.kt b/core/src/main/kotlin/validity/PreGenerationChecker.kt
index 7cdad59b..52e79046 100644
--- a/core/src/main/kotlin/validity/PreGenerationChecker.kt
+++ b/core/src/main/kotlin/validity/PreGenerationChecker.kt
@@ -1,6 +1,6 @@
package org.jetbrains.dokka.validity
-interface PreGenerationChecker : () -> PreGenerationCheckerOutput {
+fun interface PreGenerationChecker : () -> PreGenerationCheckerOutput {
override fun invoke(): PreGenerationCheckerOutput
}
diff --git a/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProviderFactory.kt
index 63db27be..8455320f 100644
--- a/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProviderFactory.kt
+++ b/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProviderFactory.kt
@@ -1,21 +1,19 @@
package org.jetbrains.dokka.base.resolvers.external
-import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat
import org.jetbrains.dokka.plugability.DokkaContext
class DefaultExternalLocationProviderFactory(val context: DokkaContext) :
ExternalLocationProviderFactory by ExternalLocationProviderFactoryWithCache(
- object : ExternalLocationProviderFactory {
- override fun getExternalLocationProvider(doc: ExternalDocumentation): ExternalLocationProvider? =
- when (doc.packageList.linkFormat) {
- RecognizedLinkFormat.KotlinWebsite,
- RecognizedLinkFormat.KotlinWebsiteHtml,
- RecognizedLinkFormat.DokkaOldHtml -> Dokka010ExternalLocationProvider(doc, ".html", context)
- RecognizedLinkFormat.DokkaHtml -> DefaultExternalLocationProvider(doc, ".html", context)
- RecognizedLinkFormat.DokkaGFM,
- RecognizedLinkFormat.DokkaJekyll -> DefaultExternalLocationProvider(doc, ".md", context)
- else -> null
- }
+ { doc ->
+ when (doc.packageList.linkFormat) {
+ RecognizedLinkFormat.KotlinWebsite,
+ RecognizedLinkFormat.KotlinWebsiteHtml,
+ RecognizedLinkFormat.DokkaOldHtml -> Dokka010ExternalLocationProvider(doc, ".html", context)
+ RecognizedLinkFormat.DokkaHtml -> DefaultExternalLocationProvider(doc, ".html", context)
+ RecognizedLinkFormat.DokkaGFM,
+ RecognizedLinkFormat.DokkaJekyll -> DefaultExternalLocationProvider(doc, ".md", context)
+ else -> null
+ }
}
)
diff --git a/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProvider.kt
index 11940abc..8465d41f 100644
--- a/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProvider.kt
@@ -5,7 +5,7 @@ import org.jetbrains.dokka.links.DRI
/**
* Provides the path to the page documenting a [DRI] in an external documentation source
*/
-interface ExternalLocationProvider {
+fun interface ExternalLocationProvider {
/**
* @return Path to the page containing the [dri] or null if the path cannot be created
* (eg. when the package-list does not contain [dri]'s package)
diff --git a/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt
index c7328765..c11a79ba 100644
--- a/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt
+++ b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt
@@ -2,6 +2,6 @@ package org.jetbrains.dokka.base.resolvers.external
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
-interface ExternalLocationProviderFactory {
+fun interface ExternalLocationProviderFactory {
fun getExternalLocationProvider(doc: ExternalDocumentation): ExternalLocationProvider?
}
diff --git a/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt
index 102d118a..c9ebad81 100644
--- a/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt
+++ b/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt
@@ -3,32 +3,29 @@ package org.jetbrains.dokka.base.resolvers.external.javadoc
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.androidSdk
import org.jetbrains.dokka.androidX
-import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProviderFactory
import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProviderFactoryWithCache
-import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat
import org.jetbrains.dokka.plugability.DokkaContext
class JavadocExternalLocationProviderFactory(val context: DokkaContext) :
ExternalLocationProviderFactory by ExternalLocationProviderFactoryWithCache(
- object : ExternalLocationProviderFactory {
- override fun getExternalLocationProvider(doc: ExternalDocumentation): ExternalLocationProvider? =
- when (doc.packageList.url) {
- DokkaConfiguration.ExternalDocumentationLink.androidX().packageListUrl,
- DokkaConfiguration.ExternalDocumentationLink.androidSdk().packageListUrl ->
- AndroidExternalLocationProvider(doc, context)
- else ->
- when (doc.packageList.linkFormat) {
- RecognizedLinkFormat.Javadoc1 ->
- JavadocExternalLocationProvider(doc, "()", ", ", context) // Covers JDK 1 - 7
- RecognizedLinkFormat.Javadoc8 ->
- JavadocExternalLocationProvider(doc, "--", "-", context) // Covers JDK 8 - 9
- RecognizedLinkFormat.Javadoc10,
- RecognizedLinkFormat.DokkaJavadoc ->
- JavadocExternalLocationProvider(doc, "()", ",", context) // Covers JDK 10
- else -> null
- }
- }
+ { doc ->
+ when (doc.packageList.url) {
+ DokkaConfiguration.ExternalDocumentationLink.androidX().packageListUrl,
+ DokkaConfiguration.ExternalDocumentationLink.androidSdk().packageListUrl ->
+ AndroidExternalLocationProvider(doc, context)
+ else ->
+ when (doc.packageList.linkFormat) {
+ RecognizedLinkFormat.Javadoc1 ->
+ JavadocExternalLocationProvider(doc, "()", ", ", context) // Covers JDK 1 - 7
+ RecognizedLinkFormat.Javadoc8 ->
+ JavadocExternalLocationProvider(doc, "--", "-", context) // Covers JDK 8 - 9
+ RecognizedLinkFormat.Javadoc10,
+ RecognizedLinkFormat.DokkaJavadoc ->
+ JavadocExternalLocationProvider(doc, "()", ",", context) // Covers JDK 10
+ else -> null
+ }
+ }
}
)
diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProviderFactory.kt
index fb72fc60..26f9028c 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/LocationProviderFactory.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProviderFactory.kt
@@ -2,6 +2,6 @@ package org.jetbrains.dokka.base.resolvers.local
import org.jetbrains.dokka.pages.RootPageNode
-interface LocationProviderFactory {
+fun interface LocationProviderFactory {
fun getLocationProvider(pageNode: RootPageNode): LocationProvider
}
diff --git a/plugins/base/src/main/kotlin/signatures/SignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/SignatureProvider.kt
index e1933fb8..03ef3a4e 100644
--- a/plugins/base/src/main/kotlin/signatures/SignatureProvider.kt
+++ b/plugins/base/src/main/kotlin/signatures/SignatureProvider.kt
@@ -3,6 +3,6 @@ package org.jetbrains.dokka.base.signatures
import org.jetbrains.dokka.model.Documentable
import org.jetbrains.dokka.pages.ContentNode
-interface SignatureProvider {
+fun interface SignatureProvider {
fun signature(documentable: Documentable): List<ContentNode>
}
diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt
index b73b17e0..81822d3e 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt
@@ -2,7 +2,7 @@ package org.jetbrains.dokka.base.transformers.pages.merger
import org.jetbrains.dokka.pages.PageNode
-interface PageMergerStrategy {
+fun interface PageMergerStrategy {
fun tryMerge(pages: List<PageNode>, path: List<String>): List<PageNode>
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/ExternalClasslikesTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/ExternalClasslikesTranslator.kt
index ec4d1ee9..a5385c46 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/ExternalClasslikesTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/ExternalClasslikesTranslator.kt
@@ -7,6 +7,6 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor
/**
* Service translating [ClassDescriptor]s of symbols defined outside of documented project to [DClasslike]s.
*/
-interface ExternalClasslikesTranslator {
+fun interface ExternalClasslikesTranslator {
fun translateClassDescriptor(descriptor: ClassDescriptor, sourceSet: DokkaSourceSet): DClasslike
} \ No newline at end of file
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/ExternalDocumentablesProvider.kt b/plugins/base/src/main/kotlin/translators/descriptors/ExternalDocumentablesProvider.kt
index c1dbfc28..e6d499f4 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/ExternalDocumentablesProvider.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/ExternalDocumentablesProvider.kt
@@ -11,7 +11,7 @@ import org.jetbrains.dokka.model.DClasslike
* in the project itself but are somehow related to the symbols defined in the documented project (e.g. are supertypes
* of classes defined in project).
*/
-interface ExternalDocumentablesProvider {
+fun interface ExternalDocumentablesProvider {
/**
* Returns [DClasslike] matching provided [DRI] in specified source set.
diff --git a/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt b/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt
index 13d17f52..f93f7d6d 100644
--- a/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt
@@ -30,7 +30,7 @@ import org.jsoup.nodes.Node
import org.jsoup.nodes.TextNode
import java.util.*
-interface JavaDocumentationParser {
+fun interface JavaDocumentationParser {
fun parseDocumentation(element: PsiNamedElement): DocumentationNode
}
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
index 6d04093e..572c5dec 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
@@ -22,7 +22,7 @@ interface WithJavadocExtra<T : Documentable> : WithExtraProperties<T> {
throw IllegalStateException("Merging extras is not applicable for javadoc")
}
-interface WithNavigable {
+fun interface WithNavigable {
fun getAllNavigables(): List<NavigableJavadocNode>
}
diff --git a/plugins/versioning/src/main/kotlin/versioning/VersionsNavigationCreator.kt b/plugins/versioning/src/main/kotlin/versioning/VersionsNavigationCreator.kt
index 876b3ccf..719d2cf9 100644
--- a/plugins/versioning/src/main/kotlin/versioning/VersionsNavigationCreator.kt
+++ b/plugins/versioning/src/main/kotlin/versioning/VersionsNavigationCreator.kt
@@ -11,7 +11,7 @@ import org.jetbrains.dokka.plugability.querySingle
import org.jetbrains.dokka.utilities.urlEncoded
import java.io.File
-interface VersionsNavigationCreator {
+fun interface VersionsNavigationCreator {
operator fun invoke(output: File): String
}
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt
index b2fd9924..3daaa3b7 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt
@@ -8,7 +8,7 @@ import java.io.File
* @see NoCopy
* @see CompactInParent
*/
-interface DokkaMultiModuleFileLayout {
+fun interface DokkaMultiModuleFileLayout {
/**
* @param parent: The [DokkaMultiModuleTask] that is initiating a composite documentation run
@@ -24,7 +24,6 @@ interface DokkaMultiModuleFileLayout {
object NoCopy : DokkaMultiModuleFileLayout {
override fun targetChildOutputDirectory(parent: DokkaMultiModuleTask, child: AbstractDokkaTask): File =
child.outputDirectory.getSafe()
-
}
/**
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayoutTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayoutTest.kt
index 407b1ef9..7d2a9609 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayoutTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayoutTest.kt
@@ -105,10 +105,8 @@ class DokkaMultiModuleFileLayoutTest {
val project = ProjectBuilder.builder().build()
val childTask = project.tasks.create<DokkaTask>("child")
val parentTask = project.tasks.create<DokkaMultiModuleTask>("parent")
- parentTask.fileLayout by object : DokkaMultiModuleFileLayout {
- override fun targetChildOutputDirectory(parent: DokkaMultiModuleTask, child: AbstractDokkaTask): File {
- return child.outputDirectory.getSafe().resolve("subfolder")
- }
+ parentTask.fileLayout by DokkaMultiModuleFileLayout { _, child ->
+ child.outputDirectory.getSafe().resolve("subfolder")
}
assertFailsWith<DokkaException> { parentTask.copyChildOutputDirectory(childTask) }
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt
index 73afdb43..5ad33c57 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt
@@ -201,10 +201,8 @@ class DokkaMultiModuleTaskTest {
val childTask = child.tasks.create<DokkaTask>("child")
parentTask.addChildTask(childTask)
- parentTask.fileLayout by object : DokkaMultiModuleFileLayout {
- override fun targetChildOutputDirectory(parent: DokkaMultiModuleTask, child: AbstractDokkaTask): File {
- return parent.project.buildDir.resolve(child.name)
- }
+ parentTask.fileLayout by DokkaMultiModuleFileLayout { parent, child ->
+ parent.project.buildDir.resolve(child.name)
}
assertEquals(