Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: dotnet/java-interop@3436a30...5bca8ad * dotnet/java-interop@5bca8ad6: [build] Automatically add NullableAttributes.cs for netstandard2.0 (dotnet/java-interop#1188) * dotnet/java-interop@45437e22: [Java.Interop] suppress IL3050 with `#pragma` (dotnet/java-interop#1201) * dotnet/java-interop@1c9c8c9c: [Java.Interop.Tools.Maven] Initial commit. (dotnet/java-interop#1179) With dotnet/java-interop@5bca8ad6, all instances of nullable attributes types defined in `NullableAttributes.cs` are now `internal`. However, `Xamarin.Android.Build.Tasks` was consuming the `public` types from its reference to `Java.Interop.Tools.JavaCallableWrappers`, so this change resulted in a build break: MavenExtensions.cs(26,32): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level MamJsonParser.cs(92,43): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level MamJsonParser.cs(92,81): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level We can apply almost the same logic from dotnet/java-interop@5bca8ad6 to `xamarin-android`; the difference is that neither of the `netstandard2.0` projects in xamarin-android that need the attributes have `$(Nullable)='enabled'` and thus our `Condition` fails. (`Xamarin.Android.Build.Tasks.csproj` and `Xamarin.Android.Tools.JavadocImporter.csproj` include `.cs` files from `external/Java.Interop` that have been NRT annotated and thus need the nullable attribute types.) We add `$(Nullable)='annotations'` to the `@(Compile)` which allows one to use NRT syntax but does not emit any NRT warnings since these assemblies have not been converted. We then modify the `NullableAttributes.cs` inclusion logic to additionally key off the `$(Nullable)=annotations` value. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonathan Pobst <jonathan.pobst@microsoft.com>
- Loading branch information