diff --git a/src/NuGetizer.Tasks/AssignPackagePath.cs b/src/NuGetizer.Tasks/AssignPackagePath.cs index acb7a4ab..df96560e 100644 --- a/src/NuGetizer.Tasks/AssignPackagePath.cs +++ b/src/NuGetizer.Tasks/AssignPackagePath.cs @@ -78,13 +78,13 @@ ITaskItem EnsurePackagePath(ITaskItem file, IDictionary kindM output.SetMetadata(MetadataName.PackageFolder, packageFolder.Replace('\\', '/')); - // NOTE: a declared TargetFramework metadata trumps TargetFrameworkMoniker, + // NOTE: a declared TargetFramework metadata trumps the DefaultTargetFramework // which is defaulted to that of the project being built. var targetFramework = output.GetMetadata(MetadataName.TargetFramework); if (string.IsNullOrEmpty(targetFramework) && frameworkSpecific) { - var frameworkMoniker = file.GetTargetFrameworkMoniker(); - targetFramework = frameworkMoniker.GetShortFrameworkName() ?? ""; + var nugetFramework = file.GetNuGetTargetFramework(frameworkSpecific); + targetFramework = nugetFramework?.GetShortFolderName() ?? ""; // At this point we have the correct target framework output.SetMetadata(MetadataName.TargetFramework, targetFramework); } diff --git a/src/NuGetizer.Tasks/CreatePackage.cs b/src/NuGetizer.Tasks/CreatePackage.cs index b43e2e5e..41423b80 100644 --- a/src/NuGetizer.Tasks/CreatePackage.cs +++ b/src/NuGetizer.Tasks/CreatePackage.cs @@ -244,36 +244,43 @@ where PackFolderKind.Dependency.Equals(item.GetMetadata(MetadataName.PackFolder) { Id = item.ItemSpec, Version = VersionRange.Parse(item.GetMetadata(MetadataName.Version)), - TargetFramework = item.GetNuGetTargetFramework(), + // PackFolderKind=Dependency has FrameworkSpecific=true, so pass that along + TargetFramework = item.GetNuGetTargetFramework(true) ?? NuGetFramework.AnyFramework, Include = item.GetNullableMetadata(MetadataName.PackInclude) ?? item.GetNullableMetadata(MetadataName.IncludeAssets), Exclude = item.GetNullableMetadata(MetadataName.PackExclude) ?? item.GetNullableMetadata(MetadataName.ExcludeAssets) }; var definedDependencyGroups = (from dependency in dependencies group dependency by dependency.TargetFramework into dependenciesByFramework - select new PackageDependencyGroup - ( - dependenciesByFramework.Key, - (from dependency in dependenciesByFramework - where dependency.Id != "_._" - group dependency by dependency.Id into dependenciesById - select new PackageDependency - ( - dependenciesById.Key, - dependenciesById.Select(x => x.Version).Aggregate(AggregateVersions), - dependenciesById.Select(x => x.Include).Aggregate(default(List), AggregateAssetsFlow), - dependenciesById.Select(x => x.Exclude).Aggregate(default(List), AggregateAssetsFlow) - )).ToList() - )).ToDictionary(p => p.TargetFramework.GetFrameworkString()); + let targetFramework = dependenciesByFramework.Key + let packages = (from dependency in dependenciesByFramework + where dependency.Id != "_._" + group dependency by dependency.Id into dependenciesById + select new PackageDependency + ( + dependenciesById.Key, + dependenciesById.Select(x => x.Version).Aggregate(AggregateVersions), + dependenciesById.Select(x => x.Include).Aggregate(default(List), AggregateAssetsFlow), + dependenciesById.Select(x => x.Exclude).Aggregate(default(List), AggregateAssetsFlow) + )).ToList() + select new PackageDependencyGroup(targetFramework, packages) + //).ToList(); + ).ToDictionary(p => p.TargetFramework.GetFrameworkString()); + + var libframeworks = (from item in Contents + where PackFolderKind.Lib.Equals(item.GetMetadata(MetadataName.PackFolder), StringComparison.OrdinalIgnoreCase) && + !"all".Equals(item.GetMetadata(MetadataName.PrivateAssets), StringComparison.OrdinalIgnoreCase) + // PackFolderKind=Lib has FrameworkSpecific=true, so pass that along + select item.GetNuGetTargetFramework(true) ?? NuGetFramework.AnyFramework + ).ToList(); // include frameworks referenced by libraries, but without dependencies.. - foreach (var targetFramework in (from item in Contents - where PackFolderKind.Lib.Equals(item.GetMetadata(MetadataName.PackFolder), StringComparison.OrdinalIgnoreCase) && - !"all".Equals(item.GetMetadata(MetadataName.PrivateAssets), StringComparison.OrdinalIgnoreCase) - select item.GetNuGetTargetFramework())) - if (!definedDependencyGroups.ContainsKey(targetFramework.GetFrameworkString())) - definedDependencyGroups.Add(targetFramework.GetFrameworkString(), - new PackageDependencyGroup(targetFramework, Array.Empty())); + foreach (var targetFramework in libframeworks + .Where(f => !definedDependencyGroups.ContainsKey(f.GetFrameworkString()))) + { + definedDependencyGroups.Add(targetFramework.GetFrameworkString(), + new PackageDependencyGroup(targetFramework, Array.Empty())); + } manifest.Metadata.DependencyGroups = definedDependencyGroups.Values; } @@ -381,8 +388,12 @@ where item.GetMetadata(MetadataName.PackFolder) == PackFolderKind.FrameworkRefer select new FrameworkAssemblyReference ( item.ItemSpec, - new[] { NuGetFramework.Parse(item.GetTargetFrameworkMoniker().FullName) } - )).Distinct(FrameworkAssemblyReferenceComparer.Default); + // PackFolderKind=FrameworkReference has FrameworkSpecific=true, so pass that along + new[] { item.GetNuGetTargetFramework(true) ?? NuGetFramework.AnyFramework } + )) + .ToList() + .Distinct(FrameworkAssemblyReferenceComparer.Default) + .ToList(); manifest.Metadata.FrameworkReferences = frameworkReferences; } diff --git a/src/NuGetizer.Tasks/Extensions.cs b/src/NuGetizer.Tasks/Extensions.cs index 3b7000d6..e3e8efaa 100644 --- a/src/NuGetizer.Tasks/Extensions.cs +++ b/src/NuGetizer.Tasks/Extensions.cs @@ -85,55 +85,22 @@ public static Manifest GetManifest(this IPackageCoreReader packageReader) } } - public static NuGetFramework GetNuGetTargetFramework(this ITaskItem taskItem) + public static NuGetFramework? GetNuGetTargetFramework(this ITaskItem taskItem, bool? frameworkSpecific = default) { - if (bool.TryParse(taskItem.GetMetadata(MetadataName.FrameworkSpecific), out var frameworkSpecific) && - !frameworkSpecific) - return NuGetFramework.AnyFramework; + if (bool.TryParse(taskItem.GetMetadata(MetadataName.FrameworkSpecific), out var fws)) + frameworkSpecific = fws; - var metadataValue = taskItem.GetMetadata(MetadataName.TargetFramework); - if (string.IsNullOrEmpty(metadataValue)) - metadataValue = taskItem.GetMetadata(MetadataName.TargetFrameworkMoniker); - - if (!string.IsNullOrEmpty(metadataValue)) - return NuGetFramework.Parse(metadataValue); - else + if (frameworkSpecific != true) return NuGetFramework.AnyFramework; - } - public static FrameworkName GetTargetFramework(this ITaskItem taskItem) - { var metadataValue = taskItem.GetMetadata(MetadataName.TargetFramework); if (string.IsNullOrEmpty(metadataValue)) - metadataValue = taskItem.GetMetadata(MetadataName.TargetFrameworkMoniker); + metadataValue = taskItem.GetMetadata(MetadataName.DefaultTargetFramework); if (!string.IsNullOrEmpty(metadataValue)) - return new FrameworkName(NuGetFramework.Parse(metadataValue).DotNetFrameworkName); + return NuGetFramework.Parse(metadataValue); else - return NullFramework; - } - - public static FrameworkName GetTargetFrameworkMoniker(this ITaskItem item) - { - var value = item.GetMetadata(MetadataName.TargetFrameworkMoniker); - // \o/: Turn .NETPortable,Version=v5.0 into .NETPlatform,Version=v5.0, hardcoded for now? - // TODO: should be able to get .NETStandard,Version=v1.x from the item metadata somehow. - - return string.IsNullOrEmpty(value) ? - NullFramework : - new FrameworkName(value); - } - - public static string GetShortFrameworkName(this FrameworkName frameworkName) - { - if (frameworkName == null || frameworkName == NullFramework) return null; - - // In this case, NuGet returns portable50, is that correct? - //if (frameworkName.Identifier == ".NETPortable" && frameworkName.Version.Major == 5 && frameworkName.Version.Minor == 0) - // return "dotnet"; - - return NuGetFramework.Parse(frameworkName.FullName).GetShortFolderName(); } public static void LogErrorCode(this TaskLoggingHelper log, string code, string message, params object[] messageArgs) => diff --git a/src/NuGetizer.Tasks/MetadataName.cs b/src/NuGetizer.Tasks/MetadataName.cs index 96f846e5..615b7d4c 100644 --- a/src/NuGetizer.Tasks/MetadataName.cs +++ b/src/NuGetizer.Tasks/MetadataName.cs @@ -62,9 +62,15 @@ public static class MetadataName /// public const string FrameworkSpecific = nameof(FrameworkSpecific); + /// + /// The target framework of an item. + /// public const string TargetFramework = nameof(TargetFramework); - public const string TargetFrameworkMoniker = nameof(TargetFrameworkMoniker); + /// + /// The original (and therefore default) target framework of the project that declared an item. + /// + public const string DefaultTargetFramework = nameof(DefaultTargetFramework); /// /// Available optional metadata values of contentFiles. diff --git a/src/NuGetizer.Tasks/NuGetizer.Inference.targets b/src/NuGetizer.Tasks/NuGetizer.Inference.targets index ddd4af3e..4ed92788 100644 --- a/src/NuGetizer.Tasks/NuGetizer.Inference.targets +++ b/src/NuGetizer.Tasks/NuGetizer.Inference.targets @@ -181,6 +181,7 @@ Copyright (c) .NET Foundation. All rights reserved. $(GetPackageContentsDependsOn); _SetDefaultPackageReferencePack; + _SetPackTargetFramework; InferPackageContents @@ -303,14 +304,12 @@ Copyright (c) .NET Foundation. All rights reserved. @(_SatelliteDllsProjectOutputGroupOutput -> '%(FinalOutputPath)')"> $(PackFolder) $(BuildOutputFrameworkSpecific) - $(TargetFramework) <_InferredProjectOutput Include="@(DebugSymbolsProjectOutputGroupOutput -> '%(FinalOutputPath)')" Condition="'$(PackSymbols)' != 'false'"> $(PackFolder) $(BuildOutputFrameworkSpecific) - $(TargetFramework) <_InferredPackageFile Include="@(_InferredProjectOutput -> Distinct())" /> @@ -324,6 +323,7 @@ Copyright (c) .NET Foundation. All rights reserved. '%(PackageReference.PrivateAssets)' != 'all' and '%(PackageReference.Pack)' != 'false'"> Dependency + + <_PackageMetadataContent Include="@(_PackageContent -> WithMetadataValue('PackFolder', 'Metadata'))" /> <_PackageContent Remove="@(_PackageMetadataContent)" /> <_PackageContent Include="@(_PackageMetadataContent -> Distinct())"> $(Platform) - + + + diff --git a/src/NuGetizer.Tasks/NuGetizer.props b/src/NuGetizer.Tasks/NuGetizer.props index 0b852d94..83f93078 100644 --- a/src/NuGetizer.Tasks/NuGetizer.props +++ b/src/NuGetizer.Tasks/NuGetizer.props @@ -68,7 +68,10 @@ Copyright (c) .NET Foundation. All rights reserved. false - + + + + diff --git a/src/NuGetizer.Tasks/NuGetizer.targets b/src/NuGetizer.Tasks/NuGetizer.targets index 044ef0be..8815a296 100644 --- a/src/NuGetizer.Tasks/NuGetizer.targets +++ b/src/NuGetizer.Tasks/NuGetizer.targets @@ -46,6 +46,7 @@ Copyright (c) .NET Foundation. All rights reserved. $(GetPackageContentsDependsOn); GetPackageTargetPath; + _SetPackTargetFramework; _AddPackageManifest @@ -64,7 +65,7 @@ Copyright (c) .NET Foundation. All rights reserved. $(PackageId) $(Platform) - $(TargetFrameworkMoniker) + $(PackTargetFramework) @@ -126,7 +127,7 @@ Copyright (c) .NET Foundation. All rights reserved. Metadata $(PackageId) $(Platform) - $(TargetFrameworkMoniker) + $(PackTargetFramework) @@ -167,7 +168,7 @@ Copyright (c) .NET Foundation. All rights reserved. '%(_ReferencedPackageContent.PackFolder)' == 'Metadata'"> $(PackageId) - $(TargetFrameworkMoniker) + $(PackTargetFramework) Dependency @@ -181,7 +182,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_ReferencedPackageContentWithOriginalValues Include="@(_ReferencedPackageContent)" OriginalTargetFramework="%(_ReferencedPackageContent.TargetFramework)" - OriginalTargetFrameworkMoniker="%(_ReferencedPackageContent.TargetFrameworkMoniker)" /> + OriginalDefaultTargetFramework="%(_ReferencedPackageContent.DefaultTargetFramework)" /> - - $(TargetFrameworkMoniker) + $(PackTargetFramework) - $(TargetFrameworkMoniker) + $(PackTargetFramework) @@ -212,11 +213,11 @@ Copyright (c) .NET Foundation. All rights reserved. <_ReferencedPackageContentWithOriginalValues Condition="'%(_ReferencedPackageContentWithOriginalValues.PackageId)' == ''"> $(PackageId) - + - %(_ReferencedPackageContentWithOriginalValues.OriginalTargetFrameworkMoniker) - + %(_ReferencedPackageContentWithOriginalValues.OriginalDefaultTargetFramework) + @@ -234,7 +235,7 @@ Copyright (c) .NET Foundation. All rights reserved. + Outputs="|%(_MSBuildProjectReferenceExistent.Identity)|"> + + + + $(TargetFramework) + $(TargetFramework)$(TargetPlatformVersion) + + + + $(TargetFrameworkMoniker) + + + diff --git a/src/NuGetizer.Tests/AssignPackagePathTests.cs b/src/NuGetizer.Tests/AssignPackagePathTests.cs index c9942fbe..c6fb9197 100644 --- a/src/NuGetizer.Tests/AssignPackagePathTests.cs +++ b/src/NuGetizer.Tests/AssignPackagePathTests.cs @@ -89,7 +89,7 @@ public void when_file_has_no_kind_and_package_path_and_framework_specific_then_i new TaskItem("library.dll", new Metadata { { "PackagePath", "workbooks/library.dll" }, - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.7.2" }, + { "DefaultTargetFramework", ".NETFramework,Version=v4.7.2" }, { "FrameworkSpecific", "true" } }) } @@ -143,7 +143,7 @@ public void when_file_has_no_package_id_then_package_path_is_not_specified() { new TaskItem("library.dll", new Metadata { - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.5" }, + { "DefaultTargetFramework", ".NETFramework,Version=v4.5" }, { "PackFolder", "lib" } }) } @@ -165,7 +165,7 @@ public void when_file_has_no_package_id_but_is_packaging_true_then_package_path_ { new TaskItem("library.dll", new Metadata { - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.7.2" }, + { "DefaultTargetFramework", ".NETFramework,Version=v4.7.2" }, { "PackFolder", "lib" } }) } @@ -186,7 +186,7 @@ public void when_file_has_no_package_id_then_target_framework_is_calculated_anyw { new TaskItem("library.dll", new Metadata { - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.7.2" }, + { "DefaultTargetFramework", ".NETFramework,Version=v4.7.2" }, { "PackFolder", "lib" } }) } @@ -466,7 +466,7 @@ public void when_file_has_tfm_then_assigned_file_contains_target_framework(strin new TaskItem("library.dll", new Metadata { { "PackageId", "A" }, - { "TargetFrameworkMoniker", targetFrameworkMoniker }, + { "DefaultTargetFramework", targetFrameworkMoniker }, { "PackFolder", "lib" } }) } @@ -504,7 +504,7 @@ public void when_file_has_known_kind_then_assigned_file_contains_mapped_package_ new TaskItem("library.dll", new Metadata { { "PackageId", "A" }, - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.7.2" }, + { "DefaultTargetFramework", ".NETFramework,Version=v4.7.2" }, { "PackFolder", packageFileKind } }) } @@ -596,7 +596,7 @@ public void when_assigning_content_file_then_applies_tfm_and_language(string tfm new TaskItem("Sample.cs", new Metadata { { "PackageId", "A" }, - { "TargetFrameworkMoniker", tfm }, + { "DefaultTargetFramework", tfm }, { "PackFolder", "content" }, { "CodeLanguage", lang } }) @@ -807,7 +807,7 @@ public void when_tool_has_relative_target_path_with_framework_specific_true_then new TaskItem("sdk/bin/tool.exe", new Metadata { { "PackageId", "A" }, - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.7.2" }, + { "DefaultTargetFramework", ".NETFramework,Version=v4.7.2" }, { "PackFolder", "tool" }, { "FrameworkSpecific", "true" }, { "TargetPath", "sdk/bin/tool.exe"} @@ -898,7 +898,7 @@ public void when_packing_tool_then_it_is_framework_specific_and_any() new TaskItem("tools/foo.exe", new Metadata { { "PackageId", "A" }, - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.7.2" }, + { "DefaultTargetFramework", ".NETFramework,Version=v4.7.2" }, { "PackFolder", "tools" }, }), } diff --git a/src/NuGetizer.Tests/CreatePackageTests.cs b/src/NuGetizer.Tests/CreatePackageTests.cs index bd8c8444..dd0e4179 100644 --- a/src/NuGetizer.Tests/CreatePackageTests.cs +++ b/src/NuGetizer.Tests/CreatePackageTests.cs @@ -426,7 +426,7 @@ public void when_creating_package_with_non_framework_secific_dependency_then_con } [Fact] - public void when_creating_package_with_any_framework_secific_dependency_then_contains_generic_dependency_group() + public void when_creating_package_with_any_framework_specific_dependency_then_contains_generic_dependency_group() { task.Contents = new[] { @@ -812,13 +812,13 @@ public void when_creating_package_with_framework_reference_then_contains_referen { { MetadataName.PackageId, task.Manifest.GetMetadata("Id") }, { MetadataName.PackFolder, PackFolderKind.FrameworkReference }, - { MetadataName.TargetFrameworkMoniker, TargetFrameworks.NET472 } + { MetadataName.DefaultTargetFramework, TargetFrameworks.NET472 } }), new TaskItem("System.Xml", new Metadata { { MetadataName.PackageId, task.Manifest.GetMetadata("Id") }, { MetadataName.PackFolder, PackFolderKind.FrameworkReference }, - { MetadataName.TargetFrameworkMoniker, TargetFrameworks.PCL78 } + { MetadataName.DefaultTargetFramework, TargetFrameworks.PCL78 } }), }; @@ -844,25 +844,25 @@ public void when_creating_package_with_duplicate_framework_references_then_conta { { MetadataName.PackageId, task.Manifest.GetMetadata("Id") }, { MetadataName.PackFolder, PackFolderKind.FrameworkReference }, - { MetadataName.TargetFrameworkMoniker, TargetFrameworks.NET472 } + { MetadataName.DefaultTargetFramework, TargetFrameworks.NET472 } }), new TaskItem("System.Xml", new Metadata { { MetadataName.PackageId, task.Manifest.GetMetadata("Id") }, { MetadataName.PackFolder, PackFolderKind.FrameworkReference }, - { MetadataName.TargetFrameworkMoniker, TargetFrameworks.NET472 } + { MetadataName.DefaultTargetFramework, TargetFrameworks.NET472 } }), new TaskItem("System.Xml", new Metadata { { MetadataName.PackageId, task.Manifest.GetMetadata("Id") }, { MetadataName.PackFolder, PackFolderKind.FrameworkReference }, - { MetadataName.TargetFrameworkMoniker, TargetFrameworks.PCL78 } + { MetadataName.DefaultTargetFramework, TargetFrameworks.PCL78 } }), new TaskItem("System.Xml", new Metadata { { MetadataName.PackageId, task.Manifest.GetMetadata("Id") }, { MetadataName.PackFolder, PackFolderKind.FrameworkReference }, - { MetadataName.TargetFrameworkMoniker, TargetFrameworks.PCL78 } + { MetadataName.DefaultTargetFramework, TargetFrameworks.PCL78 } }), }; diff --git a/src/NuGetizer.Tests/UtilitiesTests.cs b/src/NuGetizer.Tests/UtilitiesTests.cs index 20f19195..7260f50a 100644 --- a/src/NuGetizer.Tests/UtilitiesTests.cs +++ b/src/NuGetizer.Tests/UtilitiesTests.cs @@ -1,5 +1,6 @@ using System.Runtime.Versioning; using Microsoft.Build.Utilities; +using NuGet.Frameworks; using Xunit; using Metadata = System.Collections.Generic.Dictionary; @@ -7,45 +8,60 @@ namespace NuGetizer { public class UtilitiesTests { - [Fact] - public void when_getting_target_framework_then_fallback_to_tfm() - { - var item = new TaskItem("Foo", new Metadata - { - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.5" } - }); + //[Fact] + //public void when_getting_target_framework_then_fallback_to_tfm() + //{ + // var item = new TaskItem("Foo", new Metadata + // { + // { "TargetFrameworkMoniker", ".NETFramework,Version=v4.5" } + // }); - var framework = item.GetTargetFramework(); + // var framework = item.GetTargetFramework(); - Assert.Equal(new FrameworkName(".NETFramework,Version=v4.5"), framework); - } + // Assert.Equal(new FrameworkName(".NETFramework,Version=v4.5"), framework); + //} - [Fact] - public void when_getting_target_framework_then_does_not_use_tfm() - { - var item = new TaskItem("Foo", new Metadata - { - { "TargetFramework", "net46" }, - { "TargetFrameworkMoniker", ".NETFramework,Version=v4.5" } - }); + //[Fact] + //public void when_getting_target_framework_then_does_not_use_tfm() + //{ + // var item = new TaskItem("Foo", new Metadata + // { + // { "TargetFramework", "net46" }, + // { "TargetFrameworkMoniker", ".NETFramework,Version=v4.5" } + // }); - var framework = item.GetTargetFramework(); + // var framework = item.GetTargetFramework(); - Assert.Equal(new FrameworkName(".NETFramework,Version=v4.6"), framework); - } + // Assert.Equal(new FrameworkName(".NETFramework,Version=v4.6"), framework); + //} + + //[Fact] + //public void when_getting_any_target_framework_then_suceeds() + //{ + // var item = new TaskItem("Foo", new Metadata + // { + // { "TargetFramework", "any" }, + // }); + + // var framework = item.GetTargetFramework(); + + // Assert.Equal(new FrameworkName("Any,Version=v0.0"), framework); + // Assert.Equal("any", framework.GetShortFrameworkName()); + //} [Fact] - public void when_getting_any_target_framework_then_suceeds() + public void when_default_target_framework_has_platform_then_uses_target_platform() { var item = new TaskItem("Foo", new Metadata { - { "TargetFramework", "any" }, + { "FrameworkSpecific", "true" }, + { "DefaultTargetFramework", "net7.0-windows7.0" }, }); - var framework = item.GetTargetFramework(); + var framework = item.GetNuGetTargetFramework(); - Assert.Equal(new FrameworkName("Any,Version=v0.0"), framework); - Assert.Equal("any", framework.GetShortFrameworkName()); + Assert.Equal("net7.0-windows7.0", framework.GetShortFolderName()); } + } } diff --git a/src/NuGetizer.Tests/given_multitargeting_libraries.cs b/src/NuGetizer.Tests/given_multitargeting_libraries.cs index a25b0c86..e7d61094 100644 --- a/src/NuGetizer.Tests/given_multitargeting_libraries.cs +++ b/src/NuGetizer.Tests/given_multitargeting_libraries.cs @@ -59,11 +59,11 @@ public void when_getting_content_then_multitargets() })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = "lib/net7.0-windows/uilibrary.dll" + PackagePath = "lib/net7.0-windows7.0/uilibrary.dll" })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = "lib/net7.0-maccatalyst/uilibrary.dll" + PackagePath = "lib/net7.0-maccatalyst16.1/uilibrary.dll" })); } }