mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
Refined library dependency search
This commit is contained in:
parent
8b054814a8
commit
f10f4d3a83
24
build.gradle
24
build.gradle
@ -304,15 +304,33 @@ List<String> getExternalRuntimeDependencies(Project project) {
|
||||
List<String> getExternalDependencies(Configuration configuration) {
|
||||
List<String> list = new ArrayList<>();
|
||||
configuration.dependencies.each { dep ->
|
||||
|
||||
|
||||
// if the dependency is an external jar
|
||||
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.
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user