From f10f4d3a83eaac1786181ff134c1c3f06bc4cad4 Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Thu, 10 Dec 2020 17:40:37 -0500 Subject: [PATCH] Refined library dependency search --- build.gradle | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index b5539e3409..bbe7667495 100644 --- a/build.gradle +++ b/build.gradle @@ -304,15 +304,33 @@ List getExternalRuntimeDependencies(Project project) { List getExternalDependencies(Configuration configuration) { List list = new ArrayList<>(); configuration.dependencies.each { dep -> - + // if the dependency is an external jar if (dep instanceof ExternalDependency) { + String name = dep.getName() + Set classifiers = dep.artifacts.classifier + String group = dep.getGroup() + String version = dep.getVersion() + String searchString = name + + if (version != null) { + searchString = name+"-"+version; + } + + if (!classifiers.empty) { + String cls = classifiers.first() + if (cls != null) { + searchString+= "-$cls" + } + } // loop back through all the dependency files, looking for one that contains the dependency name. String depPath = configuration.find { - it.name.contains(dep.name) + it.name.contains(searchString) + } + if (depPath == null) { + println("****************DID NOT FIND DEPENDENCY: name = "+name+" version = "+version) } - // if we found the path, then add it to the list if (depPath) { list.add(depPath)