Skip to content

Commit f10f4d3

Browse files
committed
Refined library dependency search
1 parent 8b05481 commit f10f4d3

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

build.gradle

+21-3
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,33 @@ List<String> getExternalRuntimeDependencies(Project project) {
304304
List<String> getExternalDependencies(Configuration configuration) {
305305
List<String> list = new ArrayList<>();
306306
configuration.dependencies.each { dep ->
307-
307+
308308
// if the dependency is an external jar
309309
if (dep instanceof ExternalDependency) {
310+
String name = dep.getName()
311+
Set<String> classifiers = dep.artifacts.classifier
312+
String group = dep.getGroup()
313+
String version = dep.getVersion()
314+
String searchString = name
315+
316+
if (version != null) {
317+
searchString = name+"-"+version;
318+
}
319+
320+
if (!classifiers.empty) {
321+
String cls = classifiers.first()
322+
if (cls != null) {
323+
searchString+= "-$cls"
324+
}
325+
}
310326

311327
// loop back through all the dependency files, looking for one that contains the dependency name.
312328
String depPath = configuration.find {
313-
it.name.contains(dep.name)
329+
it.name.contains(searchString)
330+
}
331+
if (depPath == null) {
332+
println("****************DID NOT FIND DEPENDENCY: name = "+name+" version = "+version)
314333
}
315-
316334
// if we found the path, then add it to the list
317335
if (depPath) {
318336
list.add(depPath)

0 commit comments

Comments
 (0)