xamarin / Xamarin.Legacy.Sdk

Starting from a .NET 6 project, adds the ability to target legacy Xamarin target frameworks such as monoandroid11.0 or xamarin.ios10. *Not fully supported*
MIT License
35 stars 6 forks source link

[android] guard against accidental `\**\*` wildcards #49

Closed jonathanpeppers closed 1 year ago

jonathanpeppers commented 1 year ago

Context: https://github.com/xamarin/xamarin-android/pull/7837 Context: https://github.com/xamarin/Xamarin.Legacy.Sdk/pull/46

I ended up making this change in xamarin-android to avoid a potential issue in all .NET projects, so bringing it here as well.

In cases where the android workload is not installed, Xamarin.Legacy.Sdk can accidentally wildcard your entire disk:

MSBUILD : warning MSB5029: The value “\**\.*\**” of the “Exclude” attribute in element <ItemGroup> in file “/Users/moljac/.nuget/packages/xamarin.legacy.sdk/0.2.0-alpha2/Sdk/AutoImport.Android.props (26,61)” is a wildcard that results in enumerating all files on the drive, which was likely not intended. Check that referenced properties are always defined.

Add checks that $(MonoAndroidAssetsPrefix) and $(MonoAndroidResourcePrefix) are not blank.