Update the CLI to use the new Core SDK nuget package.

No need for build3 to set Platform properties and BaseNuGetRuntimeIdentifier.  The SDK handles that.

Also, no need to set "runtimes" any more in the default project.json.
This commit is contained in:
Eric Erhardt 2016-08-10 19:44:02 -05:00
parent bc04f905db
commit 6cf2167992
4 changed files with 3 additions and 46 deletions

View file

@ -2,28 +2,12 @@
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.DotNet.Core.Sdk": "1.0.0-alpha-20160811-3",
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
}
}
},
"runtimes": {
"win7-x64": {},
"win7-x86": {},
"win81-x64": {},
"win81-x86": {},
"win10-x64": {},
"win10-x86": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"ubuntu.16.04-x64": {},
"centos.7-x64": {},
"rhel.7.2-x64": {},
"debian.8-x64": {},
"fedora.23-x64": {},
"opensuse.13.2-x64": {}
},
}
}

View file

@ -6,8 +6,6 @@ using Microsoft.DotNet.PlatformAbstractions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Cli
{
@ -35,18 +33,9 @@ namespace Microsoft.DotNet.Cli
{
{ "MSBuildExtensionsPath", AppContext.BaseDirectory },
{ "DotnetHostPath", GetHostPath() },
{ "BaseNuGetRuntimeIdentifier", GetCurrentBaseRid() },
{ "Platform", GetCurrentArchitecture() },
{ "PlatformTarget", GetCurrentArchitecture() }
};
}
private static string GetCurrentBaseRid()
{
return RuntimeEnvironment.GetRuntimeIdentifier()
.Replace("-" + RuntimeEnvironment.RuntimeArchitecture, "");
}
private static string GetHostPath()
{
return new Muxer().MuxerPath;
@ -58,10 +47,5 @@ namespace Microsoft.DotNet.Cli
AppContext.BaseDirectory,
s_msbuildExeName);
}
private static string GetCurrentArchitecture()
{
return RuntimeEnvironment.RuntimeArchitecture;
}
}
}

View file

@ -3,14 +3,12 @@
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.DotNet.Core.Sdk": "1.0.0-alpha-20160811-3",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
},
"runtimes": {
"$currentruntime$": {}
}
}

View file

@ -98,15 +98,6 @@ namespace Microsoft.DotNet.Tools.New
File.Move(
Path.Combine(projectDirectory, "project.json.template"),
projectJsonFile);
string originalProjectJsonText = File.ReadAllText(projectJsonFile);
string replacedProjectJsonText = originalProjectJsonText
.Replace("$currentruntime$", RuntimeEnvironment.GetRuntimeIdentifier());
if (replacedProjectJsonText != originalProjectJsonText)
{
File.WriteAllText(projectJsonFile, replacedProjectJsonText);
}
}
private static void ReplaceFileTemplateNames(string projectDirectory)