2018-11-08 20:11:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
2018-06-21 17:40:44 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace EndToEnd
|
|
|
|
|
{
|
2020-03-15 13:14:26 +00:00
|
|
|
|
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}"));
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-21 17:40:44 +00:00
|
|
|
|
public class SupportedNetCoreAppVersions : IEnumerable<object[]>
|
|
|
|
|
{
|
2018-09-27 01:54:17 +00:00
|
|
|
|
public IEnumerator<object[]> GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator();
|
2018-06-21 17:40:44 +00:00
|
|
|
|
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
2020-03-15 13:14:26 +00:00
|
|
|
|
public static IEnumerable<string> Versions => new[]
|
2018-06-21 17:40:44 +00:00
|
|
|
|
{
|
2020-03-15 13:14:26 +00:00
|
|
|
|
"1.0",
|
|
|
|
|
"1.1",
|
|
|
|
|
"2.0",
|
|
|
|
|
"2.1",
|
|
|
|
|
"2.2",
|
|
|
|
|
"3.0",
|
|
|
|
|
"3.1",
|
2020-09-04 22:28:24 +00:00
|
|
|
|
"5.0",
|
2022-01-13 19:27:43 +00:00
|
|
|
|
"6.0",
|
2022-08-25 22:07:25 +00:00
|
|
|
|
"7.0",
|
2023-10-31 18:31:16 +00:00
|
|
|
|
"8.0",
|
|
|
|
|
"9.0"
|
2020-03-15 13:14:26 +00:00
|
|
|
|
};
|
2018-09-27 01:54:17 +00:00
|
|
|
|
|
2020-03-20 12:34:30 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-27 01:54:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class SupportedAspNetCoreVersions : IEnumerable<object[]>
|
|
|
|
|
{
|
|
|
|
|
public IEnumerator<object[]> GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator();
|
|
|
|
|
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
|
|
|
|
|
2020-03-15 13:14:26 +00:00
|
|
|
|
public static IEnumerable<string> Versions =>
|
|
|
|
|
SupportedNetCoreAppVersions.Versions.Except(new List<string>() { "1.0", "1.1", "2.0" });
|
2018-06-21 17:40:44 +00:00
|
|
|
|
}
|
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();
|
|
|
|
|
|
2020-03-15 13:14:26 +00:00
|
|
|
|
public static IEnumerable<string> Versions =>
|
|
|
|
|
SupportedAspNetCoreVersions.Versions.Where(v => new Version(v).Major < 3);
|
2018-11-08 20:11:30 +00:00
|
|
|
|
}
|
2018-06-21 17:40:44 +00:00
|
|
|
|
}
|
2020-03-25 16:13:14 +00:00
|
|
|
|
|