From b2b3e0b9e0a16cabf99857e2f82b8205f740a5f3 Mon Sep 17 00:00:00 2001 From: "Vladislav.Soroka" Date: Tue, 24 Nov 2015 13:52:36 +0300 Subject: [PATCH] gradle: do not fail if there is an unresolved dependency a configuration has --- .../util/DependencyResolverImpl.groovy | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy index 7973570a5b89..2391b87cc037 100644 --- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy +++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy @@ -128,15 +128,16 @@ class DependencyResolverImpl implements DependencyResolver { componentResults.each { componentResultsMap.put(it.id, it) } ResolutionResult resolutionResult = configuration.incoming.resolutionResult - def fileDeps = new LinkedHashSet(configuration.incoming.files.files); - artifactMap - artifactMap.values().each { - fileDeps.remove(it.file) - } - fileDeps.each { - def fileCollectionDependency = new DefaultFileCollectionDependency([it]) - fileCollectionDependency.scope = scope - result.add(fileCollectionDependency) + if(!configuration.resolvedConfiguration.hasError()) { + def fileDeps = new LinkedHashSet(configuration.incoming.files.files); + artifactMap.values().each { + fileDeps.remove(it.file) + } + fileDeps.each { + def fileCollectionDependency = new DefaultFileCollectionDependency([it]) + fileCollectionDependency.scope = scope + result.add(fileCollectionDependency) + } } result.addAll(transform(Lists.newArrayList(), resolutionResult.root.dependencies, artifactMap, componentResultsMap, scope)) }