aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Generation/FileGenerator.kt9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Generation/FileGenerator.kt b/src/Generation/FileGenerator.kt
index 08a885ab..c4025088 100644
--- a/src/Generation/FileGenerator.kt
+++ b/src/Generation/FileGenerator.kt
@@ -7,8 +7,9 @@ import java.io.IOException
import java.io.OutputStreamWriter
public class FileGenerator @Inject constructor(val locationService: FileLocationService,
- val formatService: FormatService,
- @Inject(optional = true) val outlineService: OutlineFormatService?) : Generator {
+ val formatService: FormatService) : Generator {
+
+ @set:Inject(optional = true) var outlineService: OutlineFormatService? = null
override fun buildPages(nodes: Iterable<DocumentationNode>) {
val specificLocationService = locationService.withExtension(formatService.extension)
@@ -30,9 +31,7 @@ public class FileGenerator @Inject constructor(val locationService: FileLocation
}
override fun buildOutlines(nodes: Iterable<DocumentationNode>) {
- if (outlineService == null) {
- return
- }
+ val outlineService = this.outlineService ?: return
for ((location, items) in nodes.groupBy { locationService.location(it) }) {
val file = outlineService.getOutlineFileName(location)
file.parentFile?.mkdirsOrFail()