From 4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Mon, 27 Jan 2020 12:22:17 +0100 Subject: Remove stack overflow error See https://github.com/Kotlin/dokka/issues/512#issuecomment-539737596 --- .../src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 13 +------------ 1 file changed, 1 insertion(+), 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 { - 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) } } -- cgit