This commit is contained in:
Pavel Krymets 2016-03-17 08:27:00 -07:00
Родитель 55a29123cc
Коммит 199bc294b6
6 изменённых файлов: 34 добавлений и 1 удалений

Просмотреть файл

@ -92,7 +92,8 @@ sealed class DomainManager
FrameworkName fx;
if (Microsoft.Dnx.Host.FrameworkNameUtility.TryParseFrameworkName(key, out fx) &&
fx.Identifier.Equals(FrameworkNames.LongNames.DnxCore, StringComparison.Ordinal) ||
fx.Identifier.Equals(FrameworkNames.LongNames.NetStandardApp, StringComparison.Ordinal))
fx.Identifier.Equals(FrameworkNames.LongNames.NetStandardApp, StringComparison.Ordinal) ||
fx.Identifier.Equals(FrameworkNames.LongNames.NetCoreApp, StringComparison.Ordinal))
{
return fx;
}

Просмотреть файл

@ -70,6 +70,11 @@ namespace Microsoft.Dnx.Host
parsed = new FrameworkName(FrameworkNames.LongNames.NetStandardApp, new Version(1, 5));
return true;
}
else if (frameworkName == FrameworkNames.ShortNames.NetCoreApp10)
{
parsed = new FrameworkName(FrameworkNames.LongNames.NetCoreApp, new Version(1, 0));
return true;
}
return false;
}

Просмотреть файл

@ -25,6 +25,9 @@ namespace Microsoft.Dnx.Runtime.Common.Impl
public const string NetStandardApp = "netstandardapp";
public const string NetStandardApp15 = NetStandardApp + "1.5";
public const string NetCoreApp = "netcoreapp";
public const string NetCoreApp10 = NetCoreApp + "1.0";
}
public static class LongNames
@ -42,6 +45,7 @@ namespace Microsoft.Dnx.Runtime.Common.Impl
public const string DnxCore50 = DnxCore + VersionPrefix + "5.0";
public const string NetStandardApp = ".NETStandardApp";
public const string NetCoreApp = ".NETCoreApp";
}
}
}

Просмотреть файл

