Address "path may not be null or empty" issue in UnusedTracker#478
Address "path may not be null or empty" issue in UnusedTracker#478sormuras wants to merge 2 commits intoGradleUp:masterfrom sormuras:check-for-nullable-jar-in-unused-tracker
Conversation
| apiJars.addAll(getApiJarsFromProject(dep.dependencyProject)) | ||
| apiJars.add(runtimeConfiguration.find { it.name.endsWith("${dep.name}.jar") } as File) | ||
| def jar = runtimeConfiguration.find { it.name.contains("${dep.name}") && it.name.endsWith(".jar") } | ||
| if (jar != null) apiJars.add(jar as File) |
There was a problem hiding this comment.
Since ProjectDependency extends SelfResolvingDependency I'm wondering why this first if clause is needed at all. Couldn't we just call resolve()?
There was a problem hiding this comment.
Running a build without the first if clause...
What's the purpose of the final else branch checking for it.name.startsWith("${dep.name}-"?
There was a problem hiding this comment.
Without the first if clause two integration tests fail:
com.github.jengelman.gradle.plugins.shadow.ShadowPluginSpec > use minimize with dependencies with api scope FAILED
org.spockframework.runtime.ConditionNotSatisfiedError at ShadowPluginSpec.groovy:556
com.github.jengelman.gradle.plugins.shadow.ShadowPluginSpec > use minimize with transitive dependencies with api scope FAILED
org.spockframework.runtime.ConditionNotSatisfiedError at ShadowPluginSpec.groovy:632
There was a problem hiding this comment.
Bad tests or it has to do with minimize...
|
Added link to #477 in initial description of this PR. |
Issue #425
|
Produces another error in real-world scenario: |
Adresses issue #425 by preventing
nullvalues being added to the list ofapijars.Note: this PR also relaxes the filter predicate from
it.name.endsWith("${dep.name}.jar")toit.name.contains("${dep.name}") && it.name.endsWith(".jar"). Not sure, if this a) allows wrong jars to be included and if it b) helps @swankjesse's use-cases described here: #425 (comment)This PR is effectively a duplicate of #477