From a88cd9d682866df1f379447ea07928463ee0f696 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 23 Nov 2017 18:55:33 +0300 Subject: Don't require JavaPluginConvention --- runners/gradle-plugin/src/main/kotlin/main.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'runners/gradle-plugin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 3269395d..623a627c 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -307,9 +307,7 @@ open class DokkaTask : DefaultTask() { val allConfigurations = project.configurations val fromConfigurations = - processConfigurations.map { - allConfigurations?.getByName(it.toString()) ?: throw IllegalArgumentException("No configuration $it found") - }.flatten() + processConfigurations.flatMap { allConfigurations.getByName(it.toString()) } return fromConfigurations } @@ -319,10 +317,11 @@ open class DokkaTask : DefaultTask() { logger.info("Dokka: Taking source directories provided by the user") sourceDirs.toSet() } else if (kotlinTasks.isEmpty()) { - logger.info("Dokka: Taking source directories from default java plugin") - val javaPluginConvention = project.convention.getPlugin(JavaPluginConvention::class.java) - val sourceSets = javaPluginConvention.sourceSets?.findByName(SourceSet.MAIN_SOURCE_SET_NAME) - sourceSets?.allSource?.srcDirs + project.convention.findPlugin(JavaPluginConvention::class.java)?.let { javaPluginConvention -> + logger.info("Dokka: Taking source directories from default java plugin") + val sourceSets = javaPluginConvention.sourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME) + sourceSets?.allSource?.srcDirs + } } else { emptySet() } -- cgit