xamarin / AndroidX

AndroidX bindings for .NET for Android
MIT License
181 stars 45 forks source link

Fix persistent `api-diff` issues. #852

Closed jpobst closed 7 months ago

jpobst commented 7 months ago

After a fresh bump of all packages, there are still 2 issues reported in api-diff/nuget-diff:

## Xamarin.AndroidX.AppCompat.Resources

### Added/Removed File(s)

```
+ lib/net7.0-android33.0/Xamarin.AndroidX.AppCompat.Resources.pdb
+ lib/net7.0-android33.0/Xamarin.AndroidX.AppCompat.Resources.dll
+ lib/net7.0-android33.0/Xamarin.AndroidX.AppCompat.Resources.xml
```

This is because this package is manually versioned in a .csproj. Bump this version so we can release a new NuGet.


# API diff: Xamarin.AndroidX.Security.SecurityCrypto.dll
...

This is because our comparison process compares against the highest versioned publicly available NuGet package. Because we have released a 1.1.0.1-alpha06 version, this is what we compare against, even though we are binding 1.0.0.16 in main.

To fix this, add a new --prefer-released option to api-diff that will choose the highest stable package version if it exists and compare against it. If there are no public stable releases, then we are likely binding a package that hasn't hit stable yet (like Xamarin.AndroidX.Ads.Identifier), and we will compare against the highest preview version.