From ccabecec3a476330c799a6c7d591f9d0996de647 Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Fri, 20 Dec 2019 15:02:40 -0500 Subject: [PATCH] Revert "Improving how we discover external dependencies in gradle." This reverts commit e550f9b656b86826e75f7cd8f1fc6d062dec40a0. --- build.gradle | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index ce2b50091a..b48e92eead 100644 --- a/build.gradle +++ b/build.gradle @@ -296,16 +296,22 @@ List getExternalDependencies(Project project) { // for each dependency in the compile configuration Configuration runtimeConfig = project.configurations.runtime + runtimeConfig.allDependencies.each { dep -> - runtimeConfig.resolvedConfiguration.getFiles { dep -> - dep.class.toString().contains("DefaultExternalModuleDependency") - }.each { f -> - // if we found the path, then add it to the list - if (!f.getAbsolutePath().contains("libsForBuild")) { - list.add(f) - } - } + // if the dependency is an external jar + if (dep.class.toString().contains("DefaultExternalModuleDependency")) { + // loop back through all the dependency files, looking for one that contains the dependency name. + String depPath = runtimeConfig.find { + it.name.contains(dep.name) + } + + // if we found the path, then add it to the list + if (depPath && !depPath.contains("libsForBuild")) { + list.add(depPath) + } + } + } return list }