diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2020-07-01 17:36:50 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-07-07 10:07:21 +0200 |
commit | 0533ef9a56ae34138a3f8a5e996805713c48c384 (patch) | |
tree | 9130b79b048feb003b704d0f5024809037944bf2 /plugins/base/src/test/kotlin/utils | |
parent | 177ede83228515f03436a4ac0ce1ce573fc3d74b (diff) | |
download | dokka-0533ef9a56ae34138a3f8a5e996805713c48c384.tar.gz dokka-0533ef9a56ae34138a3f8a5e996805713c48c384.tar.bz2 dokka-0533ef9a56ae34138a3f8a5e996805713c48c384.zip |
Add overrides to provided plugins
Diffstat (limited to 'plugins/base/src/test/kotlin/utils')
-rw-r--r-- | plugins/base/src/test/kotlin/utils/TestOutputWriter.kt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt b/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt index 46ada43a..83f1d180 100644 --- a/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt +++ b/plugins/base/src/test/kotlin/utils/TestOutputWriter.kt @@ -3,15 +3,20 @@ package utils import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.OutputWriter import org.jetbrains.dokka.plugability.DokkaPlugin -import java.io.File -class TestOutputWriterPlugin(failOnOverwrite: Boolean = true): DokkaPlugin() { +class TestOutputWriterPlugin(failOnOverwrite: Boolean = true) : DokkaPlugin() { val writer = TestOutputWriter(failOnOverwrite) - val testWriter by extending { plugin<DokkaBase>().outputWriter with writer } + private val dokkaBase by lazy { plugin<DokkaBase>() } + + val testWriter by extending { + (dokkaBase.outputWriter + with writer + override dokkaBase.fileWriter) + } } -class TestOutputWriter(private val failOnOverwrite: Boolean = true): OutputWriter { +class TestOutputWriter(private val failOnOverwrite: Boolean = true) : OutputWriter { val contents: Map<String, String> get() = _contents private val _contents = mutableMapOf<String, String>() @@ -23,5 +28,6 @@ class TestOutputWriter(private val failOnOverwrite: Boolean = true): OutputWrite } } - override suspend fun writeResources(pathFrom: String, pathTo: String) = write(pathTo, "*** content of $pathFrom ***", "") + override suspend fun writeResources(pathFrom: String, pathTo: String) = + write(pathTo, "*** content of $pathFrom ***", "") } |