diff options
author | Martin Bonnin <martin@mbonnin.net> | 2020-01-27 12:22:17 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@users.noreply.github.com> | 2020-01-29 15:28:41 +0100 |
commit | 4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb (patch) | |
tree | 1e55df2dcc7cc157cbfdbe8d7df6757db46ca59e /runners/gradle-plugin/src | |
parent | 56a48495210732fc08f67bc70b9d33946775168b (diff) | |
download | dokka-4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb.tar.gz dokka-4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb.tar.bz2 dokka-4e4f28f6d3fe08ef60fdac26e512ac6fd16ff5bb.zip |
Remove stack overflow error
See https://github.com/Kotlin/dokka/issues/512#issuecomment-539737596
Diffstat (limited to 'runners/gradle-plugin/src')
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 13 |
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) } } |