Fixed NPE when api project dependency has a version number.#477
Fixed NPE when api project dependency has a version number.#477johnrengelman merged 1 commit intoGradleUp:masterfrom
Conversation
|
I duplicated this PR in #478, methinks. |
sormuras
left a comment
There was a problem hiding this comment.
Looks good to me -- and like it better then my #478 PR.
@johnrengelman ... please review, merge and release? ;-)
| } else if (dep instanceof SelfResolvingDependency) { | ||
| apiJars.addAll(dep.resolve()) | ||
| } else { | ||
| addJar(runtimeConfiguration, dep, apiJars) |
There was a problem hiding this comment.
Why this and the next line? Ain't some duplication going on then?
There was a problem hiding this comment.
I assumed that the intent is essentially the same in both location (i.e., add only the dependency jar). Although, arguably the isProjectDependencyFile name makes less sense this way. If you mean the duplicate call to addJar, then it is difficult to not repeat something with the middle condition in the way.
There was a problem hiding this comment.
This PR (and also #478) produce the following exception:
Caused by: java.lang.IllegalArgumentException: neither file nor directory
at shadow.org.vafer.jdependency.Clazzpath.addClazzpathUnit(Clazzpath.java:122)
at shadow.org.vafer.jdependency.Clazzpath.addClazzpathUnit(Clazzpath.java:95)
at shadow.org.vafer.jdependency.Clazzpath.addClazzpathUnit(Clazzpath.java:86)
at shadow.org.vafer.jdependency.Clazzpath$addClazzpathUnit.call(Unknown Source)
at com.github.jengelman.gradle.plugins.shadow.internal.UnusedTracker$_closure2.doCall(UnusedTracker.groovy:22)
when used via @jitpack on the @junit-team JUnit 5 code base.
|
I'm almost certain that, that issue is a completely different issue and as such it would be better to fix it in a separate PR (and only manifests here because so far the code didn't even get to that point). |
If an API project dependency has a version number, then the check for the dependency name was wrong (i.e., it won't end with myproject.jar but say myproject-1.0.jar). I tried to create a change which is reasonably compatible with the previous behaviour in other cases.