From a39c7a161282d132d08bcf89eed0213374a574e9 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 23 Feb 2017 15:21:03 +0100 Subject: Allow specifying implicit platforms for each source root --- core/src/main/kotlin/DokkaBootstrapImpl.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/src/main/kotlin/DokkaBootstrapImpl.kt') diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index eb2b2a65..59139263 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -10,6 +10,11 @@ fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinition { urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#" + it }) } +fun parseSourceRoot(sourceRoot: String): SourceRoot { + val components = sourceRoot.split("::", limit = 2) + return SourceRoot(components.first(), components.getOrNull(1)?.split(',').orEmpty()) +} + class DokkaBootstrapImpl : DokkaBootstrap { class DokkaProxyLogger(val consumer: BiConsumer) : DokkaLogger { @@ -46,7 +51,7 @@ class DokkaBootstrapImpl : DokkaBootstrap { generator = DokkaGenerator( DokkaProxyLogger(logger), classpath, - sources, + sources.map(::parseSourceRoot), samples, includes, moduleName, -- cgit