xamarin/xamarin-macios

IPhoneResourcePrefix maybe supports multiple prefixes, but not all the logic does

Opened this issue · 0 comments

Steps to Reproduce

In theory, you can have multiple resource prefixes with IPhoneResourcePrefix, separated by a semi-colon:

<IPhoneResourcePrefix>Resources;Platforms/iOS/Resources</IPhoneResourcePrefix>

It looks like our code supports this (that's the intention at least), but I've never seen it done, and we don't have tests for this, so YMMV... but if it works, it would be a much simpler solution.

But, I see this:

<!-- Include everything in the project's Resources folder (as represented by the _ResourcePrefix property, which is set from the IPhoneResourcePrefix/XamMacResourcePrefix properties),

Set by

<_ResourcePrefix Condition="'$(_PlatformName)' != 'macOS'">$(IPhoneResourcePrefix)</_ResourcePrefix>

Hm yeah, using _ResourcePrefix in an Include like that won't work as expected with multiple resource prefixes.

You could try updating _ResourcePrefix just before CollectBundleResources to see if that works. I'd want to implement a proper fix though, probably make that Include work with multiple resource prefixes, so the idea would for it to be a temporary workaround.