Improved VSO build logging during VS Environment Variable collection.
This commit is contained in:
parent
f7cba8a630
commit
9185f5772a
1 changed files with 11 additions and 2 deletions
|
@ -112,7 +112,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
{
|
{
|
||||||
// Need to load up the VS Vars
|
// Need to load up the VS Vars
|
||||||
var dotnet = DotNetCli.Stage2;
|
var dotnet = DotNetCli.Stage2;
|
||||||
var vsvars = LoadVsVars();
|
var vsvars = LoadVsVars(c);
|
||||||
|
|
||||||
// Copy the test projects
|
// Copy the test projects
|
||||||
var testProjectsDir = Path.Combine(Dirs.TestOutput, "TestProjects");
|
var testProjectsDir = Path.Combine(Dirs.TestOutput, "TestProjects");
|
||||||
|
@ -197,12 +197,14 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
return c.Success();
|
return c.Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Dictionary<string, string> LoadVsVars()
|
private static Dictionary<string, string> LoadVsVars(BuildTargetContext c)
|
||||||
{
|
{
|
||||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
{
|
{
|
||||||
return new Dictionary<string, string>();
|
return new Dictionary<string, string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.Info("Start Collecting Visual Studio Environment Variables");
|
||||||
|
|
||||||
var vsvarsPath = Path.GetFullPath(Path.Combine(Environment.GetEnvironmentVariable("VS140COMNTOOLS"), "..", "..", "VC"));
|
var vsvarsPath = Path.GetFullPath(Path.Combine(Environment.GetEnvironmentVariable("VS140COMNTOOLS"), "..", "..", "VC"));
|
||||||
|
|
||||||
|
@ -228,13 +230,20 @@ set");
|
||||||
File.Delete(temp);
|
File.Delete(temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result.EnsureSuccessful();
|
result.EnsureSuccessful();
|
||||||
|
|
||||||
var vars = new Dictionary<string, string>();
|
var vars = new Dictionary<string, string>();
|
||||||
foreach (var line in result.StdOut.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
|
foreach (var line in result.StdOut.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
|
||||||
{
|
{
|
||||||
|
c.Info($"Adding variable '{line}'");
|
||||||
|
|
||||||
var splat = line.Split(new[] { '=' }, 2);
|
var splat = line.Split(new[] { '=' }, 2);
|
||||||
vars[splat[0]] = splat[1];
|
vars[splat[0]] = splat[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.Info("Finish Collecting Visual Studio Environment Variables");
|
||||||
|
|
||||||
return vars;
|
return vars;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue