Fix "-v"/"--verbosity" option.

release-1.0.0 v1.0.0
Icedream 2015-01-12 18:32:00 +01:00
parent 37b636126e
commit 35f568f1ff
1 changed files with 14 additions and 13 deletions

View File

@ -74,7 +74,7 @@ namespace CitizenMP.Server.Installer
Assembly.GetExecutingAssembly() Assembly.GetExecutingAssembly()
.GetCustomAttributes(typeof (AssemblyInformationalVersionAttribute), false) .GetCustomAttributes(typeof (AssemblyInformationalVersionAttribute), false)
.OfType<AssemblyInformationalVersionAttribute>().First().InformationalVersion, .OfType<AssemblyInformationalVersionAttribute>().First().InformationalVersion,
@"^(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<revision>[0-9]+)(\-(?<prerelease>[A-z0-9\.]+))?(\+(?<meta>.+?))?$"); @"^(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<revision>[0-9]+)(\-(?<prerelease>[A-z0-9\.]+))?(\+(?<meta>.+?))?$");
var meta = new Queue<string>(version.Groups["meta"].Value.Split('.')); var meta = new Queue<string>(version.Groups["meta"].Value.Split('.'));
while (meta.Any() && meta.First() != "Branch") while (meta.Any() && meta.First() != "Branch")
@ -242,7 +242,7 @@ namespace CitizenMP.Server.Installer
{"DebugSymbols", false.ToString()}, {"DebugSymbols", false.ToString()},
{"OutputPath", binOutputDirectory.FullName}, {"OutputPath", binOutputDirectory.FullName},
{"AllowedReferenceRelatedFileExtensions", "\".mdb\"=\"\";\".pdb\"=\"\";\".xml\"=\"\""} {"AllowedReferenceRelatedFileExtensions", "\".mdb\"=\"\";\".pdb\"=\"\";\".xml\"=\"\""}
}, logpath)) }, options.Verbosity, logpath))
{ {
Console.Error.WriteLine("Build failed! Please look at {0} for more information.", logpath); Console.Error.WriteLine("Build failed! Please look at {0} for more information.", logpath);
return 1; return 1;
@ -316,7 +316,7 @@ namespace CitizenMP.Server.Installer
} }
private static bool Build(string projectFilePath, IDictionary<string, string> buildProperties, private static bool Build(string projectFilePath, IDictionary<string, string> buildProperties,
string logPath = null) LoggerVerbosity verbosity, string logPath = null)
{ {
var workspace = new FileInfo(projectFilePath).Directory; var workspace = new FileInfo(projectFilePath).Directory;
if (workspace == null) if (workspace == null)
@ -335,7 +335,7 @@ namespace CitizenMP.Server.Installer
try try
{ {
var pc = new ProjectCollection(); var pc = new ProjectCollection();
pc.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Minimal)); pc.RegisterLogger(new ConsoleLogger(verbosity));
var loggers = new List<ILogger>(); var loggers = new List<ILogger>();
if (logPath != null) if (logPath != null)
@ -346,7 +346,7 @@ namespace CitizenMP.Server.Installer
ShowSummary = true, ShowSummary = true,
SkipProjectStartedText = true SkipProjectStartedText = true
}); });
loggers.Add(new ConsoleLogger(LoggerVerbosity.Quiet) {ShowSummary = false}); loggers.Add(new ConsoleLogger(verbosity) {ShowSummary = false});
// Import/Update Mozilla certs for NuGet to not fail out on non-Windows machines // Import/Update Mozilla certs for NuGet to not fail out on non-Windows machines
if (!IsWin32()) if (!IsWin32())
@ -426,14 +426,15 @@ namespace CitizenMP.Server.Installer
private static void Run(string name, string args, Action<string, StreamWriter> lineProcessor = null) private static void Run(string name, string args, Action<string, StreamWriter> lineProcessor = null)
{ {
using (var p = Process.Start(new ProcessStartInfo { using (var p = Process.Start(new ProcessStartInfo
Arguments = args, {
FileName = name, Arguments = args,
UseShellExecute = false, FileName = name,
CreateNoWindow = true, UseShellExecute = false,
RedirectStandardInput = lineProcessor != null, CreateNoWindow = true,
RedirectStandardOutput = lineProcessor != null RedirectStandardInput = lineProcessor != null,
})) RedirectStandardOutput = lineProcessor != null
}))
{ {
if (lineProcessor == null) if (lineProcessor == null)
{ {