Skip to content

Commit

Permalink
Merge pull request #90 from Youssef1313/net7-update
Browse files Browse the repository at this point in the history
build!: Support net7.0 to remove extensions ambiguous with BCL ones
  • Loading branch information
jeromelaban authored Jun 12, 2024
2 parents 2188706 + 70114fe commit c499a99
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 40 deletions.
11 changes: 9 additions & 2 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:

- task: gitversion/setup@0
inputs:
versionSpec: '5.6.8'
versionSpec: '5.10.3'

- task: gitversion/execute@0
inputs:
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions doc/ReleaseNotes/_ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\build\uno-logo.png" Pack="true" Visible="false" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Uno.MonoAnalyzers" Version="1.0.0-dev.4" Condition="'$(TargetFramework)'=='netstandard2.0'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Choose>
<When Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false' and '$(IsSampleProject)' != 'true'">
Expand Down
6 changes: 1 addition & 5 deletions src/Uno.Core.Build/Uno.Core.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@
<ExcludeAssets>runtime</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Uno.MonoAnalyzers" Version="1.0.0-dev.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="Publish" />
Expand All @@ -114,4 +110,4 @@
<MSBuild Properties="Configuration=$(Configuration);Platform=AnyCPU" Targets="Build" Projects="..\Uno.Core\Uno.Core.csproj" RebaseOutputs="false" />
</Target>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ public static IEnumerable SelectManyUntyped<TSource>(this IEnumerable<TSource> s
}
}

#if !XAMARIN
#if !XAMARIN && !NET7_0 && !NETSTANDARD2_1
/// <summary>
/// Skips the last <paramref name="count"/> items from an enumerable sequence.
/// </summary>
Expand Down
5 changes: 3 additions & 2 deletions src/Uno.Core.Extensions.Collections/ListExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace Uno.Extensions
/// </summary>
public static class ListExtensions
{
#if !NET7_0
/// <summary>
/// Returns a readonly instance of the specified list.
/// </summary>
Expand All @@ -39,6 +40,7 @@ public static IList<T> AsReadOnly<T>(this IList<T> items)
{
return new ReadOnlyCollection<T>(items);
}
#endif

public static void AddRange(this IList destination, IEnumerable source)
{
Expand All @@ -48,7 +50,6 @@ public static void AddRange(this IList destination, IEnumerable source)
}
}


/// <summary>
/// Adds the items of the specified collection to the end of the ICollection, but only if they
/// are not already present.
Expand Down Expand Up @@ -305,4 +306,4 @@ public static bool SequenceKeyEqual<T>(this IList<T> first, IList<T> second)
return true;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand Down Expand Up @@ -42,4 +42,4 @@
<ProjectReference Include="..\Uno.Core.Extensions.Disposables\Uno.Core.Extensions.Disposables.csproj" />
<ProjectReference Include="..\Uno.Core.Extensions.Equality\Uno.Core.Extensions.Equality.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand Down Expand Up @@ -52,4 +52,4 @@
<ProjectReference Include="..\Uno.Core.Extensions\Uno.Core.Extensions.csproj" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand All @@ -19,4 +19,4 @@

<Import Project="..\Uno.CrossTargeting.props" />
<Import Project="..\Uno.Common.props" />
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand All @@ -19,4 +19,4 @@

<Import Project="..\Uno.CrossTargeting.props" />
<Import Project="..\Uno.Common.props" />
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand Down Expand Up @@ -43,4 +43,4 @@
</ItemGroup>
</Otherwise>
</Choose>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand Down Expand Up @@ -33,4 +33,4 @@
</Otherwise>
</Choose>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net6.0;uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0;net7.0;uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand Down Expand Up @@ -28,4 +28,4 @@
<ItemGroup>
<ProjectReference Include="..\Uno.Core.Extensions.Disposables\Uno.Core.Extensions.Disposables.csproj" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/Uno.Core.Extensions/Uno.Core.Extensions.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<NoWarn>$(NoWarn);1998;1591;1573;1572;1574;1712;1711;1570;NU5105</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn> <!-- Binary formatter is obsolete -->
Expand Down Expand Up @@ -31,4 +31,4 @@
</Otherwise>
</Choose>

</Project>
</Project>
2 changes: 2 additions & 0 deletions src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ public class ListExtensionsFixture
{
private static readonly int[] list = new [] { 1, 2, 3};

#if !NET7_0_OR_GREATER
[TestMethod]
public void AsReadOnly()
{
IList<int> list2 = new List<int>(list);

Assert.IsTrue(list2.AsReadOnly().IsReadOnly);
}
#endif

[TestMethod]
public void Adapt()
Expand Down
6 changes: 1 addition & 5 deletions src/Uno.Core.Tests/Uno.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="Uno.MonoAnalyzers" Version="1.0.0-dev.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand All @@ -33,4 +29,4 @@
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions src/Uno.Core/Uno.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--<Sdk Name="Microsoft.DotNet.PackageValidation" Version="1.0.0-preview.7.21379.12" />-->

<PropertyGroup>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>uap10.0.17763;uap10.0.19041;net46;netstandard2.0;netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<AssemblyName>Uno.Core</AssemblyName>
<RootNamespace>Uno.Core</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
Expand Down Expand Up @@ -64,4 +64,4 @@
<ProjectReference Include="..\Uno.Core.Extensions.Compatibility\Uno.Core.Extensions.Compatibility.csproj" />
</ItemGroup>

</Project>
</Project>

0 comments on commit c499a99

Please sign in to comment.