From afb2bdcf15634390631b56d2159311923bb6461f Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Wed, 12 Jun 2019 12:53:17 +0200 Subject: Fix for ArtifactResolveException bug in Gradle for Android --- .../org/jetbrains/dokka/gradle/ConfigurationExtractor.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka') diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt index 583d352a..0dc5bed1 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt @@ -4,6 +4,7 @@ import org.gradle.api.NamedDomainObjectCollection import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.UnknownDomainObjectException +import org.gradle.api.artifacts.ResolveException import org.gradle.api.file.FileCollection import org.gradle.api.plugins.JavaPluginConvention import org.gradle.api.tasks.SourceSet @@ -88,10 +89,14 @@ object ConfigurationExtractor { allSourceRoots += taskSourceRoots.filter { it.exists() } } } + val classpath: MutableList = try { + allClasspathFileCollection.toMutableList() + } catch (e: ResolveException) { + mutableListOf() + } + classpath.addAll (project.files(allClasspath).toList()) - return PlatformData(null, - (allClasspathFileCollection + project.files(allClasspath)).toList(), allSourceRoots.toList(), "" - ) + return PlatformData(null, classpath, allSourceRoots.toList(), "") } fun extractFromJavaPlugin(project: Project): PlatformData? = -- cgit