diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-11-28 14:54:47 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-11-28 14:54:47 +0100 |
commit | 00f92bd73bfd8cb1e6da40e0bafe43db3f443e5e (patch) | |
tree | 414a282b8484c309ba745613316748e0f457945f /runners/gradle-plugin/src/main/kotlin/org/jetbrains | |
parent | e8eff3e7fd1b51722dca3bab82a59c1ec73e7d8d (diff) | |
download | dokka-00f92bd73bfd8cb1e6da40e0bafe43db3f443e5e.tar.gz dokka-00f92bd73bfd8cb1e6da40e0bafe43db3f443e5e.tar.bz2 dokka-00f92bd73bfd8cb1e6da40e0bafe43db3f443e5e.zip |
Add better error message when fatjar cannot be resolved
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin/org/jetbrains')
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 7 |
1 files changed, 5 insertions, 2 deletions
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 0412b8a7..16f6c83e 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 @@ -86,11 +86,14 @@ open class DokkaTask : DefaultTask() { private var outputDiagnosticInfo: Boolean = false // Workaround for Gradle, which fires some methods (like collectConfigurations()) multiple times in its lifecycle - private fun tryResolveFatJar(configuration: Configuration?): Set<File> { + private fun tryResolveFatJar(configuration: Configuration?, level: Int = 0): Set<File> { + val maxRetries = 10 return try { configuration!!.resolve() } catch (e: Exception) { - project.parent?.let { tryResolveFatJar(configuration) } ?: throw e + if (level >= maxRetries) + throw IllegalStateException("Cannot resolve dokka fatjar! Make sure you have jcenter() in your repositories") + project.parent?.let { tryResolveFatJar(configuration, level + 1) } ?: throw e } } |