Opt out of centralized package management#339
Conversation
Current behavior is that builds are failing when a solution uses centralized package management via Directory.Packages.props files. To prevent this behaviour we are opting out of that centralice package management for generated projects.
|
Hi @janbiehl, thanks for sharing this with us, This looks like a good default! However, I would like to handle the case where someone does want to manage packages via Do you think this is something you can take on yourself? In this PR? You should have enough examples in the repo on how to create such option and how to conditionally render the csproj based on the option. If not, please open a ticket for this, and we will implement it for the next version :) |
- New Option 'useCentralPackageManagement' - Deactive package management by default
|
Hey, I implemented the solution as I understood you. I chose not to activate Central Project Management as the default setting. I also added some unit tests, but I see that some checks are failing. What exactly do I need to do to get the checks to turn green? It's not intuitive to me. Do i have to copy things manually around, or is there a command to get that right? |
Hi @janbiehl , great work! For the fixes make sqlc-generatethen dotnet format --exclude GeneratedProtobuf --exclude examplesalso, please document the added option here - then push everything 🥇 🥇 🥇 |
- Fix formatting issues in CsprojGen and unit tests - Regenerate all examples with useCentralPackageManagement option - Add dotnet-format target to Makefile - Update documentation for the new useCentralPackageManagement option
|
HI, @janbiehl try to update from our main branch and regenerate and push :) |
| ./scripts/generate_protobuf.sh No newline at end of file | ||
| ./scripts/generate_protobuf.sh | ||
|
|
||
| dotnet-format: |
There was a problem hiding this comment.
This is fine, but if you install the pre-commit this is done for you.
When using centralized package management via
Directory.Packages.propsfiles builds are failing when referencing projects generated by the plugin.To prevent builds from failing the generated projects should opt out from centralized package management. This could either be done via my implemented solution (see changes) or via Directory.Packages.props file that opts out directly inside the generated project.
I don't expect any side effects for applications that are not using centralized package management. But for applications that do use it, it is a nice addition.