Improve unused-dependency "required by your code" output to include relevant classes
Today the output looks like this:
error unused-dependency one or more classes in org.springframework:spring-core:4.3.7.RELEASE are required by your code directly
It would be beneficial to have a more detailed output.
error unused-dependency one or more classes in org.springframework:spring-core:4.3.7.RELEASE are required by your code directly
unused-dependency: org.springframework.util.ClassUtils is used by se.devmind.UsingTransitiveDep
unused-dependency: org.springframework.util.Foo is used by se.devmind.Bar
...
I just added something similar to the duplicate-dependency-class rule when it's run at --info level. The violations aren't really designed with multi-line output in mind, so it'll either take a little work to support that, or we add it as separate logging like we did for the duplicate rule.
Yes, that would work.
I think I would prefer if the output used the term 'transitive dependency' instead of just the very confusing name of the rule: 'unused-dependency'. Maybe even split it into two rules?
error transitive-dependency one or more classes in org.springframework:spring-core:4.3.7.RELEASE are required by your code directly
- org.springframework.util.ClassUtils is used by se.devmind.UsingTransitiveDep
- org.springframework.util.Foo is used by se.devmind.Bar
...
"Transitive-dependency" is soooo much better, I just came here trying to figure out what on earth gradle was complaining about :-)