From 86b34728b0a20b1f857233514eb5b7853e5e334d Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Fri, 23 Aug 2019 14:48:44 +0200 Subject: Fix for platforms --- .../src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'runners/gradle-plugin/src/main') diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt index 063efa24..017caeed 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt @@ -187,10 +187,10 @@ open class DokkaTask : DefaultTask() { if (multiplatform.toList().isNotEmpty()) collectFromMultiPlatform() else collectFromSinglePlatform() private fun collectFromMultiPlatform(): List { - if (disableAutoconfiguration) return multiplatform.toList() + if (disableAutoconfiguration) return multiplatform.filterNot { it.name.toLowerCase() == GLOBAL_PLATFORM_NAME }.toList() val baseConfig = mergeUserAndAutoConfigurations( - multiplatform.toList(), + multiplatform.filterNot { it.name.toLowerCase() == GLOBAL_PLATFORM_NAME }.toList(), configurationExtractor.extractFromMultiPlatform().orEmpty() ) return if (subProjects.isNotEmpty()) @@ -245,7 +245,7 @@ open class DokkaTask : DefaultTask() { if (autoConfig != null) { mergeUserConfigurationAndPlatformData(userConfig, autoConfig) } else { - if(outputDiagnosticInfo && userConfig.name.toLowerCase() != GLOBAL_PLATFORM_NAME) { + if(outputDiagnosticInfo) { logger.warn( "Could not find platform with name: ${userConfig.name} in Kotlin Gradle Plugin, " + "using only user provided configuration for this platform" @@ -275,7 +275,7 @@ open class DokkaTask : DefaultTask() { config.moduleName = project.name } if (config.targets.isEmpty() && multiplatform.isNotEmpty()){ - config.targets = listOf(config.platform.toString()) + config.targets = listOf(config.name) } config.classpath = (config.classpath as List).map { it.toString() }.distinct() // Workaround for Groovy's GStringImpl config.sourceRoots = config.sourceRoots.distinct().toMutableList() @@ -289,7 +289,6 @@ open class DokkaTask : DefaultTask() { if (config.platform != null && config.platform.toString().isNotEmpty()) { config.analysisPlatform = Platform.fromString(config.platform.toString()) } - if (globalConfig != null) { config.perPackageOptions.addAll(globalConfig.perPackageOptions) config.externalDocumentationLinks.addAll(globalConfig.externalDocumentationLinks) -- cgit