@ -10,6 +10,9 @@ namespace NuGet
private static readonly Version _version45 = new Version(4, 5);
private static readonly Dictionary<FrameworkName, Version> _generationMappings = new Dictionary<FrameworkName, Version>()
{
// netcoredapp
{ new FrameworkName(VersionUtility.NetCoreAppFrameworkIdentifier, new Version(1, 0)), new Version(1, 5) },
// netstandardapp
{ new FrameworkName(VersionUtility.NetStandardAppFrameworkIdentifier, new Version(1, 5)), new Version(1, 5) },
@ -105,10 +108,16 @@ namespace NuGet
{
yield return new FrameworkName(VersionUtility.DnxCoreFrameworkIdentifier, Microsoft.Dnx.Runtime.Constants.Version50);
}
// netcoreapp -> dnxcore
else if (candidate.Identifier.Equals(VersionUtility.NetCoreAppFrameworkIdentifier) && candidate.Version == new Version(1, 0))
{
yield return new FrameworkName(VersionUtility.DnxCoreFrameworkIdentifier, Microsoft.Dnx.Runtime.Constants.Version50);
}
// dnxcore -> netstandardapp
else if (candidate.Identifier.Equals(VersionUtility.DnxCoreFrameworkIdentifier) && candidate.Version == Microsoft.Dnx.Runtime.Constants.Version50)
{
yield return new FrameworkName(VersionUtility.NetStandardAppFrameworkIdentifier, new Version(1, 5));
yield return new FrameworkName(VersionUtility.NetCoreAppFrameworkIdentifier, new Version(1, 0));
}
// dnxN -> netN -> dotnetY
else if (candidate.Identifier.Equals(VersionUtility.DnxFrameworkIdentifier))

Просмотреть файл

@ -26,6 +26,7 @@ namespace NuGet
public static readonly string NetStandardFrameworkIdentifier = ".NETStandard";
public static readonly string NetStandardAppFrameworkIdentifier = ".NETStandardApp";
public static readonly string NetCoreFrameworkIdentifier = ".NETCore";
public static readonly string NetCoreAppFrameworkIdentifier = ".NETCoreApp";
public static readonly string UapFrameworkIdentifier = "UAP";
public static readonly string WindowsFrameworkIdentifier = "Windows";
public static readonly string WindowsPhoneFrameworkIdentifier = "WindowsPhone";
@ -39,6 +40,7 @@ namespace NuGet
internal const string NetPlatformFrameworkShortName = "dotnet";
internal const string NetStandardFrameworkShortName = "netstandard";
internal const string NetStandardAppFrameworkShortName = "netstandardapp";
internal const string NetCoreAppFrameworkShortName = "netcoreapp";
private const string LessThanOrEqualTo = "\u2264";
private const string GreaterThanOrEqualTo = "\u2265";
@ -67,6 +69,7 @@ namespace NuGet
{ NetPlatformFrameworkIdentifier, NetPlatformFrameworkShortName },
{ NetStandardFrameworkIdentifier, NetStandardFrameworkShortName },
{ NetStandardAppFrameworkIdentifier, NetStandardAppFrameworkShortName },
{ NetCoreAppFrameworkIdentifier, NetCoreAppFrameworkShortName },
{ UapFrameworkIdentifier, UapFrameworkIdentifier },
{ SilverlightFrameworkIdentifier, "sl" },
@ -554,6 +557,7 @@ namespace NuGet
var version = frameworkName.Version.ToString();
if (!frameworkName.Identifier.Equals(NetPlatformFrameworkIdentifier) &&
!frameworkName.Identifier.Equals(NetStandardAppFrameworkIdentifier) &&
!frameworkName.Identifier.Equals(NetCoreAppFrameworkIdentifier) &&
!frameworkName.Identifier.Equals(NetStandardFrameworkIdentifier) &&
frameworkName.Version.Major < 10 &&
frameworkName.Version.Minor < 10 &&
@ -890,6 +894,7 @@ namespace NuGet
// as this logic is super fuzzy and terrible
if (string.Equals(frameworkName.Identifier, DnxCoreFrameworkIdentifier, StringComparison.OrdinalIgnoreCase) ||
string.Equals(frameworkName.Identifier, NetStandardAppFrameworkIdentifier, StringComparison.OrdinalIgnoreCase) ||
string.Equals(frameworkName.Identifier, NetCoreAppFrameworkIdentifier, StringComparison.OrdinalIgnoreCase) ||
string.Equals(frameworkName.Identifier, NetStandardFrameworkIdentifier, StringComparison.OrdinalIgnoreCase) ||
string.Equals(frameworkName.Identifier, NetPlatformFrameworkIdentifier, StringComparison.OrdinalIgnoreCase))
{
@ -1187,6 +1192,8 @@ namespace NuGet
{ NetStandardAppFrameworkShortName, NetStandardAppFrameworkIdentifier },
{ NetStandardFrameworkIdentifier, NetStandardFrameworkIdentifier },
{ NetStandardAppFrameworkIdentifier, NetStandardAppFrameworkIdentifier },
{ NetCoreAppFrameworkShortName, NetCoreAppFrameworkIdentifier },
{ NetCoreAppFrameworkIdentifier, NetCoreAppFrameworkIdentifier },
{ UapFrameworkIdentifier, UapFrameworkIdentifier },
{ "NET", NetFrameworkIdentifier },

Просмотреть файл

@ -13,6 +13,13 @@ namespace Microsoft.Dnx.Runtime.Tests
public class VersionUtilityFacts
{
[Theory]
[InlineData("netcoreapp1.0", "netstandard1.5", true)]
[InlineData("netcoreapp1.0", "netstandard1.4", true)]
[InlineData("netcoreapp1.0", "netstandard1.3", true)]
[InlineData("netcoreapp1.0", "netstandard1.2", true)]
[InlineData("netcoreapp1.0", "netstandard1.1", true)]
[InlineData("netcoreapp1.0", "netstandard1.0", true)]
[InlineData("netcoreapp1.0", "dnxcore50", true)]
[InlineData("netstandard1.5", "netstandard1.3", true)]
[InlineData("netstandard1.3", "portable-net45+wp80+win8+wpa81+dnxcore50", true)]