Skip to content

Conversation

@jonpryor
Copy link
Contributor

@jonpryor jonpryor commented Feb 8, 2024

Context: #1153

Actually building and running NativeAOT artifacts requires .NET 8.

Update $(DotNetTargetFramework) so that .NET 8 is used.

Context: dotnet#1153

*Actually* building *and running* NativeAOT artifacts requires .NET 8.

Update `$(DotNetTargetFramework)` so that .NET 8 is used.
@jonpryor jonpryor requested a review from jpobst February 8, 2024 12:31
@jonpryor
Copy link
Contributor Author

jonpryor commented Feb 8, 2024

From Discord:

@jpobst: so the one benefit of staying on net7 is that we can use the latest generator for AndroidX/GPS where we're stuck on .NET 7 until we drop classic/net6: https://github.com/xamarin/AndroidX/blob/main/build.cake#L5 (this is how we enabled @RestrictTo support)
i'm not saying we can't consider it, but that's the main reason i haven't bumped it

Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, this only affects main and it is unlikely that we would switch AndroidX/GPS to using .NET 9 preview packages. The branch we ship .NET 8 packages out of will remain built with net7.0 so this shouldn't affect AndroidX/GPS.

@jonpryor jonpryor merged commit 6182baf into dotnet:main Feb 8, 2024
jonpryor added a commit to dotnet/android that referenced this pull request Feb 9, 2024
Changes: dotnet/java-interop@7f08b77...dfcbd67

  * dotnet/java-interop@dfcbd670: Bump to xamarin/xamarin-android-tools/main@a698a33 (dotnet/java-interop#1189)
  * dotnet/java-interop@6182baff: [build] Target `net8.0` (dotnet/java-interop#1186)

dotnet/java-interop@6182baff updated Java.Interop to target .NET 8
instead of .NET 7.  This introduced a build break:

	…/xamarin-android/src/Mono.Android/Mono.Android.csproj(402,5):
	  error MSB3030: Could not copy the file
	  "…/xamarin-android/external/Java.Interop/bin/Debug-net7.0/ref/Java.Interop.dll"
	  because it was not found.

Introduce a new `$(JavaInteropTargetFrameworkVersion)` MSBuild
property within `Configuration.props` which contains the .NET version
that Java.Interop is targeting.

Update `Mono.Android.csproj` and `Microsoft.Android.Ref.proj` so that
they use `$(JavaInteropTargetFrameworkVersion)` to locate the
reference `Java.Interop.dll` assembly.
jonpryor added a commit to dotnet/android that referenced this pull request Feb 9, 2024
Changes: dotnet/java-interop@7f08b77...dfcbd67

  * dotnet/java-interop@dfcbd670: Bump to xamarin/xamarin-android-tools/main@a698a33 (dotnet/java-interop#1189)
  * dotnet/java-interop@6182baff: [build] Target `net8.0` (dotnet/java-interop#1186)

dotnet/java-interop@6182baff updated Java.Interop to target .NET 8
instead of .NET 7.  This introduced a build break:

	…/xamarin-android/src/Mono.Android/Mono.Android.csproj(402,5):
	  error MSB3030: Could not copy the file
	  "…/xamarin-android/external/Java.Interop/bin/Debug-net7.0/ref/Java.Interop.dll"
	  because it was not found.

Introduce a new `$(JavaInteropTargetFrameworkVersion)` MSBuild
property within `Configuration.props` which contains the .NET version
that Java.Interop is targeting.

Update `Mono.Android.csproj` and `Microsoft.Android.Ref.proj` so that
they use `$(JavaInteropTargetFrameworkVersion)` to locate the
reference `Java.Interop.dll` assembly.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants