xamarin-macios
xamarin-macios copied to clipboard
NativeReferences with Include's that have a trailing / are ignored without obvious warning/error
If your NativeReference has a trailing / it is completely ignored FWICT:
<NativeReference Include="/Users/donblas/Programming/Projects/Microsoft.Maui.Platform.Channels/Platforms/Apple/Sample/build/Debug-maccatalyst/Sample.framework/" Kind="Framework" />
Steps to Reproduce
- Create a new ios project and have a native framework you want to include
- Add this to your csproj (fix path as needed) - Note the trailing '/' character
<NativeReference Include="/Users/donblas/Programming/Projects/Microsoft.Maui.Platform.Channels/Platforms/Apple/Sample/build/Debug-maccatalyst/Sample.framework/" Kind="Framework" />
- Build, and note lack of framework included, mostly silently
Expected Behavior
'/' to be ignored or a hard error
Actual Behavior
No framework and a confused developer
Build Logs
Example Project (If Possible)
https://github.com/chamons/Microsoft.Maui.Platform.Channels/commits/swift @ e89bded092236327dd8ca2c9b7c807aab1b05301
FYI @rolfbjarne
I believe this is because we compare '%(Extension)' to '.framework' here:
https://github.com/xamarin/xamarin-macios/blob/b1a732d5260dbf6a100c7f126df720e6698c740f/msbuild/Xamarin.Shared/Xamarin.Shared.targets#L133-L135
We also do it here:
https://github.com/xamarin/xamarin-macios/blob/6b5ce1401fd6fe3c62816e4d100423484bd4b412/dotnet/targets/Xamarin.Shared.Sdk.targets#L1468-L1473