Skip to content

Commit

Permalink
Merge pull request #13213 from AvaloniaUI/try-to-fix-API-validator
Browse files Browse the repository at this point in the history
Try to fix api validator
  • Loading branch information
danwalmsley authored and grokys committed Oct 17, 2023
1 parent 4c3943b commit 6fb3c0e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
10 changes: 5 additions & 5 deletions azure-pipelines-integrationtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 14 additions & 1 deletion nukebuild/ApiDiffValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}");
Expand Down
1 change: 1 addition & 0 deletions src/Android/Avalonia.Android/Avalonia.Android.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<TargetFramework>net7.0-android33</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver>
Expand Down
1 change: 1 addition & 0 deletions src/iOS/Avalonia.iOS/Avalonia.iOS.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-ios</TargetFramework>
<TargetFramework>net7.0-ios16.0</TargetFramework>
<SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver>
</PropertyGroup>
Expand Down

0 comments on commit 6fb3c0e

Please sign in to comment.