aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-23 18:55:33 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-23 18:55:33 +0300
commita88cd9d682866df1f379447ea07928463ee0f696 (patch)
treee7d5147e53e6e548b20ddb0bde2a9114a72470f6 /runners/gradle-plugin/src/main
parent9733b4be121ae2cf21af99d63be4cdd7f87d1b2f (diff)
downloaddokka-a88cd9d682866df1f379447ea07928463ee0f696.tar.gz
dokka-a88cd9d682866df1f379447ea07928463ee0f696.tar.bz2
dokka-a88cd9d682866df1f379447ea07928463ee0f696.zip
Don't require JavaPluginConvention
Diffstat (limited to 'runners/gradle-plugin/src/main')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/main.kt13
1 files changed, 6 insertions, 7 deletions
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()
}