aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Generation
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-02 04:57:45 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-02 04:57:45 +0300
commitc7523225200a3e24d24fb3b0492d5c377246fc69 (patch)
treeb15a87588e3b125d826ba74b596509fe4bc7b280 /core/src/main/kotlin/Generation
parentc1abcaf32abd4e2d74b9246385b3541096cdb5b9 (diff)
downloaddokka-c7523225200a3e24d24fb3b0492d5c377246fc69.tar.gz
dokka-c7523225200a3e24d24fb3b0492d5c377246fc69.tar.bz2
dokka-c7523225200a3e24d24fb3b0492d5c377246fc69.zip
Make possible to calculate path to root
Diffstat (limited to 'core/src/main/kotlin/Generation')
-rw-r--r--core/src/main/kotlin/Generation/FileGenerator.kt2
-rw-r--r--core/src/main/kotlin/Generation/Generator.kt3
2 files changed, 5 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Generation/FileGenerator.kt b/core/src/main/kotlin/Generation/FileGenerator.kt
index 3193a5bc..9c7c65e6 100644
--- a/core/src/main/kotlin/Generation/FileGenerator.kt
+++ b/core/src/main/kotlin/Generation/FileGenerator.kt
@@ -14,6 +14,8 @@ class FileGenerator @Inject constructor(@Named("outputDir") val rootFile: File)
@set:Inject(optional = true) lateinit var options: DocumentationOptions
@set:Inject(optional = true) var packageListService: PackageListService? = null
+ override val root: File = rootFile
+
override fun location(node: DocumentationNode): FileLocation {
return FileLocation(File(rootFile, relativePathToNode(node.path.map { it.name }, node.members.any())).appendExtension(formatService.extension))
}
diff --git a/core/src/main/kotlin/Generation/Generator.kt b/core/src/main/kotlin/Generation/Generator.kt
index 003386ef..23286e29 100644
--- a/core/src/main/kotlin/Generation/Generator.kt
+++ b/core/src/main/kotlin/Generation/Generator.kt
@@ -1,5 +1,7 @@
package org.jetbrains.dokka
+import java.io.File
+
interface Generator {
fun buildPages(nodes: Iterable<DocumentationNode>)
fun buildOutlines(nodes: Iterable<DocumentationNode>)
@@ -23,4 +25,5 @@ fun Generator.buildAll(node: DocumentationNode): Unit = buildAll(listOf(node))
interface NodeLocationAwareGenerator: Generator {
fun location(node: DocumentationNode): Location
+ val root: File
} \ No newline at end of file