From 6fb3c0e113fa97878edec797fc3b6993f13f9536 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 12 Oct 2023 12:48:09 +0100 Subject: [PATCH] Merge pull request #13213 from AvaloniaUI/try-to-fix-API-validator Try to fix api validator --- azure-pipelines-integrationtests.yml | 10 +++++----- azure-pipelines.yml | 8 ++++---- nukebuild/ApiDiffValidation.cs | 15 ++++++++++++++- .../Avalonia.Android/Avalonia.Android.csproj | 1 + src/iOS/Avalonia.iOS/Avalonia.iOS.csproj | 1 + 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/azure-pipelines-integrationtests.yml b/azure-pipelines-integrationtests.yml index 939d09c959a..39923ca7815 100644 --- a/azure-pipelines-integrationtests.yml +++ b/azure-pipelines-integrationtests.yml @@ -5,15 +5,15 @@ jobs: steps: - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 6.0.404' + displayName: 'Use .NET Core SDK 6.0.415' inputs: - version: 6.0.404 + version: 6.0.415 - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 7.0.101' + displayName: 'Use .NET Core SDK 7.0.402' inputs: - version: 7.0.101 - + version: 7.0.402 + - script: system_profiler SPDisplaysDataType |grep Resolution displayName: 'Get Resolution' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8bab6e68e27..3271f7d527e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,14 +30,14 @@ jobs: vmImage: 'ubuntu-20.04' steps: - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 6.0.404' + displayName: 'Use .NET Core SDK 6.0.415' inputs: - version: 6.0.404 + version: 6.0.415 - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 7.0.101' + displayName: 'Use .NET Core SDK 7.0.402' inputs: - version: 7.0.101 + version: 7.0.402 - task: CmdLine@2 displayName: 'Install Workloads' diff --git a/nukebuild/ApiDiffValidation.cs b/nukebuild/ApiDiffValidation.cs index 483bfd336a5..000f6358669 100644 --- a/nukebuild/ApiDiffValidation.cs +++ b/nukebuild/ApiDiffValidation.cs @@ -12,6 +12,13 @@ public static class ApiDiffValidation { private static readonly HttpClient s_httpClient = new(); + private static readonly (string oldTfm, string newTfm)[] s_tfmRedirects = new[] + { + // We use StartsWith below comparing these tfm, as we ignore platform versions (like, net6.0-ios16.1) + ("net6.0-android", "net7.0-android"), + ("net6.0-ios", "net7.0-ios") + }; + public static async Task ValidatePackage( Tool apiCompatTool, string packagePath, string baselineVersion, string suppressionFilesFolder, bool updateSuppressionFile) @@ -54,8 +61,14 @@ public static async Task ValidatePackage( await baselineDll.entry.Open().CopyToAsync(baselineDllFile); } + var targetTfm = baselineDll.target; + if (s_tfmRedirects.FirstOrDefault(t => baselineDll.target.StartsWith(t.oldTfm)).newTfm is {} newTfm) + { + targetTfm = newTfm; + } + var targetDll = targetDlls.FirstOrDefault(e => - e.target == baselineDll.target && e.entry.Name == baselineDll.entry.Name); + e.target.StartsWith(targetTfm) && e.entry.Name == baselineDll.entry.Name); if (targetDll.entry is null) { throw new InvalidOperationException($"Some assemblies are missing in the new package {packageId}: {baselineDll.entry.Name} for {baselineDll.target}"); diff --git a/src/Android/Avalonia.Android/Avalonia.Android.csproj b/src/Android/Avalonia.Android/Avalonia.Android.csproj index d8b0c3d5342..f99d984b052 100644 --- a/src/Android/Avalonia.Android/Avalonia.Android.csproj +++ b/src/Android/Avalonia.Android/Avalonia.Android.csproj @@ -1,6 +1,7 @@  net6.0-android + net7.0-android33 21 true true diff --git a/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj b/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj index f39070befcc..c8413c08ef5 100644 --- a/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj +++ b/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj @@ -1,6 +1,7 @@  net6.0-ios + net7.0-ios16.0 13.0 true