diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/build.gradle | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrapImpl.kt | 55 | ||||
-rw-r--r-- | core/src/main/kotlin/Utilities/DokkaLogging.kt | 6 |
3 files changed, 56 insertions, 7 deletions
diff --git a/core/build.gradle b/core/build.gradle index 72eb6baf..08be76c0 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -47,7 +47,7 @@ dependencies { //tools.jar provided files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs().findAll { it.path.endsWith("jar") }) - + compile project(":integration") testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version 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 |