|
|
@ -1,8 +1,9 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
|
|
|
|
using System.Security; |
|
|
|
using NuGet; |
|
|
|
using NuGet; |
|
|
|
using NuGet.Commands; |
|
|
|
using NuGet.CommandLine; |
|
|
|
using NuGet.Common; |
|
|
|
using NuGet.Common; |
|
|
|
|
|
|
|
|
|
|
|
namespace MicroBuildServer.DotNetBuilder |
|
|
|
namespace MicroBuildServer.DotNetBuilder |
|
|
@ -13,11 +14,6 @@ namespace MicroBuildServer.DotNetBuilder |
|
|
|
{ |
|
|
|
{ |
|
|
|
public readonly Messages Messages = new Messages(); |
|
|
|
public readonly Messages Messages = new Messages(); |
|
|
|
|
|
|
|
|
|
|
|
public bool Confirm(string description) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int CursorLeft |
|
|
|
public int CursorLeft |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { throw new NotImplementedException(); } |
|
|
|
get { throw new NotImplementedException(); } |
|
|
@ -26,35 +22,10 @@ namespace MicroBuildServer.DotNetBuilder |
|
|
|
|
|
|
|
|
|
|
|
public bool IsNonInteractive |
|
|
|
public bool IsNonInteractive |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { return true; } |
|
|
|
get { throw new NotImplementedException(); } |
|
|
|
set { throw new NotImplementedException(); } |
|
|
|
set { throw new NotImplementedException(); } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void PrintJustified(int startIndex, string text, int maxWidth) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void PrintJustified(int startIndex, string text) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ConsoleKeyInfo ReadKey() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string ReadLine() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ReadSecureString(System.Security.SecureString secureString) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Verbosity Verbosity |
|
|
|
public Verbosity Verbosity |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { return Verbosity.Detailed; } |
|
|
|
get { return Verbosity.Detailed; } |
|
|
@ -67,106 +38,88 @@ namespace MicroBuildServer.DotNetBuilder |
|
|
|
set { throw new NotImplementedException(); } |
|
|
|
set { throw new NotImplementedException(); } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void Write(string format, params object[] args) |
|
|
|
public bool Confirm(string description) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Write(string.Format(format, args)); |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void Write(string value) |
|
|
|
public void LogDebug(string data) => this.Messages.Add(Message.CreateInfo(data)); |
|
|
|
{ |
|
|
|
|
|
|
|
Messages.Add(Message.CreateInfo(value)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Write(object value) |
|
|
|
public void LogError(string data) => this.Messages.Add(Message.CreateError(data)); |
|
|
|
{ |
|
|
|
|
|
|
|
Write(value.ToString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteError(string format, params object[] args) |
|
|
|
public void LogErrorSummary(string data) => this.Messages.Add(Message.CreateError(data)); |
|
|
|
{ |
|
|
|
|
|
|
|
WriteError(string.Format(format, args)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteError(string value) |
|
|
|
public void LogInformation(string data) => this.Messages.Add(Message.CreateInfo(data)); |
|
|
|
{ |
|
|
|
|
|
|
|
Messages.Add(Message.CreateError(value)); |
|
|
|
public void LogInformationSummary(string data) => this.Messages.Add(Message.CreateInfo(data)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void LogMinimal(string data) => this.Messages.Add(Message.CreateInfo(data)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void LogVerbose(string data) => this.Messages.Add(Message.CreateInfo(data)); |
|
|
|
|
|
|
|
|
|
|
|
public void WriteError(object value) |
|
|
|
public void LogWarning(string data) => this.Messages.Add(Message.CreateWarn(data)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void PrintJustified(int startIndex, string text) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteError(value.ToString()); |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void WriteLine(ConsoleColor color, string value, params object[] args) |
|
|
|
public void PrintJustified(int startIndex, string text, int maxWidth) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteLine(value, args); |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void WriteLine(string format, params object[] args) |
|
|
|
public ConsoleKeyInfo ReadKey() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Write(format, args); |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void WriteLine(string value) |
|
|
|
public string ReadLine() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Write(value); |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void WriteLine(object value) |
|
|
|
public void ReadSecureString(SecureString secureString) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Write(value); |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Write(string value) => this.Messages.Add(Message.CreateInfo(value)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Write(object value) => this.Write(value.ToString()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Write(string format, params object[] args) => this.Write(string.Format(format, args)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteError(string value) => this.Messages.Add(Message.CreateError(value)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteError(object value) => this.WriteError(value.ToString()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteError(string format, params object[] args) => this.WriteError(string.Format(format, args)); |
|
|
|
|
|
|
|
|
|
|
|
public void WriteLine() |
|
|
|
public void WriteLine() |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void WriteWarning(bool prependWarningText, string value, params object[] args) |
|
|
|
public void WriteLine(string value) => this.Write(value); |
|
|
|
{ |
|
|
|
|
|
|
|
WriteWarning(value, args); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteWarning(string value, params object[] args) |
|
|
|
public void WriteLine(object value) => this.Write(value); |
|
|
|
{ |
|
|
|
|
|
|
|
WriteWarning(string.Format(value, args)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteWarning(bool prependWarningText, string value) |
|
|
|
public void WriteLine(string format, params object[] args) => this.Write(format, args); |
|
|
|
{ |
|
|
|
|
|
|
|
WriteWarning(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WriteWarning(string value) |
|
|
|
public void WriteLine(ConsoleColor color, string value, params object[] args) => this.Write(value, args); |
|
|
|
{ |
|
|
|
|
|
|
|
Messages.Add(Message.CreateWarn(value)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Log(MessageLevel level, string message, params object[] args) |
|
|
|
public void WriteWarning(string value) => this.Messages.Add(Message.CreateWarn(value)); |
|
|
|
{ |
|
|
|
|
|
|
|
switch (level) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case MessageLevel.Error: |
|
|
|
|
|
|
|
WriteError(message, args); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
case MessageLevel.Warning: |
|
|
|
|
|
|
|
WriteWarning(message, args); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
case MessageLevel.Info: |
|
|
|
|
|
|
|
Write(message, args); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public FileConflictResolution ResolveFileConflict(string message) |
|
|
|
public void WriteWarning(string value, params object[] args) => this.WriteWarning(string.Format(value, args)); |
|
|
|
{ |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
public void WriteWarning(bool prependWarningText, string value) => this.WriteWarning(value); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void WriteWarning(bool prependWarningText, string value, params object[] args) => this.WriteWarning(value, args); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Response Pack(NuGetPackRequest request) |
|
|
|
public static Response Pack(NuGetPackRequest request) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var console = new Console(); |
|
|
|
var console = new Console(); |
|
|
|
PackageBuilder builder = new PackageBuilder(); |
|
|
|
|
|
|
|
var command = new PackCommand |
|
|
|
var command = new PackCommand |
|
|
|
{ |
|
|
|
{ |
|
|
|
BasePath = PathTools.OptimizePath(request.BaseDirectory), |
|
|
|
BasePath = PathTools.OptimizePath(request.BaseDirectory), |
|
|
@ -174,7 +127,6 @@ namespace MicroBuildServer.DotNetBuilder |
|
|
|
Version = request.Version, |
|
|
|
Version = request.Version, |
|
|
|
Console = console, |
|
|
|
Console = console, |
|
|
|
Verbosity = Verbosity.Detailed, |
|
|
|
Verbosity = Verbosity.Detailed, |
|
|
|
Rules = new IPackageRule[0], |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
command.Arguments.Add(request.SpecPath); |
|
|
|
command.Arguments.Add(request.SpecPath); |
|
|
|
|
|
|
|
|
|
|
@ -220,7 +172,6 @@ namespace MicroBuildServer.DotNetBuilder |
|
|
|
PackageBuilder builder = new PackageBuilder(); |
|
|
|
PackageBuilder builder = new PackageBuilder(); |
|
|
|
var command = new RestoreCommand |
|
|
|
var command = new RestoreCommand |
|
|
|
{ |
|
|
|
{ |
|
|
|
FileSystem = new PhysicalFileSystem(PathTools.OptimizePath(request.BaseDirectory)), |
|
|
|
|
|
|
|
Console = console, |
|
|
|
Console = console, |
|
|
|
Verbosity = Verbosity.Detailed, |
|
|
|
Verbosity = Verbosity.Detailed, |
|
|
|
}; |
|
|
|
}; |
|
|
|