using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Semmle.Extraction.CSharp.DependencyFetching
{
internal interface IDotNetCliInvoker
{
///
/// The name of the dotnet executable.
///
string Exec { get; }
///
/// A minimal environment for running the .NET CLI.
///
/// DOTNET_CLI_UI_LANGUAGE: The .NET CLI language is set to English to avoid localized output.
/// MSBUILDDISABLENODEREUSE: To ensure clean environment for each build.
/// DOTNET_SKIP_FIRST_TIME_EXPERIENCE: To skip first time experience messages.
///
static ReadOnlyDictionary MinimalEnvironment { get; } = new(new Dictionary
{
{"DOTNET_CLI_UI_LANGUAGE", "en"},
{"MSBUILDDISABLENODEREUSE", "1"},
{"DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true"}
});
///
/// Execute `dotnet ` and return true if the command succeeded, otherwise false.
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.
///
bool RunCommand(string args, bool silent = true);
///
/// Execute `dotnet ` and return the exit code.
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.
///
int RunCommandExitCode(string args, bool silent = true);
///
/// Execute `dotnet ` and return true if the command succeeded, otherwise false.
/// The output of the command is returned in `output`.
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.
///
bool RunCommand(string args, out IList output, bool silent = true);
///
/// Execute `dotnet ` in `` and return true if the command succeeded, otherwise false.
/// The output of the command is returned in `output`.
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.
///
bool RunCommand(string args, string? workingDirectory, out IList output, bool silent = true);
}
}