-
Notifications
You must be signed in to change notification settings - Fork 743
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
fix: Fixed bug with Additional Files metadata override. #8561
base: master
Are you sure you want to change the base?
Conversation
src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props
Outdated
Show resolved
Hide resolved
src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props
Outdated
Show resolved
Hide resolved
It's not entirely clear to me what caused the tests to crash after the last change. Everything works correctly in VS 2022 preview 4.0, but the CI environment may have a different msbuild that doesn't support this (or a nested %()). Should I undo the change? |
This caused by:
Most likely because |
In addition to this message, there is also such a message here, so I do not think that this is the reason
|
It's likely because the parameter is null or empty, and there's no signature that matches |
I have updated the code according to the latest changes in the master branch. I also added the necessary checks. |
There are errors in the build that I don't understand. Perhaps they are caused by the fact that the full path is always used to avoid collisions. |
@HavenDV I'm seeing for example:
During |
I checked, the error is caused by the fact that data with an absolute path was added to the dictionary instead of a relative one, as it was before. I will try to find an alternative solution instead of changing the current tests. |
I made some edits to make the final output match the current one. Here is a project where you can experiment and evaluate the changes. |
</PropertyGroup> | ||
|
||
<ItemGroup Label="Add SourceItemGroup metadata to existing additional files"> | ||
<AdditionalFiles SourceItemGroup="Page" Condition="$(_UnoPages) == '' AND $(_Pages) != '' AND $(_AdditionalFiles) != '' AND $(_Pages.Contains(%(AdditionalFiles.FullPath)))" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to add a regression test in the runtimetests csproj (for instance), which create a custom AdditionalFile
item, then validates that after the build, it's still set properly (with the right metadata)? Adding two targets, one beforebuild and one after compile
that fails the build, would make it easier to ensure we're not breaking later on. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to note that the syntax for updating metadata through Condition looks erroneous if you don’t know about it (because you expect an explicit Update, but I couldn’t make code through Update at the time of the PR, although I think it’s possible, I just need something like this filter the collection). Here are some examples that this is a valid code and it works:
https://github.com/MicrosoftDocs/visualstudio-docs/blob/main/docs/msbuild/msbuild-items.md#updating-metadata-on-items-in-an-itemgroup-of-a-target
dotnet/msbuild#1618 (comment)
P.S. I'll add tests a bit later when I have time.
@HavenDV Is this PR still applicable? |
Hi @MartinZikmund, I've resolved the conflict so it may still be relevant/working, but I don't have the free time to test it right now |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-8561/index.html |
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-8561/index.html |
Thanks for the update. It's still causing issues at this time with some combinations in regression testing. Aside from this, would you know of a known generator that would break when using Uno? |
GitHub Issue (If applicable): closes #8176
PR Type
What kind of change does this PR introduce?
Bugfix
What is the current behavior?
At the moment the Uno package does not take into account that the user may have other generators that have metadata in AdditionalFiles
What is the new behavior?
_InjectAdditionalFiles Target will correctly take into account the presence of AdditionalFiles by comparing them by full path. This will simply add new metadata to existing files that are also Page/ApplicationDefinition/PRIResource/TSBindingAssemblySource without losing the existing metadata.
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):