aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Bonnin <martin@mbonnin.net>2020-01-27 12:22:17 +0100
committerKamil Doległo <kamilok1965@users.noreply.github.com>2020-01-29 15:28:41 +0100
commit4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb (patch)
tree1e55df2dcc7cc157cbfdbe8d7df6757db46ca59e
parent56a48495210732fc08f67bc70b9d33946775168b (diff)
downloaddokka-4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb.tar.gz
dokka-4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb.tar.bz2
dokka-4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb.zip
Remove stack overflow error
See https://github.com/Kotlin/dokka/issues/512#issuecomment-539737596
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt13
1 files changed, 1 insertions, 12 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 c5863318..bafe657e 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
@@ -84,20 +84,9 @@ 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?, level: Int = 0): Set<File> {
- val maxRetries = 10
- return try {
- configuration!!.resolve()
- } catch (e: Exception) {
- 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
- }
- }
-
private fun loadFatJar() {
if (ClassloaderContainer.fatJarClassLoader == null) {
- val jars = tryResolveFatJar(dokkaRuntime).toList()
+ val jars = dokkaRuntime!!.resolve().toList()
ClassloaderContainer.fatJarClassLoader = URLClassLoader(jars.map { it.toURI().toURL() }.toTypedArray(), ClassLoader.getSystemClassLoader().parent)
}
}