Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Extend SupportedSDK list and add Sdk5.0/6.0 templates #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main/external/fsharpbinding/paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version 5.201.1
framework: net472
source https://nuget.org/api/v2/
source https://api.nuget.org/v3/index.json

nuget ExtCore framework: >= net40
nuget FSharp.Compiler.Service 31.0.0
Expand Down
2 changes: 1 addition & 1 deletion main/external/fsharpbinding/paket.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RESTRICTION: == net472
NUGET
remote: https://www.nuget.org/api/v2
remote: https://api.nuget.org/v3/index.json
ExtCore (0.8.46)
FAKE (5.8.4)
Fantomas (3.0.0-beta-002)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace MonoDevelop.DotNetCore.Templating
[Extension]
class DotNetCoreProjectTemplateStringTagProvider : IStringTagProvider
{
readonly string [] SupportedSDK = { "2.1", "2.2", "3.0", "3.1" };
readonly string [] SupportedSDK = { "2.1", "2.2", "3.0", "3.1", "5.0", "6.0" };

public IEnumerable<StringTagDescription> GetTags (Type type)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace MonoDevelop.DotNetCore.Templating
{
class DotNetCoreProjectTemplateWizard : TemplateWizard
{
const string defaultParameterNetCore60 = "UseNetCore60";
const string defaultParameterNetCore50 = "UseNetCore50";
const string defaultParameterNetCore30 = "UseNetCore30";
const string defaultParameterNetCore20 = "UseNetCore20";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static IEnumerable<TargetFramework> GetKnownNetCoreAppFrameworks ()

public static IEnumerable<TargetFramework> GetNetStandardTargetFrameworks ()
{
if (DotNetCoreRuntime.IsNetCore30Installed () || MonoRuntimeInfoExtensions.CurrentRuntimeVersion.SupportsNetStandard21 ())
if (DotNetCoreRuntime.IsNetCore3xOrHigherInstalled () || MonoRuntimeInfoExtensions.CurrentRuntimeVersion.SupportsNetStandard21 ())
yield return CreateTargetFramework (".NETStandard", "2.1");

if (DotNetCoreRuntime.IsNetCore2xInstalled () || MonoRuntimeInfoExtensions.CurrentRuntimeVersion.SupportsNetStandard20 ())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// THE SOFTWARE.

using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using MonoDevelop.Core;

Expand Down Expand Up @@ -124,6 +124,10 @@ internal static bool IsNetCore30Installed ()
return Versions.Any (version => version.Major == 3 && version.Minor == 0);
}

internal static bool IsNetCore3xOrHigherInstalled ()
{
return Versions.Any (version => version.Major >= 3);
}

/// <summary>
/// Used by unit tests to fake having different .NET Core sdks installed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ namespace MonoDevelop.DotNetCore
{
class DotNetCoreVersion : IEquatable<DotNetCoreVersion>, IComparable, IComparable<DotNetCoreVersion>
{
internal static readonly DotNetCoreVersion MinimumSupportedSdkVersion = new DotNetCoreVersion (2, 1, 602);
internal static readonly DotNetCoreVersion MinimumSupportedSdkVersion = new DotNetCoreVersion (2, 1, 30);
internal static readonly DotNetCoreVersion MinimumSupportedSdkVersion22 = new DotNetCoreVersion (2, 2, 202);
internal static readonly DotNetCoreVersion MinimumSupportedSdkVersion30 = new DotNetCoreVersion (3, 0, 100) {
ReleaseLabel = "preview3-010431",
IsPrerelease = true
};
internal static readonly DotNetCoreVersion MinimumSupportedSdkVersion50 = new DotNetCoreVersion (5, 0, 400);
internal static readonly DotNetCoreVersion MinimumSupportedSdkVersion60 = new DotNetCoreVersion (6, 0, 6);

internal DotNetCoreVersion (int major, int minor, int patch)
: this (new Version (major, minor, patch))
Expand Down Expand Up @@ -244,6 +246,16 @@ public static bool IsSdkSupported (DotNetCoreVersion version)
return version >= MinimumSupportedSdkVersion30;
}

if (version.Major == 5) {
return version >= MinimumSupportedSdkVersion50;
}

if (version.Major == 6) {
return version >= MinimumSupportedSdkVersion60;
}



return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ namespace MonoDevelop.DotNetCore
static class MonoRuntimeInfoExtensions
{
static readonly Version MonoVersion5_4 = new Version (5, 4, 0);
static readonly Version MonoVersion6_4 = new Version (6, 4, 0);
static readonly Version DotNetCore2_1 = new Version (2, 1);


internal static Version CurrentRuntimeVersion { get; set; } = MonoRuntimeInfo.FromCurrentRuntime ()?.RuntimeVersion ?? new Version ();

public static bool SupportsNetStandard20 (this Version monoVersion)
Expand All @@ -43,8 +45,8 @@ public static bool SupportsNetStandard20 (this Version monoVersion)

public static bool SupportsNetStandard21 (this Version monoVersion)
{
//FIXME: update this: which Mono version will support .NET Standadrd 2.1
return false;
// ref https://www.mono-project.com/docs/about-mono/releases/6.4.0/
return monoVersion >= MonoVersion6_4; ;
}

public static bool SupportsNetCore (this Version monoVersion, string netCoreVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static string GetDisplayName (this TargetFramework framework)
if (framework.IsNetCoreApp ()) {
// Display shortened framework names for .net5.0 and above in NewProject dialog
if (version.Major >= 5) {
return string.Format (".net {0}", framework.Id.Version);
return string.Format (".net{0}", framework.Id.Version);
} else {
return string.Format (".NET Core {0}", framework.Id.Version);
return string.Format (".netcoreapp{0}", framework.Id.Version);
}
}

Expand Down
Loading