From 9f3727d1a72f5adff9553c0573080ccb27afb33e Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Thu, 24 Mar 2016 22:24:31 -0700 Subject: [PATCH] fix OSX issue in VSO build also, make it possible to have more verbose build runs when needed --- scripts/dotnet-cli-build/Utils/DotNetCli.cs | 19 +++++++---- scripts/dotnet-cli-build/Utils/EnvVars.cs | 32 +++++++++++++++++++ scripts/dotnet-cli-build/project.json | 2 +- .../CommandContext.cs | 2 +- .../project.json | 2 +- src/dotnet/project.json | 20 +++++------- 6 files changed, 56 insertions(+), 21 deletions(-) create mode 100644 scripts/dotnet-cli-build/Utils/EnvVars.cs diff --git a/scripts/dotnet-cli-build/Utils/DotNetCli.cs b/scripts/dotnet-cli-build/Utils/DotNetCli.cs index 6a1a69450..c18011d1c 100644 --- a/scripts/dotnet-cli-build/Utils/DotNetCli.cs +++ b/scripts/dotnet-cli-build/Utils/DotNetCli.cs @@ -1,9 +1,8 @@ -using System.IO; -using System.Linq; -using System; -using System.Runtime.InteropServices; -using Microsoft.DotNet.Cli.Build.Framework; +using Microsoft.DotNet.Cli.Build.Framework; using Microsoft.Extensions.PlatformAbstractions; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; namespace Microsoft.DotNet.Cli.Build { @@ -22,7 +21,15 @@ namespace Microsoft.DotNet.Cli.Build public Command Exec(string command, params string[] args) { - return Command.Create(Path.Combine(BinPath, $"dotnet{Constants.ExeSuffix}"), Enumerable.Concat(new[] { command }, args)); + var newArgs = args.ToList(); + newArgs.Insert(0, command); + + if (EnvVars.Verbose) + { + newArgs.Insert(0, "-v"); + } + + return Command.Create(Path.Combine(BinPath, $"dotnet{Constants.ExeSuffix}"), newArgs); } public Command Restore(params string[] args) => Exec("restore", args); diff --git a/scripts/dotnet-cli-build/Utils/EnvVars.cs b/scripts/dotnet-cli-build/Utils/EnvVars.cs new file mode 100644 index 000000000..62cc996cf --- /dev/null +++ b/scripts/dotnet-cli-build/Utils/EnvVars.cs @@ -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; + } + } + } +} diff --git a/scripts/dotnet-cli-build/project.json b/scripts/dotnet-cli-build/project.json index 729b4ff17..63c2a871b 100755 --- a/scripts/dotnet-cli-build/project.json +++ b/scripts/dotnet-cli-build/project.json @@ -10,7 +10,7 @@ "System.Xml.XmlSerializer": "4.0.11-rc2-23924", "Microsoft.DotNet.Cli.Build.Framework": "1.0.0-*", "WindowsAzure.Storage": "6.2.2-preview", - "System.Reflection.Metadata": "1.2.0" + "System.Reflection.Metadata": "1.3.0-rc2-23924" }, "frameworks": { "netstandardapp1.5": { diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs b/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs index b31edab08..28a7aaa3e 100644 --- a/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs +++ b/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs @@ -26,7 +26,7 @@ namespace Microsoft.DotNet.Cli.Utils { return _ansiPassThru.Value; } - + private static bool GetBool(string name, bool defaultValue = false) { var str = Environment.GetEnvironmentVariable(name); diff --git a/src/Microsoft.DotNet.ProjectModel/project.json b/src/Microsoft.DotNet.ProjectModel/project.json index 2dfbdc33c..9bd42c32d 100644 --- a/src/Microsoft.DotNet.ProjectModel/project.json +++ b/src/Microsoft.DotNet.ProjectModel/project.json @@ -5,7 +5,7 @@ }, "description": "Types to model a .NET Project", "dependencies": { - "System.Reflection.Metadata": "1.2.0-rc2-23924", + "System.Reflection.Metadata": "1.3.0-rc2-23924", "NuGet.Packaging": "3.5.0-beta-1068", "Microsoft.Extensions.FileSystemGlobbing": "1.0.0-rc2-15996", "Microsoft.Extensions.JsonParser.Sources": { diff --git a/src/dotnet/project.json b/src/dotnet/project.json index 169f75207..49dbceab3 100644 --- a/src/dotnet/project.json +++ b/src/dotnet/project.json @@ -23,10 +23,13 @@ "NuGet.CommandLine.XPlat": "3.5.0-beta-1068", "Newtonsoft.Json": "7.0.1", - "Microsoft.Net.Compilers.netcore": "1.3.0-beta1-20160225-02", + "Microsoft.CodeAnalysis.CSharp": "1.3.0-beta1-20160321-04", + "Microsoft.Net.Compilers.netcore": "1.3.0-beta1-20160321-04", + "Microsoft.Net.CSharp.Interactive.netcore": "1.3.0-beta1-20160321-04", "Microsoft.FSharp.Compiler.netcore": "1.0.0-alpha-160316", - "Microsoft.Net.CSharp.Interactive.netcore": "1.3.0-beta1-20160225-02", - "Microsoft.CodeAnalysis.CSharp": "1.3.0-beta1-20160225-02", + "System.Text.Encoding.CodePages": "4.0.1-rc2-23924", + "System.Diagnostics.FileVersionInfo": "4.0.0-rc2-23924", + "Microsoft.DiaSymReader.Native": "1.3.3", "System.CommandLine": "0.1.0-e160323-1", "Microsoft.DotNet.ProjectModel": "1.0.0-*", @@ -51,23 +54,16 @@ "Microsoft.Extensions.Testing.Abstractions": "1.0.0-*", "Microsoft.NETCore.ConsoleHost": "1.0.0-rc2-23924", "Microsoft.NETCore.TestHost": "1.0.0-rc2-23924", - "NETStandard.Library": "1.5.0-rc2-23924", - "System.Reflection.Metadata": "1.3.0-rc2-23924", - "System.Diagnostics.TextWriterTraceListener": "4.0.0-rc2-23924", + "Microsoft.NETCore.App": "1.0.0-rc2-23924", "System.Diagnostics.TraceSource": "4.0.0-rc2-23924", - "System.Linq.Expressions": "4.0.11-rc2-23924", - "System.Xml.XDocument": "4.0.11-rc2-23924", + "System.Diagnostics.TextWriterTraceListener": "4.0.0-rc2-23924", "System.Resources.ReaderWriter": "4.0.0-rc2-23924", - "System.Net.Sockets": "4.1.0-rc2-23924", - "System.Threading.ThreadPool": "4.0.10-rc2-23924", "System.Runtime.Serialization.Primitives": "4.1.1-rc2-23924", "System.Private.DataContractSerialization": "4.1.1-rc2-23924", - "System.Net.Requests": "4.0.11-rc2-23924", "Microsoft.Win32.Registry": { "version": "4.0.0-rc2-23924", "exclude": "compile" }, - "System.Net.NameResolution": "4.0.0-rc2-23924" }, "frameworks": { "netstandardapp1.5": {