-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added support for LinkBase in Avalonia resources generator #16118
Conversation
You can test this PR using the following package version. |
Please, add a test (a resource outside of the test lib with LinkBase + some test that loads it from code should be sufficient). |
- added InternalsVisibleTo of Avalonia.Build.Tasks in Avalonia.Build.Tasks.UnitTest - added test for LinkBase support
You can test this PR using the following package version. |
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.
The current implementation is wrong, see previous comments.
I don't think we should handle LinkBase
in the task itself.
Let MSBuild expand the recursive globs from LinkBase
into Link
instead.
This is what the SDK is doing. We should probably copy this behavior.
var path = !string.IsNullOrEmpty(link) | ||
? link | ||
: relativePath; | ||
: !string.IsNullOrEmpty(linkBase) |
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.
This treats LinkBase
and Link
the same, which isn't correct. Link
is a file path whereas LinkBase
is the path before the directory globs, i.e. a directory path.
public void Does_Support_LinkBase_In_Avalonia_Resources_Generator() | ||
{ | ||
var path = "path/to/resources"; | ||
var expected = "/" + path; |
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.
The added test doesn't check the right thing: the expected path should be /path/to/resources/root.xml
.
Closing due to inactivity |
What does the pull request do?
adds support for
LinkBase
in avalonia resources generatorWhat is the current behavior?
Avalonia asset loader is not resolving for
LinkBase
What is the updated/expected behavior with this PR?
Using LinkBase to set resources path works
Fixed issues
Fixes #16056