Refined library dependency search

This commit is contained in:
ghidra1 2020-12-10 17:40:37 -05:00
parent 8b054814a8
commit f10f4d3a83

View File

@ -304,15 +304,33 @@ List<String> getExternalRuntimeDependencies(Project project) {
List<String> getExternalDependencies(Configuration configuration) { List<String> getExternalDependencies(Configuration configuration) {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
configuration.dependencies.each { dep -> configuration.dependencies.each { dep ->
// if the dependency is an external jar // if the dependency is an external jar
if (dep instanceof ExternalDependency) { if (dep instanceof ExternalDependency) {
String name = dep.getName()
Set<String> 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. // loop back through all the dependency files, looking for one that contains the dependency name.
String depPath = configuration.find { 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 we found the path, then add it to the list
if (depPath) { if (depPath) {
list.add(depPath) list.add(depPath)