aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-12-02 23:46:16 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-12-02 23:46:16 +0300
commit13bda7371cc60beaa4cc8302239efd21695b9e1f (patch)
tree1673a8ff05e3398a9826af09ece88f05fd4c56ae /core/src/main/kotlin
parent039bb97123fd8a74b9954598d7a102e235fd108d (diff)
downloaddokka-13bda7371cc60beaa4cc8302239efd21695b9e1f.tar.gz
dokka-13bda7371cc60beaa4cc8302239efd21695b9e1f.tar.bz2
dokka-13bda7371cc60beaa4cc8302239efd21695b9e1f.zip
Now dokka-fatjar complete isolated from poisonous Gradle environment
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/DokkaBootstrapImpl.kt55
-rw-r--r--core/src/main/kotlin/Utilities/DokkaLogging.kt6
2 files changed, 55 insertions, 6 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt
new file mode 100644
index 00000000..cbec4985
--- /dev/null
+++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt
@@ -0,0 +1,55 @@
+package org.jetbrains.dokka
+
+import java.io.File
+
+fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinition {
+ val (path, urlAndLine) = srcLink.split('=')
+ return SourceLinkDefinition(File(path).absolutePath,
+ urlAndLine.substringBefore("#"),
+ urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#" + it })
+}
+
+
+class DokkaBootstrapImpl : DokkaBootstrap {
+
+ lateinit var generator: DokkaGenerator
+
+ override fun configure(logger: DokkaLogger,
+ moduleName: String,
+ classpath: List<String>,
+ sources: List<String>,
+ samples: List<String>,
+ includes: List<String>,
+ outputDir: String,
+ format: String,
+ includeNonPublic: Boolean,
+ reportUndocumented: Boolean,
+ skipEmptyPackages: Boolean,
+ skipDeprecated: Boolean,
+ jdkVersion: Int,
+ generateIndexPages: Boolean,
+ sourceLinks: List<String>) {
+ generator = DokkaGenerator(
+ logger,
+ classpath,
+ sources,
+ samples,
+ includes,
+ moduleName,
+ DocumentationOptions(
+ outputDir,
+ format,
+ includeNonPublic,
+ reportUndocumented,
+ skipEmptyPackages,
+ skipDeprecated,
+ jdkVersion,
+ generateIndexPages,
+ sourceLinks.map(::parseSourceLinkDefinition)
+ )
+ )
+
+ }
+
+ override fun generate() = generator.generate()
+} \ No newline at end of file
diff --git a/core/src/main/kotlin/Utilities/DokkaLogging.kt b/core/src/main/kotlin/Utilities/DokkaLogging.kt
index 1ef52837..2e0fb395 100644
--- a/core/src/main/kotlin/Utilities/DokkaLogging.kt
+++ b/core/src/main/kotlin/Utilities/DokkaLogging.kt
@@ -1,11 +1,5 @@
package org.jetbrains.dokka
-interface DokkaLogger {
- fun info(message: String)
- fun warn(message: String)
- fun error(message: String)
-}
-
object DokkaConsoleLogger : DokkaLogger {
var warningCount: Int = 0