diff options
| author | Kamil Doległo <kamilok1965@interia.pl> | 2020-05-20 12:05:26 +0200 |
|---|---|---|
| committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-06-15 13:15:30 +0200 |
| commit | f3baf10b4c882230d382bfcdd94163d070bd0e25 (patch) | |
| tree | 128b63b10f05242cfce88da6714d9e04987b5651 | |
| parent | 645e02fb42bbf1cd3ee2773a014ea1e553e09229 (diff) | |
| download | dokka-f3baf10b4c882230d382bfcdd94163d070bd0e25.tar.gz dokka-f3baf10b4c882230d382bfcdd94163d070bd0e25.tar.bz2 dokka-f3baf10b4c882230d382bfcdd94163d070bd0e25.zip | |
Rework dokka configuration and Gradle plugin
35 files changed, 319 insertions, 534 deletions
diff --git a/.idea/compiler.xml b/.idea/compiler.xml index dd174dd7..a6b0adf4 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -12,148 +12,12 @@ <entry name="!?*.clj" /> </wildcardResourcePatterns> <bytecodeTargetLevel target="1.8"> - <module name="android-gradle-plugin_main" target="1.8" /> - <module name="android-gradle-plugin_test" target="1.8" /> - <module name="ant_main" target="1.8" /> - <module name="ant_test" target="1.8" /> - <module name="base.dokka.plugins.base.main" target="1.8" /> - <module name="base.dokka.plugins.base.test" target="1.8" /> - <module name="blazejkardys.Workspace.dokka.buildSrc.main" target="1.8" /> - <module name="blazejkardys.Workspace.dokka.buildSrc.test" target="1.8" /> - <module name="buildSrc_main" target="1.8" /> - <module name="buildSrc_test" target="1.8" /> - <module name="cli.dokka.runners.cli.main" target="1.8" /> - <module name="cli.dokka.runners.cli.test" target="1.8" /> - <module name="cli_main" target="1.8" /> - <module name="cli_test" target="1.8" /> - <module name="core_main" target="1.8" /> - <module name="core_test" target="1.8" /> - <module name="dokka.core.search-component.main" target="1.8" /> - <module name="dokka.core.search-component.test" target="1.8" /> - <module name="dokka.core.testApi.main" target="1.8" /> - <module name="dokka.core.testApi.test" target="1.8" /> - <module name="dokka.integration.main" target="1.8" /> - <module name="dokka.integration.test" target="1.8" /> - <module name="dokka.plugins.base.search-component.main" target="1.8" /> - <module name="dokka.plugins.base.search-component.test" target="1.8" /> - <module name="dokka.plugins.javadoc8.main" target="1.8" /> - <module name="dokka.plugins.javadoc8.test" target="1.8" /> - <module name="dokka.plugins.ma.main" target="1.8" /> - <module name="dokka.plugins.ma.test" target="1.8" /> - <module name="dokka.plugins.xml.main" target="1.8" /> - <module name="dokka.plugins.xml.test" target="1.8" /> - <module name="dokka.runners.android-gradle-plugin.main" target="1.8" /> - <module name="dokka.runners.android-gradle-plugin.test" target="1.8" /> - <module name="dokka.runners.ant.main" target="1.8" /> - <module name="dokka.runners.ant.test" target="1.8" /> - <module name="dokka.runners.fatjar.main" target="1.8" /> - <module name="dokka.runners.fatjar.test" target="1.8" /> - <module name="dokka.runners.gradle-integration-tests.main" target="1.8" /> - <module name="dokka.runners.gradle-integration-tests.test" target="1.8" /> - <module name="fatjar_main" target="1.8" /> - <module name="fatjar_test" target="1.8" /> - <module name="gradle-integration-tests.dokka.integration-tests.gradle-integration-tests.main" target="1.8" /> - <module name="gradle-integration-tests.dokka.integration-tests.gradle-integration-tests.test" target="1.8" /> - <module name="gradle-integration-tests.org.jetbrains.dokka.gradle-integration-tests.main" target="1.8" /> - <module name="gradle-integration-tests.org.jetbrains.dokka.gradle-integration-tests.test" target="1.8" /> - <module name="gradle-integration-tests_main" target="1.8" /> - <module name="gradle-integration-tests_test" target="1.8" /> - <module name="gradle-plugin.dokka.runners.gradle-plugin.main" target="1.8" /> - <module name="gradle-plugin.dokka.runners.gradle-plugin.test" target="1.8" /> - <module name="gradle-plugin_main" target="1.8" /> - <module name="gradle-plugin_test" target="1.8" /> - <module name="integration_main" target="1.8" /> - <module name="integration_test" target="1.8" /> - <module name="kotlin-as-java.dokka.plugins.kotlin-as-java.main" target="1.8" /> - <module name="kotlin-as-java.dokka.plugins.kotlin-as-java.test" target="1.8" /> - <module name="mathjax.dokka.plugins.mathjax.main" target="1.8" /> - <module name="mathjax.dokka.plugins.mathjax.test" target="1.8" /> - <module name="maven-plugin.dokka.runners.maven-plugin.main" target="1.8" /> - <module name="maven-plugin.dokka.runners.maven-plugin.test" target="1.8" /> - <module name="maven-plugin_main" target="1.8" /> - <module name="maven-plugin_test" target="1.8" /> - <module name="org.jetbrains.dokka.android-gradle-plugin.main" target="1.8" /> - <module name="org.jetbrains.dokka.android-gradle-plugin.test" target="1.8" /> - <module name="org.jetbrains.dokka.ant.main" target="1.8" /> - <module name="org.jetbrains.dokka.ant.test" target="1.8" /> - <module name="org.jetbrains.dokka.buildSrc.main" target="1.8" /> - <module name="org.jetbrains.dokka.buildSrc.test" target="1.8" /> - <module name="org.jetbrains.dokka.cli.main" target="1.8" /> - <module name="org.jetbrains.dokka.cli.test" target="1.8" /> - <module name="org.jetbrains.dokka.core.main" target="1.8" /> - <module name="org.jetbrains.dokka.core.test" target="1.8" /> - <module name="org.jetbrains.dokka.coreDependencies.main" target="1.8" /> - <module name="org.jetbrains.dokka.coreDependencies.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.core.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.core.search-component.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.core.search-component.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.core.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.coreDependencies.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.coreDependencies.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.integration-tests.gradle-integration-tests.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.integration-tests.gradle-integration-tests.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.integration-tests.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.integration-tests.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.base.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.base.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.gfm.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.gfm.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.jekyll.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.jekyll.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.kotlin-as-java.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.kotlin-as-java.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.mathjax.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.mathjax.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.plugins.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.cli.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.cli.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.gradle-plugin.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.gradle-plugin.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.maven-plugin.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.maven-plugin.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.runners.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.search-component.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.search-component.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.test-tools.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.test-tools.test" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.testApi.main" target="1.8" /> - <module name="org.jetbrains.dokka.dokka.testApi.test" target="1.8" /> - <module name="org.jetbrains.dokka.fatjar.main" target="1.8" /> - <module name="org.jetbrains.dokka.fatjar.test" target="1.8" /> - <module name="org.jetbrains.dokka.gradle-integration-tests.main" target="1.8" /> - <module name="org.jetbrains.dokka.gradle-integration-tests.test" target="1.8" /> - <module name="org.jetbrains.dokka.gradle-plugin.main" target="1.8" /> - <module name="org.jetbrains.dokka.gradle-plugin.test" target="1.8" /> - <module name="org.jetbrains.dokka.integration.main" target="1.8" /> - <module name="org.jetbrains.dokka.integration.test" target="1.8" /> - <module name="org.jetbrains.dokka.javadoc8.main" target="1.8" /> - <module name="org.jetbrains.dokka.javadoc8.test" target="1.8" /> - <module name="org.jetbrains.dokka.mathjax.main" target="1.8" /> - <module name="org.jetbrains.dokka.mathjax.test" target="1.8" /> - <module name="org.jetbrains.dokka.maven-plugin.main" target="1.8" /> - <module name="org.jetbrains.dokka.maven-plugin.test" target="1.8" /> - <module name="org.jetbrains.dokka.plugins.main" target="1.8" /> - <module name="org.jetbrains.dokka.plugins.test" target="1.8" /> - <module name="org.jetbrains.dokka.testApi.main" target="1.8" /> - <module name="org.jetbrains.dokka.testApi.test" target="1.8" /> - <module name="org.jetbrains.dokka.xml.main" target="1.8" /> - <module name="org.jetbrains.dokka.xml.test" target="1.8" /> - <module name="Workspace.dokka.buildSrc.main" target="1.8" /> - <module name="Workspace.dokka.buildSrc.test" target="1.8" /> - <module name="Workspace.dokka.core.main" target="1.8" /> - <module name="Workspace.dokka.core.test" target="1.8" /> - <module name="Workspace.dokka.coreDependencies.main" target="1.8" /> - <module name="Workspace.dokka.coreDependencies.test" target="1.8" /> - <module name="Workspace.dokka.integration-tests.main" target="1.8" /> - <module name="Workspace.dokka.integration-tests.test" target="1.8" /> - <module name="Workspace.dokka.plugins.main" target="1.8" /> - <module name="Workspace.dokka.plugins.test" target="1.8" /> - <module name="Workspace.dokka.runners.main" target="1.8" /> - <module name="Workspace.dokka.runners.test" target="1.8" /> - <module name="Workspace.dokka.testApi.main" target="1.8" /> - <module name="Workspace.dokka.testApi.test" target="1.8" /> + <module name="dokka" target="12" /> + <module name="dokka.buildSrc" target="12" /> + <module name="dokka.buildSrc.main" target="12" /> + <module name="dokka.buildSrc.test" target="12" /> + <module name="dokka.main" target="12" /> + <module name="dokka.test" target="12" /> </bytecodeTargetLevel> </component> </project>
\ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 0b3c0da8..c94faa77 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("jvm") apply false id("com.jfrog.bintray") apply false + id("java") } val dokka_version: String by project @@ -39,6 +40,12 @@ allprojects { subprojects { apply { plugin("org.jetbrains.kotlin.jvm") + plugin("java") + } + + // Gradle metadata + java { + targetCompatibility = JavaVersion.VERSION_1_8 } } diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index 61fb7324..c8a892d7 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -5,7 +5,6 @@ import org.jetbrains.dokka.analysis.DokkaResolutionFacade import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.model.SourceSetCache import org.jetbrains.dokka.model.SourceSetData -import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin @@ -81,7 +80,7 @@ class DokkaGenerator( sourceSetsCache: SourceSetCache ): Map<SourceSetData, EnvironmentAndFacade> = configuration.passesConfigurations.map { - sourceSetsCache.getSourceSet(it) to createEnvironmentAndFacade(it) + sourceSetsCache.getSourceSet(it) to createEnvironmentAndFacade(configuration, it) }.toMap() fun initializePlugins( @@ -139,14 +138,21 @@ class DokkaGenerator( renderer.render(transformedPages) } - private fun createEnvironmentAndFacade(pass: DokkaConfiguration.PassConfiguration): EnvironmentAndFacade = + private fun createEnvironmentAndFacade( + configuration: DokkaConfiguration, + pass: DokkaConfiguration.PassConfiguration + ): EnvironmentAndFacade = AnalysisEnvironment(DokkaMessageCollector(logger), pass.analysisPlatform).run { if (analysisPlatform == Platform.jvm) { addClasspath(PathUtil.getJdkClassesRootsFromCurrentJre()) } pass.classpath.forEach { addClasspath(File(it)) } - addSources((pass.sourceRoots + pass.dependentSourceRoots).map { it.path }) + addSources( + (pass.sourceRoots + configuration.passesConfigurations.filter { it.sourceSetID in pass.dependentSourceSets } + .flatMap { it.sourceRoots }) + .map { it.path } + ) loadLanguageVersionSettings(pass.languageVersion, pass.apiVersion) diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt index 0b59f301..fab7af37 100644 --- a/core/src/main/kotlin/configuration.kt +++ b/core/src/main/kotlin/configuration.kt @@ -27,20 +27,19 @@ enum class Platform(val key: String) { interface DokkaConfiguration { val outputDir: String val format: String - val generateIndexPages: Boolean val cacheRoot: String? + val offlineMode: Boolean val passesConfigurations: List<PassConfiguration> val modules: List<DokkaModuleDescription> - val impliedPlatforms: List<String> val pluginsClasspath: List<File> val pluginsConfiguration: Map<String, String> interface PassConfiguration { val moduleName: String - val sourceSetName: String + val displayName: String + val sourceSetID: String val classpath: List<String> val sourceRoots: List<SourceRoot> - val dependentSourceRoots: List<SourceRoot> val dependentSourceSets: List<String> val samples: List<String> val includes: List<String> @@ -58,10 +57,7 @@ interface DokkaConfiguration { val noStdlibLink: Boolean val noJdkLink: Boolean val suppressedFiles: List<String> - val collectInheritedExtensionsFromLibraries: Boolean val analysisPlatform: Platform - val targets: List<String> - val sinceKotlin: String? } interface SourceRoot { diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index 7aaa1c89..23cf7e2d 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -6,21 +6,20 @@ import java.net.URL data class DokkaConfigurationImpl( override val outputDir: String, override val format: String, - override val generateIndexPages: Boolean, override val cacheRoot: String?, - override val impliedPlatforms: List<String>, + override val offlineMode: Boolean, override val passesConfigurations: List<PassConfigurationImpl>, override val pluginsClasspath: List<File>, override val pluginsConfiguration: Map<String, String>, override val modules: List<DokkaModuleDescriptionImpl> ) : DokkaConfiguration -data class PassConfigurationImpl ( +data class PassConfigurationImpl( override val moduleName: String, - override val sourceSetName: String, + override val displayName: String, + override val sourceSetID: String, override val classpath: List<String>, override val sourceRoots: List<SourceRootImpl>, - override val dependentSourceRoots: List<SourceRootImpl>, override val dependentSourceSets: List<String>, override val samples: List<String>, override val includes: List<String>, @@ -38,10 +37,7 @@ data class PassConfigurationImpl ( override val noStdlibLink: Boolean, override val noJdkLink: Boolean, override val suppressedFiles: List<String>, - override val collectInheritedExtensionsFromLibraries: Boolean, - override val analysisPlatform: Platform, - override val targets: List<String>, - override val sinceKotlin: String? + override val analysisPlatform: Platform ) : DokkaConfiguration.PassConfiguration data class DokkaModuleDescriptionImpl( diff --git a/core/src/main/kotlin/model/SourceSetData.kt b/core/src/main/kotlin/model/SourceSetData.kt index 964d5ca9..7d118470 100644 --- a/core/src/main/kotlin/model/SourceSetData.kt +++ b/core/src/main/kotlin/model/SourceSetData.kt @@ -6,22 +6,33 @@ import org.jetbrains.dokka.plugability.DokkaContext data class SourceSetData( val moduleName: String, - val sourceSetName: String, + val sourceSetID: String, + val displayName: String, val platform: Platform, val sourceRoots: List<DokkaConfiguration.SourceRoot> = emptyList(), - val dependentSourceSets: List<String> = emptyList() + val dependentSourceSets: List<String> = emptyList() ) class SourceSetCache { private val sourceSets = HashMap<String, SourceSetData>() val allSourceSets: List<SourceSetData> - get() = sourceSets.values.toList() + get() = sourceSets.values.toList() fun getSourceSet(pass: DokkaConfiguration.PassConfiguration) = - sourceSets.getOrPut("${pass.moduleName}/${pass.sourceSetName}", - { SourceSetData(pass.moduleName, pass.sourceSetName, pass.analysisPlatform, pass.sourceRoots, pass.dependentSourceSets) } + sourceSets.getOrPut("${pass.moduleName}/${pass.sourceSetID}", + { + SourceSetData( + pass.moduleName, + pass.sourceSetID, + pass.displayName, + pass.analysisPlatform, + pass.sourceRoots, + pass.dependentSourceSets + ) + } ) } -fun DokkaContext.sourceSet(pass: DokkaConfiguration.PassConfiguration) : SourceSetData = sourceSetCache.getSourceSet(pass)
\ No newline at end of file +fun DokkaContext.sourceSet(pass: DokkaConfiguration.PassConfiguration): SourceSetData = + sourceSetCache.getSourceSet(pass)
\ No newline at end of file diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 42273d20..528b7d16 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -22,7 +22,7 @@ open class HtmlRenderer( private val sourceSetDependencyMap = with(context.sourceSetCache) { allSourceSets.map { sourceSet -> - sourceSet to allSourceSets.filter { sourceSet.dependentSourceSets.contains(it.sourceSetName) } + sourceSet to allSourceSets.filter { sourceSet.dependentSourceSets.contains(it.sourceSetID ) } }.toMap() } @@ -93,14 +93,14 @@ open class HtmlRenderer( group.sourceSets.forEach { button(classes = "platform-tag platform-selector") { attributes["data-active"] = "" - attributes["data-filter"] = it.sourceSetName - when (it.platform.key) { + attributes["data-filter"] = it.sourceSetID + when(it.platform.key) { "common" -> classes = classes + "common-like" "native" -> classes = classes + "native-like" "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - text(it.sourceSetName) + text(it.displayName) } } } @@ -161,10 +161,10 @@ open class HtmlRenderer( attributes["data-toggle-list"] = "data-toggle-list" contents.forEachIndexed { index, pair -> button(classes = "platform-bookmark") { - attributes["data-filterable-current"] = pair.first.sourceSetName - attributes["data-filterable-set"] = pair.first.sourceSetName + attributes["data-filterable-current"] = pair.first.sourceSetID + attributes["data-filterable-set"] = pair.first.sourceSetID if (index == 0) attributes["data-active"] = "" - attributes["data-toggle"] = pair.first.sourceSetName + attributes["data-toggle"] = pair.first.sourceSetID when ( pair.first.platform.key ) { @@ -173,8 +173,8 @@ open class HtmlRenderer( "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - attributes["data-toggle"] = pair.first.sourceSetName - text(pair.first.sourceSetName) + attributes["data-toggle"] = pair.first.sourceSetID + text(pair.first.displayName) } } } @@ -242,10 +242,10 @@ open class HtmlRenderer( consumer.onTagContentUnsafe { +createHTML().div("divergent-group") { attributes["data-filterable-current"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetName + it.sourceSetID } attributes["data-filterable-set"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetName + it.sourceSetID } val divergentForPlatformDependent = groupedDivergent.map { (sourceSet, elements) -> @@ -346,12 +346,13 @@ open class HtmlRenderer( div(classes = "table-row") { if (!style.contains(MultimoduleTable)) { attributes["data-filterable-current"] = node.sourceSets.joinToString(" ") { - it.sourceSetName + it.sourceSetID } attributes["data-filterable-set"] = node.sourceSets.joinToString(" ") { - it.sourceSetName + it.sourceSetID } } + it.filterIsInstance<ContentLink>().takeIf { it.isNotEmpty() }?.let { div("main-subrow " + node.style.joinToString(" ")) { it.filter { sourceSetRestriction == null || it.sourceSets.any { s -> s in sourceSetRestriction } } @@ -396,7 +397,7 @@ open class HtmlRenderer( "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - text(it.sourceSetName) + text(it.displayName) } } } diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt index f10c85d5..cdb30555 100644 --- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt @@ -87,7 +87,7 @@ object StyleAndScriptsAppender : PageTransformer { class SourcesetDependencyAppender(val context: DokkaContext) : PageTransformer{ override fun invoke(input: RootPageNode): RootPageNode { val dependenciesMap = context.configuration.passesConfigurations.map { - it.sourceSetName to it.dependentSourceSets + it.sourceSetID to it.dependentSourceSets }.toMap() fun createDependenciesJson() : String = "sourceset_dependencies = '{${ dependenciesMap.entries.joinToString(", ") { diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index 322f4927..a9e58f17 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -98,26 +98,19 @@ open class DefaultLocationProvider( if (info == null) { toResolve.getOrPut(jdk) { mutableListOf() }.add(link) } else if (info.packages.contains(dri.packageName)) { - return link.url.toExternalForm() + getLink( - dri, - info - ) + return link.url.toExternalForm() + getLink(dri, info) } } } // Not in cache, resolve packageLists for ((jdk, links) in toResolve) { for (link in links) { + if(dokkaContext.configuration.offlineMode && link.packageListUrl.protocol.toLowerCase() != "file") + continue val locationInfo = - loadPackageList( - jdk, - link.packageListUrl - ) + loadPackageList(jdk, link.packageListUrl) if (locationInfo.packages.contains(dri.packageName)) { - return link.url.toExternalForm() + getLink( - dri, - locationInfo - ) + return link.url.toExternalForm() + getLink(dri, locationInfo) } } toResolve.remove(jdk) diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt index 04b2636c..2aab6018 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt @@ -53,7 +53,7 @@ internal class ModuleAndPackageDocumentationTransformer(val context: DokkaContex module.sourceSets.mapNotNull { pd -> val doc = modulesAndPackagesDocumentation[Pair(module.name, pd)] val facade = context.platforms[pd]?.facade - ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetName}") } + ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetID}") } try { doc?.get("Module")?.get(module.name)?.run { pd to MarkdownParser( |
