aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/javadoc/dokka-adapters.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/javadoc/dokka-adapters.kt')
-rw-r--r--core/src/main/kotlin/javadoc/dokka-adapters.kt30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/src/main/kotlin/javadoc/dokka-adapters.kt b/core/src/main/kotlin/javadoc/dokka-adapters.kt
new file mode 100644
index 00000000..23ee1702
--- /dev/null
+++ b/core/src/main/kotlin/javadoc/dokka-adapters.kt
@@ -0,0 +1,30 @@
+package org.jetbrains.dokka.javadoc
+
+import com.google.inject.Inject
+import com.sun.tools.doclets.formats.html.HtmlDoclet
+import org.jetbrains.dokka.*
+import org.jetbrains.dokka.Formats.FormatDescriptor
+
+class JavadocGenerator @Inject constructor (val options: DocumentationOptions, val logger: DokkaLogger) : Generator {
+ override fun buildPages(nodes: Iterable<DocumentationNode>) {
+ val module = nodes.single() as DocumentationModule
+
+ DokkaConsoleLogger.report()
+ HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter(logger), options.outputDir))
+ }
+
+ override fun buildOutlines(nodes: Iterable<DocumentationNode>) {
+ // no outline could be generated separately
+ }
+
+ override fun buildSupportFiles() {
+ }
+}
+
+class JavadocFormatDescriptor : FormatDescriptor {
+ override val formatServiceClass = null
+ override val outlineServiceClass = null
+ override val generatorServiceClass = JavadocGenerator::class
+ override val packageDocumentationBuilderClass = KotlinAsJavaDocumentationBuilder::class
+ override val javaDocumentationBuilderClass = JavaPsiDocumentationBuilder::class
+}