Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java.Interop.Tools.JavaCallableWrappers] fix net8.0 targeting in XA (#…
…1197) Context: dotnet/android#8748 Context: 56b7eeb dotnet/android#8748 attempts to bump xamarin-android to use commit 56b7eeb, and fails to build: (CoreCompile target) -> Xamarin.Android.Build.Tasks\Utilities\MamJsonParser.cs(92,43): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level [Xamarin.Android.Build.Tasks\Xamarin.Android.Build.Tasks.csproj] Xamarin.Android.Build.Tasks\Utilities\MamJsonParser.cs(92,81): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level [Xamarin.Android.Build.Tasks\Xamarin.Android.Build.Tasks.csproj] Xamarin.Android.Build.Tasks\Utilities\MavenExtensions.cs(26,32): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level [Xamarin.Android.Build.Tasks\Xamarin.Android.Build.Tasks.csproj] The cause of the failure is that 56955d9 updated `Java.Interop.Tools.JavaCallableWrappers.csproj` to multitarget both netstandard2.0 and net8.0. This is nominally "fine", except that `Java.Interop.Tools.JavaCallableWrappers.csproj` *also* sets [`$(AppendTargetFrameworkToOutputPath)`][0]=false, which means that both builds use the *same* output directory. This means that the netstandard2.0 and net8.0 build outputs clobber each other -- in parallel! -- which means that the `Xamarin.Android.Build.Tasks.csproj` build doesn't reliably use the netstandard2.0 output assembly. Fix this scenario by no longer overriding the `$(AppendTargetFrameworkToOutputPath)` MSBuild property, and only setting `$(OutputPath)` to `$(ToolOutputFullPath)` for netstandard2.0 builds. Finally, remove use of `XAConfig.props`. This appears to be vestigial, as we can't find any current code that would produce this file. [0]: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#appendtargetframeworktooutputpath
- Loading branch information