diff options
author | Goooler <wangzongler@gmail.com> | 2022-02-15 17:38:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 12:38:10 +0300 |
commit | 2372302f4bc3b4bf49beb0d477eebdd9ac99a78f (patch) | |
tree | 3a984a8ecdd63da74dfd48a777cc56200ee1d666 /runners/gradle-plugin/src | |
parent | b0244f69277f492eb87694cf34cc620a265adbcb (diff) | |
download | dokka-2372302f4bc3b4bf49beb0d477eebdd9ac99a78f.tar.gz dokka-2372302f4bc3b4bf49beb0d477eebdd9ac99a78f.tar.bz2 dokka-2372302f4bc3b4bf49beb0d477eebdd9ac99a78f.zip |
Convert interfaces to functional (#2360)
Diffstat (limited to 'runners/gradle-plugin/src')
3 files changed, 5 insertions, 10 deletions
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( |