Merge pull request #2151 from dotnet/brthor/remove-oob-commands

Remove OOB Commands and Pdbs from stage2
This commit is contained in:
Bryan Thornbury 2016-03-30 21:28:27 -07:00
commit 164a235a20
4 changed files with 24 additions and 10 deletions

View file

@ -20,9 +20,7 @@ namespace Microsoft.DotNet.Cli.Build
public static readonly string[] BinariesForCoreHost = new[]
{
"csi",
"csc",
"vbc"
"csc"
};
public static readonly string[] ProjectsToPublish = new[]
@ -32,7 +30,7 @@ namespace Microsoft.DotNet.Cli.Build
public static readonly string[] FilesToClean = new[]
{
"README.md"
"vbc.exe"
};
public static readonly string[] ProjectsToPack = new[]
@ -250,9 +248,13 @@ namespace Microsoft.DotNet.Cli.Build
CopySharedHost(Dirs.Stage1);
PublishSharedFramework(c, Dirs.Stage1, DotNetCli.Stage0);
return CompileCliSdk(c,
var result = CompileCliSdk(c,
dotnet: DotNetCli.Stage0,
outputDir: Dirs.Stage1);
CleanOutputDir(Path.Combine(Dirs.Stage1, "sdk"));
return result;
}
[Target]
@ -299,9 +301,17 @@ namespace Microsoft.DotNet.Cli.Build
}
}
CleanOutputDir(Path.Combine(Dirs.Stage2, "sdk"));
return c.Success();
}
private static void CleanOutputDir(string directory)
{
FS.RmFilesInDirRecursive(directory, "vbc.exe");
FS.RmFilesInDirRecursive(directory, "*.pdb");
}
private static void CopySharedHost(string outputDir)
{
// corehost will be renamed to dotnet at some point and then this can be removed.

View file

@ -34,6 +34,15 @@ namespace Microsoft.DotNet.Cli.Build
}
}
public static void RmFilesInDirRecursive(string dir, string filePattern)
{
var files = Directory.EnumerateFiles(dir, filePattern, SearchOption.AllDirectories);
foreach (var file in files)
{
FS.Rm(file);
}
}
public static void Chmod(string file, string mode, bool recursive = false)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))