-
-
Notifications
You must be signed in to change notification settings - Fork 43
Imports of *.props/*.targets from NuGet packages #887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Imports of *.props/*.targets from NuGet packages #887
Conversation
@frobijn I've fixed the checklist for you. |
WalkthroughThe changes update the GitHub Actions workflows for generating changelogs for both the VS2019 and VS2022 versions. Specifically, the "Update changelog in release" step in each workflow is modified to use version Changes
Assessment against linked issues
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (2)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This task is doing more than the "announced": its cleaning up stuff in the nfproj file depending on what is listed in the packages lock file. I would rather see this fixed upstream and have the task do whatever it needs to do when a package is added/updated rather than running on every build. Being a "one-time" event (like when creating a new lib and adding the imports to StyleCop) I'm more than fine to accept the fact that I have to manually edit the nfproj once and that's it. |
It is a synchronization of the packages.config indeed. AFAIK, based on the NuGet code, only packages listed in packages.config are investigated for *.props and *.targets files. And all imports that result from this mechanism are uniquely identified by their path: "<package id>....". The "algorithm" is exactly the same as the NuGet code uses, so it functionally is an exact copy of the behavior that is lacking.
I don't think there is any other way than to run a task every build. But if you have ever looked at the detailed log of a build, an extra task add only 0.000000001% to the total execution time of a build. There is a lot of stuff going on that is completely unnecessary, but that's the way a build works. If you are unhappy about the 0.000000001% time increase, there are ways to optimize performance. E.g., by writing the hash and/or date/time of packages.config in a file "obj\nF\package.sync" and only running the full task if the packages.config is out of date.
I've also tried to poke Microsoft via the issue that I've created about this. All that is met with a deafening silence. I don't think a reaction will be given before nanoFramework switches to the new project format. There may be another way to hook into that via extensibility interfaces: https://learn.microsoft.com/en-us/nuget/visual-studio-extensibility/nuget-api-in-visual-studio#ivspackageinstallerevents-interface, but I have no clue how to program those and I can't find any code examples.
Unless you are a user like AlbertK and have no clue why your package is not working. I don't think this task is primarily meant for you. I have several packages that use the msbuild-mechanism (and yes, I'll still plan to make PR's for them) that are used by multiple projects, and a manual update of the projects for new package versions is quite a tedious job (I don't have Azure pipelines for that).
No it doesn't. If you have a valid .nfproj file with the imports and use the package manager to change the installed version of nbgv, none of the imports are updated. For nanoFramework repositories you may not encounter this as the version updates seem to be updated by one of the pipelines. So, what do you want to do with this PR? It's fine with me if you still don't like it. Then I'll integrate this task in my collection of build tools and stop nagging about this issue. |
Description
Motivation and Context
Microsoft has not yet responded to a request for help to create a workaround, but this PR should provide a fix that always works.
How Has This Been Tested?
Manual testing with a nanoFramework application project with NanoFrameworkProjectSystemPath, NF_MSBUILDTASK_PATH and NF_MDP_MSBUILDTASK_PATH properties that point to the updated MSBuild/task files. Tested with the NerdBank GitVersion package.
Types of changes
Checklist:
Summary by CodeRabbit