Bring Host build into separate project
This commit is contained in:
parent
07b785c183
commit
7bf08c5bd5
76 changed files with 1065 additions and 320 deletions
32
build_projects/shared-build-targets-utils/Utils/EnvVars.cs
Normal file
32
build_projects/shared-build-targets-utils/Utils/EnvVars.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public class EnvVars
|
||||
{
|
||||
public static readonly bool Verbose = GetBool("DOTNET_BUILD_VERBOSE");
|
||||
|
||||
private static bool GetBool(string name, bool defaultValue = false)
|
||||
{
|
||||
var str = Environment.GetEnvironmentVariable(name);
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
switch (str.ToLowerInvariant())
|
||||
{
|
||||
case "true":
|
||||
case "1":
|
||||
case "yes":
|
||||
return true;
|
||||
case "false":
|
||||
case "0":
|
||||
case "no":
|
||||
return false;
|
||||
default:
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue