dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

Advice to display Version Catalog aliases

Open Chasson1992 opened this issue 2 years ago • 3 comments

Fix #794

To allow advice to display the Version Catalog aliases we can iterate through each alias and add a mapping of the alias to the dependency in the DependencyHandler#map extension. Followed the recommendations from @daanschipper and @autonomousapps described in the issue.

I didn't add any functional tests, since it's fairly simple and safe, but I'm open to doing so.

A full working repository to demonstrate the issue is located here

buildHealth output before the changes:

Advice for root project
Dependencies which should be removed or changed to runtime-only:
  runtimeOnly("ch.qos.logback:logback-classic:1.2.6") (was implementation)

buildHealth output after the changes:

Advice for root project
Dependencies which should be removed or changed to runtime-only:
  runtimeOnly(libs.logback.classic) (was implementation)

Chasson1992 avatar Dec 30 '22 04:12 Chasson1992

Thanks for the PR!

autonomousapps avatar Jan 03 '23 01:01 autonomousapps

@autonomousapps I started to implement a functional test (mirroring the test harness I created under https://github.com/Chasson1992/DependencyAnalysisTest).

I'm developing on a Windows 10 machine with IntelliJ Ultimate but when running the functionalTest task I'm getting a bunch of expections from:

Caused by: java.io.IOException at FileUtils.java:1344
    Caused by: java.nio.file.FileSystemException at WindowsException.java:92

I've been having a hard time figuring out the issue on this one. Any suggestions? I'll push what I have currently to my fork.

Chasson1992 avatar Feb 19 '23 20:02 Chasson1992

I've been having a hard time figuring out the issue on this one. Any suggestions? I'll push what I have currently to my fork.

Can you post more of the stacktrace? TBH I don't develop at all on Windows, so I'm not sure I'll be able to help, but at the least I'd need the full stacktrace.

autonomousapps avatar Mar 15 '23 02:03 autonomousapps