From 8c72ba37c58cae2615665c8e6608c404743e959c Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Fri, 22 Nov 2024 04:44:27 -1000 Subject: [PATCH] [build] Update stable .NET to 9. (#9543) In order to bump the stable version of .NET used in `Java.Interop` to .NET 9 we need to bump it here first. Originally this was going to be done with the bump to targeting .NET 10, however that [PR][0] is waiting on fix(es) from other team(s) so we'll do this bump separately to unblock `Java.Interop`. [0]: https://github.com/dotnet/android/pull/9395 --- Directory.Build.props | 2 +- Makefile | 2 +- build-tools/automation/yaml-templates/build-linux.yaml | 4 ++++ build-tools/automation/yaml-templates/variables.yaml | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 0db7296a9c8..cd7e2a3b5de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,7 +6,7 @@ net$(DotNetTargetFrameworkVersion) $(DotNetTargetFramework)-android - net8.0 + net9.0 netstandard2.0 Debug $(MSBuildThisFileDirectory)bin\$(Configuration)\ diff --git a/Makefile b/Makefile index 103e43b7468..85a0a28b92a 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ RUNTIME := $(shell which mono64 2> /dev/null && echo mono64 || echo mono) SOLUTION = Xamarin.Android.sln TEST_TARGETS = build-tools/scripts/RunTests.targets API_LEVEL ?= -PREPARE_NET_FX = net8.0 +PREPARE_NET_FX = net9.0 PREPARE_ARGS = PREPARE_PROJECT = build-tools/xaprepare/xaprepare/xaprepare.csproj PREPARE_MSBUILD_FLAGS = $(PREPARE_MSBUILD_ARGS) $(MSBUILD_ARGS) diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index c4f3b7652c5..29f35e1907d 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -52,6 +52,10 @@ stages: # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path - checkout: maui + - template: /build-tools/automation/yaml-templates/use-dot-net.yaml + parameters: + remove_dotnet: true + - ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: - checkout: android-platform-support clean: true diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 4dce9868bb4..c80f03fdc94 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -24,7 +24,7 @@ variables: - name: NUnit.NumberOfTestWorkers value: 4 - name: DotNetSdkVersion - value: 8.0 + value: 9.0 - name: DotNetSdkQuality value: GA - name: GitHub.Token @@ -50,7 +50,7 @@ variables: - name: DotNetTargetFramework value: net9.0 - name: DotNetStableTargetFramework - value: net8.0 + value: net9.0 # Workaround: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1585820 - name: _WriteTelemetryProperties value: false