code review feedback

This commit is contained in:
Andrew Stanton-Nurse 2015-12-01 10:51:45 -08:00
parent 462bbb4f5b
commit 6a2d6f7d30
2 changed files with 2 additions and 27 deletions

View file

@ -5,6 +5,8 @@
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.Runtime": "1.0.1-beta-23504",
"System.Console": "4.0.0-beta-23504",
"System.Collections": "4.0.11-beta-23504",
"System.Linq": "4.0.1-beta-23504",

View file

@ -4,8 +4,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.Dnx.Runtime.Common.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.ProjectModel;
@ -176,33 +174,8 @@ namespace Microsoft.DotNet.Tools.Publish
// Copy the host
File.Copy(hostPath, outputExe, overwrite: true);
// Publish the runtime
var runtimePath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "runtime", "coreclr"));
if(!Directory.Exists(runtimePath))
{
Reporter.Error.WriteLine($"Unable to find runtime in expected location: {runtimePath}");
return 1;
}
Reporter.Verbose.WriteLine($"Publishing runtime from {runtimePath.Cyan()}");
CopyFolder(runtimePath, outputPath);
return 0;
}
private static void CopyFolder(string sourceFolder, string targetFolder)
{
foreach (var filePath in Directory.EnumerateFiles(sourceFolder))
{
var fileName = Path.GetFileName(filePath);
File.Copy(filePath, Path.Combine(targetFolder, fileName), overwrite: true);
}
foreach (var folderPath in Directory.EnumerateDirectories(sourceFolder))
{
var folderName = new DirectoryInfo(folderPath).Name;
CopyFolder(folderPath, Path.Combine(targetFolder, folderName));
}
}
private static void PublishFiles(IEnumerable<LibraryAsset> files, string outputPath)
{