dotnet-installer/test/EndToEnd/SupportedNetCoreAppVersions.cs

77 lines
2.6 KiB
C#
Raw Normal View History

2018-11-08 20:11:30 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace EndToEnd
{
public static class TargetFrameworkHelper
{
private static Version _firstNetAppVersion = new Version(5, 0);
public static IEnumerable<string> GetNetAppTargetFrameworks(IEnumerable<string> versions) =>
versions.Select(v => $"netcoreapp{v}")
// Add netX.X tfms starting with 5.0
.Concat(versions.Where(v => Version.Parse(v) >= _firstNetAppVersion).Select(v => $"net{v}"));
}
public class SupportedNetCoreAppVersions : IEnumerable<object[]>
{
public IEnumerator<object[]> GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
public static IEnumerable<string> Versions => new[]
{
"1.0",
"1.1",
"2.0",
"2.1",
"2.2",
"3.0",
"3.1",
[master] Update dependencies from dotnet/sdk (#8235) [master] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.NETCore.App.Ref: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 (parent: Microsoft.NET.Sdk) - Microsoft.NETCore.App.Internal: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 (parent: Microsoft.NET.Sdk) - Microsoft.NETCore.App.Runtime.win-x64: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 (parent: Microsoft.NET.Sdk) - Microsoft.NETCore.App.Host.win-x64: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 (parent: Microsoft.NET.Sdk) - Microsoft.NETCore.DotNetHostResolver: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 (parent: Microsoft.NET.Sdk) - Microsoft.NETCore.Platforms: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Ref: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Runtime.win-x64: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 (parent: Microsoft.NET.Sdk) - VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 (parent: Microsoft.NET.Sdk) - dotnet-dev-certs: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 (parent: Microsoft.NET.Sdk) - dotnet-user-secrets: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 (parent: Microsoft.NET.Sdk) - dotnet-watch: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 (parent: Microsoft.NET.Sdk) - Microsoft.DotNet.Common.ItemTemplates: from 5.0.0-rc.1.20419.1 to 6.0.0-alpha.1.20454.5 (parent: Microsoft.NET.Sdk) - Updates: - Microsoft.DotNet.MSBuildSdkResolver: from 5.0.100-rc.1.20420.8 to 6.0.100-alpha.1.20454.15 - Microsoft.NET.Sdk: from 5.0.100-rc.1.20420.8 to 6.0.100-alpha.1.20454.15 - Microsoft.NETCore.App.Ref: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 - Microsoft.NETCore.App.Internal: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 - Microsoft.NETCore.App.Runtime.win-x64: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 - Microsoft.NETCore.App.Host.win-x64: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 - Microsoft.NETCore.DotNetHostResolver: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 - Microsoft.NETCore.Platforms: from 5.0.0-rc.1.20417.14 to 6.0.0-alpha.1.20453.28 - Microsoft.AspNetCore.App.Ref: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 - Microsoft.AspNetCore.App.Runtime.win-x64: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 - VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 - dotnet-dev-certs: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 - dotnet-user-secrets: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 - dotnet-watch: from 5.0.0-rc.1.20419.22 to 5.0.0-rc.2.20454.3 - Microsoft.DotNet.Common.ItemTemplates: from 5.0.0-rc.1.20419.1 to 6.0.0-alpha.1.20454.5 - Update NuGet.config - Updates for 6.0 runtime - Reenabling test - Fixup toolset base url
2020-09-04 22:28:24 +00:00
"5.0",
2022-01-13 19:27:43 +00:00
"6.0",
"7.0"
};
public static IEnumerable<string> TargetFrameworkShortFolderVersion
{
get
{
var targetFrameworkShortFolderVersion = new List<string>();
foreach (var v in Versions)
{
if (Version.Parse(v).Major >= 5)
{
targetFrameworkShortFolderVersion.Add($"net{v}");
}
else
{
targetFrameworkShortFolderVersion.Add($"netcoreapp{v}");
}
}
return targetFrameworkShortFolderVersion;
}
}
}
public class SupportedAspNetCoreVersions : IEnumerable<object[]>
{
public IEnumerator<object[]> GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
public static IEnumerable<string> Versions =>
SupportedNetCoreAppVersions.Versions.Except(new List<string>() { "1.0", "1.1", "2.0" });
}
2018-11-08 20:11:30 +00:00
public class SupportedAspNetCoreAllVersions : IEnumerable<object[]>
{
public IEnumerator<object[]> GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
public static IEnumerable<string> Versions =>
SupportedAspNetCoreVersions.Versions.Where(v => new Version(v).Major < 3);
2018-11-08 20:11:30 +00:00
}
}
2020-03-25 16:13:14 +00:00