wgnf / liz

liz (ˈlɪz) is a tool to extract license-information from your project/solution aimed on a fast and correct process. Whether it's via a dotnet-CLI-Tool, Cake-Addin or Nuke-Addon
MIT License
9 stars 0 forks source link

fix: fix package download when CPM is enabled #119

Closed wgnf closed 1 year ago

wgnf commented 1 year ago

📫 Addressed Issue(s)

📄 Description

With the newer NuGet versions CPM was introduced which omits the package-versions from the PackageReference elements in the csproj files. With the current approach of downloading packages that were not found in cache this didnt work, because it is not allowed to use the Version attribute in the PackageReference element when CPM is enabled.
For that VersionOverride has to be used.

A new preprocessor now checks if CPM is activated for the current sources, if so, the VersionOverride attribute will be used when trying to download the missing packages.
If CPM is enabled and VersionOverride is disabled, a warning will be displayed.

✅ Checks

codecov[bot] commented 1 year ago

Codecov Report

Merging #119 (c079024) into main (4f47d0e) will increase coverage by 0.08%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   96.89%   96.98%   +0.08%     
==========================================
  Files          53       54       +1     
  Lines        2225     2287      +62     
==========================================
+ Hits         2156     2218      +62     
  Misses         69       69              
Impacted Files Coverage Δ
...ckageReferences/DownloadPackageReferencesFacade.cs 100.00% <100.00%> (ø)
.../Core/Liz.Core/Preparation/CheckCpmPreprocessor.cs 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

wgnf commented 1 year ago

Current approach doesn't work as is, I might've to add a DirectoryPackages.props as well.

wgnf commented 1 year ago

... which actually proved to be a good thing, because it forced me to rethink and redo the current approach. The new approach should be nicer overall.