Updating dotnet-watch to netstandard

This commit is contained in:
moozzyk 2016-03-28 16:47:18 -07:00
Родитель aa2b726363
Коммит 46d4c6edcb
8 изменённых файлов: 80 добавлений и 51 удалений

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

@ -13,15 +13,18 @@
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-*",
"Microsoft.Extensions.Logging.Abstractions": "1.0.0-*",
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-*",
"Microsoft.NETCore.Platforms": "1.0.1-*",
"NETStandard.Library": "1.5.0-*",
"Microsoft.Extensions.Process.Sources": {
"type": "build",
"version": "1.0.0-*"
}
},
"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8"
"netstandard1.5": {
"imports": [
"dnxcore50",
"portable-net451+win8"
]
}
}
}

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

@ -11,12 +11,20 @@
"Microsoft.DotNet.Watcher.Core": "1.0.0-*",
"Microsoft.Extensions.CommandLineUtils": "1.0.0-*",
"Microsoft.Extensions.Logging": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.NETCore.Platforms": "1.0.1-*"
"Microsoft.Extensions.Logging.Console": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8"
"netstandard1.5": {
"imports": [
"portable-net451+win8",
"dnxcore50"
],
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
}
}
}
}
}

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

@ -3,18 +3,23 @@
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Dependency": "1.0.0",
"NETStandard.Library": "1.0.0-*"
"Dependency": "1.0.0"
},
"frameworks": {
"dnxcore50": {
"netstandardapp1.5": {
"dependencies": {
"System.Console": "4.0.0-*",
"System.Diagnostics.Process": "4.1.0-*",
"System.IO": "4.0.11-*",
"System.IO.FileSystem": "4.0.1-*"
}
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
}
},
"imports": [
"dnxcore50",
"portable-net451+win8"
]
}
}
}

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

@ -1,18 +1,16 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.0.0-*"
"NETStandard.Library": "1.5.0-*"
},
"frameworks": {
"dnxcore50": {
"dependencies": {
"System.Console": "4.0.0-*",
"System.Diagnostics.Process": "4.1.0-*",
"System.IO": "4.0.11-*",
"System.IO.FileSystem": "4.0.1-*"
}
"netstandardapp1.5": {
"imports": [
"dnxcore50",
"portable-net451+win8"
]
}
}
}

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

@ -10,18 +10,19 @@
"exclude": [
"exclude/*"
],
"dependencies": {
"NETStandard.Library": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"netstandardapp1.5": {
"dependencies": {
"System.Console": "4.0.0-*",
"System.Diagnostics.Process": "4.1.0-*",
"System.IO": "4.0.11-*",
"System.IO.FileSystem": "4.0.1-*"
}
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
}
},
"imports": [
"dnxcore50",
"portable-net451+win8"
]
}
}
}

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

@ -4,18 +4,18 @@
"emitEntryPoint": true
},
"dependencies": {
"NETStandard.Library": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"netstandardapp1.5": {
"dependencies": {
"System.Console": "4.0.0-*",
"System.Diagnostics.Process": "4.1.0-*",
"System.IO": "4.0.11-*",
"System.IO.FileSystem": "4.0.1-*"
}
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
}
},
"imports": [
"dnxcore50",
"portable-net451+win8"
]
}
}
}

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

@ -15,12 +15,14 @@ namespace Microsoft.DotNet.Watcher.FunctionalTests
{
private const string NugetConfigFileName = "NuGet.config";
private static readonly object _restoreLock = new object();
public ProjectToolScenario()
{
Console.WriteLine($"The temporary test folder is {TempFolder}");
WorkFolder = Path.Combine(TempFolder, "work");
CreateTestDirectory();
}
@ -65,7 +67,13 @@ namespace Microsoft.DotNet.Watcher.FunctionalTests
Console.WriteLine($"Adding {toolName} to {projectFile}");
var projectJson = JObject.Parse(File.ReadAllText(projectFile));
projectJson.Add("tools", new JObject(new JProperty(toolName, "1.0.0-*")));
projectJson.Add("tools",
new JObject(
new JProperty(toolName,
new JObject(
new JProperty("version", "1.0.0-*"),
new JProperty("imports", "portable-net451+win8")))));
File.WriteAllText(projectFile, projectJson.ToString());
}
@ -80,12 +88,18 @@ namespace Microsoft.DotNet.Watcher.FunctionalTests
project = Path.Combine(WorkFolder, project);
}
var restore = ExecuteDotnet($"restore -v Minimal", project);
restore.WaitForExit();
if (restore.ExitCode != 0)
// Tests are run in parallel and they try to restore tools concurrently.
// This causes issues because the deps json file for a tool is being written from
// multiple threads - which results in either sharing violation or corrupted json.
lock(_restoreLock)
{
throw new Exception($"Exit code {restore.ExitCode}");
var restore = ExecuteDotnet($"restore -v Minimal", project);
restore.WaitForExit();
if (restore.ExitCode != 0)
{
throw new Exception($"Exit code {restore.ExitCode}");
}
}
}

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

@ -11,7 +11,7 @@
"version": "1.0.0-*"
},
"Microsoft.DotNet.Watcher.Core": "1.0.0-*",
"Microsoft.NETCore.Platforms": "1.0.1-*",
"NETStandard.Library": "1.5.0-*",
"Newtonsoft.Json": "8.0.2",
"System.Threading.Thread": "4.0.0-*",
"xunit": "2.1.0"