Fix: include OpenCvSharp.Analyzers.dll in NuGet package (analyzers/dotnet/cs/)#1882
Conversation
…rs/dotnet/cs/ OutputItemType="Analyzer" on a ProjectReference enables the analyzer during in-solution builds but does not cause the DLL to be packaged into the NuGet package. Add an explicit None item with Pack=true and PackagePath=analyzers/dotnet/cs so that the Roslyn analyzers (OCVS001–OCVS005) are active for consumers of the OpenCvSharp4 NuGet package. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe project file is updated to explicitly configure NuGet packaging of the Roslyn analyzer DLL. A ChangesAnalyzer Distribution
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
ProjectReferencewithOutputItemType="Analyzer"enables the Roslyn analyzers during in-solution builds, but does not cause the DLL to appear in the NuGet package underanalyzers/dotnet/cs/OpenCvSharp4NuGet package never saw the OCVS001–OCVS005 warnings (e.g.mat.Row(1).At<byte>(1))Noneitem withPack="true"andPackagePath="analyzers/dotnet/cs"pointing at the builtOpenCvSharp.Analyzers.dllWhat changed
src/OpenCvSharp/OpenCvSharp.csproj— added:Verification
Ran
dotnet packbefore and after:analyzers/dotnet/cs/absent from.nupkganalyzers/dotnet/cs/OpenCvSharp.Analyzers.dllpresent in.nupkgReviewer notes
The
Noneitem references the build output path, soOpenCvSharp.Analyzersmust be built before packingOpenCvSharp. This ordering is already guaranteed in normal solution builds and CI (theProjectReferencedependency ensures the analyzer project builds first).Summary by CodeRabbit