From 70114fe2ff6f85a1c509b7035d0b7d4dadb3832a Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Tue, 11 Jun 2024 21:58:18 +0300 Subject: [PATCH] build!: Support net7.0 to remove extensions ambiguous with BCL ones BREAKING CHANGE: Uno.Extensions.ListExtensions.AsReadOnly is now removed on net7.0 and later as it will be ambiguous with the BCL one (System.Collections.Generic.CollectionExtensions.AsReadOnly). Use the method from BCL. BREAKING CHANGE: Uno.Extensions.EnumerableExtensions.SkipLast is now removed on net7.0 and later and netstandard2.1 as it will be ambiguous with the BCL one (System.Linq.Enumerable.SkipLast). Use the method from BCL. --- .azure-pipelines.yml | 11 +++++++++-- doc/ReleaseNotes/_ReleaseNotes.md | 5 +++++ src/Directory.Build.props | 7 ------- src/Uno.Core.Build/Uno.Core.Build.csproj | 6 +----- .../EnumerableExtensions.cs | 2 +- src/Uno.Core.Extensions.Collections/ListExtensions.cs | 5 +++-- .../Uno.Core.Extensions.Collections.csproj | 4 ++-- .../Uno.Core.Extensions.Compatibility.csproj | 4 ++-- .../Uno.Core.Extensions.Disposables.csproj | 4 ++-- .../Uno.Core.Extensions.Equality.csproj | 4 ++-- .../Uno.Core.Extensions.Logging.Singleton.csproj | 4 ++-- .../Uno.Core.Extensions.Logging.csproj | 4 ++-- .../Uno.Core.Extensions.Threading.csproj | 4 ++-- src/Uno.Core.Extensions/Uno.Core.Extensions.csproj | 4 ++-- .../Collections/ListExtensionsFixture.cs | 2 ++ src/Uno.Core.Tests/Uno.Core.Tests.csproj | 6 +----- src/Uno.Core/Uno.Core.csproj | 4 ++-- 17 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 150b2a4..d61c7dc 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -25,7 +25,7 @@ steps: - task: gitversion/setup@0 inputs: - versionSpec: '5.6.8' + versionSpec: '5.10.3' - task: gitversion/execute@0 inputs: @@ -41,13 +41,20 @@ steps: inputs: solution: src/Uno.Core.sln msbuildArchitecture: x86 - msbuildArguments: /r /p:Configuration=Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\vs2017" "/p:PackageVersion=%GITVERSION_FullSemVer%" "/p:InformationalVersion=%GITVERSION_InformationalVersion%" /detailedsummary + msbuildArguments: /r /p:Configuration=Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\vs2017" "/p:PackageVersion=$(GITVERSION.FullSemVer)" "/p:InformationalVersion=$(GITVERSION.InformationalVersion)" /detailedsummary /bl:$(Build.ArtifactStagingDirectory)/Uno.Core.binlog clean: false maximumCpuCount: true restoreNugetPackages: false logProjectEvents: false createLogFile: false + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'binlog' + publishLocation: 'Container' + condition: always() + - task: VisualStudioTestPlatformInstaller@1 - task: VSTest@2 diff --git a/doc/ReleaseNotes/_ReleaseNotes.md b/doc/ReleaseNotes/_ReleaseNotes.md index 3c09d81..817b5e4 100644 --- a/doc/ReleaseNotes/_ReleaseNotes.md +++ b/doc/ReleaseNotes/_ReleaseNotes.md @@ -2,6 +2,11 @@ ## Next version +* `Uno.Extensions.ListExtensions.AsReadOnly` is now removed on net7.0 and later as it will be ambiguous with the BCL one (`System.Collections.Generic.CollectionExtensions.AsReadOnly`). Use the method from BCL. + +* `Uno.Extensions.EnumerableExtensions.SkipLast` is now removed on net7.0 and later and netstandard2.1 as it will be ambiguous with the BCL one (`System.Linq.Enumerable.SkipLast`). Use the method from BCL. + + ### Features * ### Breaking changes diff --git a/src/Directory.Build.props b/src/Directory.Build.props index b32a428..e77c47e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -25,13 +25,6 @@ - - - - all - runtime; build; native; contentfiles; analyzers - - diff --git a/src/Uno.Core.Build/Uno.Core.Build.csproj b/src/Uno.Core.Build/Uno.Core.Build.csproj index 947cfc5..0752963 100644 --- a/src/Uno.Core.Build/Uno.Core.Build.csproj +++ b/src/Uno.Core.Build/Uno.Core.Build.csproj @@ -98,10 +98,6 @@ runtime all - - all - runtime; build; native; contentfiles; analyzers - @@ -114,4 +110,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions.Collections/EnumerableExtensions.cs b/src/Uno.Core.Extensions.Collections/EnumerableExtensions.cs index 444a273..d78909d 100644 --- a/src/Uno.Core.Extensions.Collections/EnumerableExtensions.cs +++ b/src/Uno.Core.Extensions.Collections/EnumerableExtensions.cs @@ -900,7 +900,7 @@ public static IEnumerable SelectManyUntyped(this IEnumerable s } } -#if !XAMARIN +#if !XAMARIN && !NET7_0 && !NETSTANDARD2_1 /// /// Skips the last items from an enumerable sequence. /// diff --git a/src/Uno.Core.Extensions.Collections/ListExtensions.cs b/src/Uno.Core.Extensions.Collections/ListExtensions.cs index c3e77f0..77ede0c 100644 --- a/src/Uno.Core.Extensions.Collections/ListExtensions.cs +++ b/src/Uno.Core.Extensions.Collections/ListExtensions.cs @@ -29,6 +29,7 @@ namespace Uno.Extensions /// public static class ListExtensions { +#if !NET7_0 /// /// Returns a readonly instance of the specified list. /// @@ -39,6 +40,7 @@ public static IList AsReadOnly(this IList items) { return new ReadOnlyCollection(items); } +#endif public static void AddRange(this IList destination, IEnumerable source) { @@ -48,7 +50,6 @@ public static void AddRange(this IList destination, IEnumerable source) } } - /// /// Adds the items of the specified collection to the end of the ICollection, but only if they /// are not already present. @@ -305,4 +306,4 @@ public static bool SequenceKeyEqual(this IList first, IList second) return true; } } -} \ No newline at end of file +} diff --git a/src/Uno.Core.Extensions.Collections/Uno.Core.Extensions.Collections.csproj b/src/Uno.Core.Extensions.Collections/Uno.Core.Extensions.Collections.csproj index c57e216..d43c6fe 100644 --- a/src/Uno.Core.Extensions.Collections/Uno.Core.Extensions.Collections.csproj +++ b/src/Uno.Core.Extensions.Collections/Uno.Core.Extensions.Collections.csproj @@ -1,6 +1,6 @@  - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -42,4 +42,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions.Compatibility/Uno.Core.Extensions.Compatibility.csproj b/src/Uno.Core.Extensions.Compatibility/Uno.Core.Extensions.Compatibility.csproj index fded68b..40b4490 100644 --- a/src/Uno.Core.Extensions.Compatibility/Uno.Core.Extensions.Compatibility.csproj +++ b/src/Uno.Core.Extensions.Compatibility/Uno.Core.Extensions.Compatibility.csproj @@ -1,6 +1,6 @@  - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -52,4 +52,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions.Disposables/Uno.Core.Extensions.Disposables.csproj b/src/Uno.Core.Extensions.Disposables/Uno.Core.Extensions.Disposables.csproj index bbbfbb8..f2a8b28 100644 --- a/src/Uno.Core.Extensions.Disposables/Uno.Core.Extensions.Disposables.csproj +++ b/src/Uno.Core.Extensions.Disposables/Uno.Core.Extensions.Disposables.csproj @@ -1,6 +1,6 @@  - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -19,4 +19,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions.Equality/Uno.Core.Extensions.Equality.csproj b/src/Uno.Core.Extensions.Equality/Uno.Core.Extensions.Equality.csproj index 133db75..59c3e1c 100644 --- a/src/Uno.Core.Extensions.Equality/Uno.Core.Extensions.Equality.csproj +++ b/src/Uno.Core.Extensions.Equality/Uno.Core.Extensions.Equality.csproj @@ -1,6 +1,6 @@  - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -19,4 +19,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions.Logging.Singleton/Uno.Core.Extensions.Logging.Singleton.csproj b/src/Uno.Core.Extensions.Logging.Singleton/Uno.Core.Extensions.Logging.Singleton.csproj index 2db3c80..4526539 100644 --- a/src/Uno.Core.Extensions.Logging.Singleton/Uno.Core.Extensions.Logging.Singleton.csproj +++ b/src/Uno.Core.Extensions.Logging.Singleton/Uno.Core.Extensions.Logging.Singleton.csproj @@ -1,6 +1,6 @@  - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -43,4 +43,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions.Logging/Uno.Core.Extensions.Logging.csproj b/src/Uno.Core.Extensions.Logging/Uno.Core.Extensions.Logging.csproj index aa1f69c..5884fda 100644 --- a/src/Uno.Core.Extensions.Logging/Uno.Core.Extensions.Logging.csproj +++ b/src/Uno.Core.Extensions.Logging/Uno.Core.Extensions.Logging.csproj @@ -1,6 +1,6 @@  - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -33,4 +33,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions.Threading/Uno.Core.Extensions.Threading.csproj b/src/Uno.Core.Extensions.Threading/Uno.Core.Extensions.Threading.csproj index 1e4bda6..253d2f2 100644 --- a/src/Uno.Core.Extensions.Threading/Uno.Core.Extensions.Threading.csproj +++ b/src/Uno.Core.Extensions.Threading/Uno.Core.Extensions.Threading.csproj @@ -1,6 +1,6 @@  - net6.0;uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0 + net5.0;net6.0;net7.0;uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -28,4 +28,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Extensions/Uno.Core.Extensions.csproj b/src/Uno.Core.Extensions/Uno.Core.Extensions.csproj index aa66333..19dfaf2 100644 --- a/src/Uno.Core.Extensions/Uno.Core.Extensions.csproj +++ b/src/Uno.Core.Extensions/Uno.Core.Extensions.csproj @@ -1,6 +1,6 @@  - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 $(AssemblyName) ($(TargetFramework)) $(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105 $(NoWarn);SYSLIB0011 @@ -31,4 +31,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs b/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs index 5d7b128..7e6c91e 100644 --- a/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs +++ b/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs @@ -28,6 +28,7 @@ public class ListExtensionsFixture { private static readonly int[] list = new [] { 1, 2, 3}; +#if !NET7_0_OR_GREATER [TestMethod] public void AsReadOnly() { @@ -35,6 +36,7 @@ public void AsReadOnly() Assert.IsTrue(list2.AsReadOnly().IsReadOnly); } +#endif [TestMethod] public void Adapt() diff --git a/src/Uno.Core.Tests/Uno.Core.Tests.csproj b/src/Uno.Core.Tests/Uno.Core.Tests.csproj index 85d12a9..562b786 100644 --- a/src/Uno.Core.Tests/Uno.Core.Tests.csproj +++ b/src/Uno.Core.Tests/Uno.Core.Tests.csproj @@ -16,10 +16,6 @@ - - all - runtime; build; native; contentfiles; analyzers - @@ -33,4 +29,4 @@ - \ No newline at end of file + diff --git a/src/Uno.Core/Uno.Core.csproj b/src/Uno.Core/Uno.Core.csproj index 02ec55a..9d31ac7 100644 --- a/src/Uno.Core/Uno.Core.csproj +++ b/src/Uno.Core/Uno.Core.csproj @@ -3,7 +3,7 @@ - uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0 + uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0 Uno.Core Uno.Core $(AssemblyName) ($(TargetFramework)) @@ -64,4 +64,4 @@ - \ No newline at end of file +