/// <summary> /// Initializes a new instance of the <see cref="GradleRunner" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="toolLocator">The tool locator.</param> /// <param name="cakeVerbosityLevel">Specifies the current Cake verbosity level.</param> public GradleRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator toolLocator, Verbosity cakeVerbosityLevel = Verbosity.Normal) : base(fileSystem, environment, processRunner, toolLocator) { _cakeVerbosityLevel = cakeVerbosityLevel; _fileSystem = fileSystem; _environment = environment; }
/// <summary> /// Initializes a new instance of the <see cref="SignToolSignRunner"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="tools">The tool locator.</param> /// <param name="registry">The registry.</param> /// <param name="resolver">The resolver.</param> internal SignToolSignRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, IRegistry registry, ISignToolResolver resolver) : base(fileSystem, environment, processRunner, tools) { _fileSystem = fileSystem; _environment = environment; _resolver = resolver ?? new SignToolResolver(_fileSystem, _environment, registry); }
/// <summary> /// Initializes a new instance of the <see cref="ProcessRunner" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="log">The log.</param> /// <param name="tools">The tool locator.</param> /// <param name="configuration">The tool configuration.</param> public ProcessRunner(IFileSystem fileSystem, ICakeEnvironment environment, ICakeLog log, IToolLocator tools, ICakeConfiguration configuration) { _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); _environment = environment ?? throw new ArgumentNullException(nameof(environment)); _log = log ?? throw new ArgumentNullException(nameof(log)); _tools = tools ?? throw new ArgumentNullException(nameof(tools)); _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); var noMonoCoersion = configuration.GetValue(Constants.Settings.NoMonoCoersion); _noMonoCoersion = noMonoCoersion != null && noMonoCoersion.Equals("true", StringComparison.OrdinalIgnoreCase); }
/// <summary> /// Initializes a new instance of the <see cref="ChocolateyPacker"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="log">The log.</param> /// <param name="tools">The tool locator.</param> /// <param name="resolver">The Chocolatey tool resolver</param> public ChocolateyPacker( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, ICakeLog log, IToolLocator tools, IChocolateyToolResolver resolver) : base(fileSystem, environment, processRunner, tools, resolver) { _fileSystem = fileSystem; _environment = environment; _processor = new ChocolateyNuSpecProcessor(_fileSystem, _environment, log); }
/// <summary> /// Initializes a new instance of the <see cref="CandleRunner"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="tools">The tool locator.</param> public CandleRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools) : base(fileSystem, environment, processRunner, tools) { if (environment == null) { throw new ArgumentNullException("environment"); } _environment = environment; }
public ToolInstaller( ICakeEnvironment environment, IToolLocator locator, ICakeConfiguration configuration, ICakeLog log, IEnumerable <IPackageInstaller> installers) { _environment = environment ?? throw new ArgumentNullException(nameof(environment)); _locator = locator ?? throw new ArgumentNullException(nameof(locator)); _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _log = log ?? throw new ArgumentNullException(nameof(log)); _installers = new List <IPackageInstaller>(installers ?? Enumerable.Empty <IPackageInstaller>()); }
/// <summary> /// Initializes a new instance of the <see cref="TextTransformRunner" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="tools">The tool locator.</param> public TextTransformRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools) : base(fileSystem, environment, processRunner, tools) { if (environment == null) { throw new ArgumentNullException(nameof(environment)); } _environment = environment; }
/// <summary> /// Initializes a new instance of the <see cref="FixedCakeRunner" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="globber">The globber.</param> /// <param name="processRunner">The process runner.</param> /// <param name="tools">The tool locator.</param> /// <param name="log"></param> public FixedCakeRunner(IFileSystem fileSystem, ICakeEnvironment environment, IGlobber globber, IProcessRunner processRunner, IToolLocator tools, ICakeLog log) : base(fileSystem, environment, processRunner, tools) { _environment = environment; _fileSystem = fileSystem; _globber = globber; this.log = log; }
public AppPackagerResolverFixture(bool is64Bit = true) { _is64Bit = is64Bit; FileSystem = Substitute.For <IFileSystem>(); Environment = Substitute.For <ICakeEnvironment>(); Registry = Substitute.For <IRegistry>(); Tools = Substitute.For <IToolLocator>(); Environment.Platform.Is64Bit.Returns(_is64Bit); Environment.GetSpecialPath(SpecialPath.ProgramFiles).Returns(@"C:\Program Files"); Environment.GetSpecialPath(SpecialPath.ProgramFilesX86).Returns(@"C:\Program Files (x86)"); }
public void Setup() { environment = FakeEnvironmentHelper.CreateFromRuntime(); fileSystem = new FakeFileSystem(environment); runner = A.Fake <IProcessRunner>(); tools = A.Fake <IToolLocator>(); mavenClient = A.Fake <IMavenClient>(); fileSystem.CreateFile(javaExecutable, FileAttributes.Normal); A.CallTo(() => runner.Start(A <FilePath> ._, A <ProcessSettings> ._)).Returns(A.Fake <IProcess>()); A.CallTo(() => tools.Resolve(A <string> ._)).Returns(javaExecutable); A.CallTo(() => mavenClient.Resolve(A <MavenPackage> ._)).Returns("/path/to/package.jar"); }
/// <summary> /// Initializes a new instance of the <see cref="SevenZipRunner"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="tools">The tool locator.</param> /// <param name="log">The log.</param> /// <param name="registry">The Registry.</param> public SevenZipRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, ICakeLog log, IRegistry registry) : base(fileSystem, environment, processRunner, tools) { this.log = log; cakeEnvironment = environment; this.registry = registry; this.fileSystem = fileSystem; }
public ProtoCompileToolResolverFixture(PlatformFamily family, bool is64Bit) { Environment = Substitute.For <ICakeEnvironment>(); Environment.Platform.Returns(info => { var platform = Substitute.For <ICakePlatform>(); platform.Is64Bit.Returns(is64Bit); platform.Family.Returns(family); return(platform); }); FileSystem = Substitute.For <IFileSystem>(); ToolLocator = Substitute.For <IToolLocator>(); }
/// <summary> /// Dependency Check runner. /// </summary> /// <param name="fileSystem">A required file system object.</param> /// <param name="environment">A required cake environment object.</param> /// <param name="processRunner">A required process runner object.</param> /// <param name="tools">A required tool locator object.</param> /// <param name="appender">A required argument appender object.</param> public DependencyCheckRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, ArgumentAppender appender) : base(fileSystem, environment, processRunner, tools) { _fileSystem = fileSystem; _environment = environment; _processRunner = processRunner; _tools = tools; _appender = appender; }
/// <summary> /// Initializes a new instance of the <see cref="ScriptyRunner"/> class /// </summary> /// <param name="fileSystem">The file system</param> /// <param name="environment">The environment</param> /// <param name="processRunner">The process runner</param> /// <param name="tools">The tools</param> /// <param name="projectFilePath">Path to the project file</param> /// <param name="settings">Settings for running the tool</param> public ScriptyRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, FilePath projectFilePath, ScriptySettings settings ) : base(fileSystem, environment, processRunner, tools) { _environment = environment; _projectFilePath = projectFilePath ?? throw new ArgumentNullException(nameof(projectFilePath)); _settings = settings ?? new ScriptySettings(); }
public void Setup() { _environment = FakeEnvironment.CreateWindowsEnvironment(); _log = new FakeLog(); _arguments = Substitute.For <ICakeArguments>(); _appVeyor = Substitute.For <IAppVeyorProvider>(); _azure = Substitute.For <ITFBuildProvider>(); _appEnvironment = new AppVeyorEnvironmentInfo(_environment); _appVeyor.Environment.Returns(_appEnvironment); _globber = Substitute.For <IGlobber>(); _fileSystem = new FakeFileSystem(_environment); _processRunner = Substitute.For <IProcessRunner>(); _toolLocator = Substitute.For <IToolLocator>(); }
/// <summary> /// Wrapper CTor /// </summary> /// <param name="fileSystem"></param> /// <param name="environment"></param> /// <param name="processRunner"></param> /// <param name="tools"></param> /// <param name="log"></param> public VirtualboxRunner( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, ICakeLog log) : base(fileSystem, environment, processRunner, tools) { this.FileSystem = fileSystem; this.Log = log; this.Settings = new VirtualboxSettings(); this.HddRunner = new VirtualboxHddRunner(log, this.Run, this.Settings); }
/// <summary> /// Initializes a new instance of the <see cref="BaseLocalOptimizer" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="log">The log.</param> /// <param name="runner">The process runner.</param> /// <param name="tools">The locator.</param> public BaseLocalOptimizer(IFileSystem fileSystem, ICakeEnvironment environment, ICakeLog log, IProcessRunner runner, IToolLocator tools) : base(fileSystem, environment, log) { if (runner == null) { throw new ArgumentNullException("runner"); } if (tools == null) { throw new ArgumentNullException("tools"); } _Runner = runner; _Tools = tools; }
/// <summary> /// Initializes a new instance of the <see cref="CakeContext"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="globber">The globber.</param> /// <param name="log">The log.</param> /// <param name="arguments">The arguments.</param> /// <param name="processRunner">The process runner.</param> /// <param name="registry">The registry.</param> /// <param name="tools">The tool locator.</param> public CakeContext( IFileSystem fileSystem, ICakeEnvironment environment, IGlobber globber, ICakeLog log, ICakeArguments arguments, IProcessRunner processRunner, IRegistry registry, IToolLocator tools) { if (fileSystem == null) { throw new ArgumentNullException("fileSystem"); } if (environment == null) { throw new ArgumentNullException("environment"); } if (globber == null) { throw new ArgumentNullException("globber"); } if (log == null) { throw new ArgumentNullException("log"); } if (arguments == null) { throw new ArgumentNullException("arguments"); } if (processRunner == null) { throw new ArgumentNullException("processRunner"); } if (tools == null) { throw new ArgumentNullException("tools"); } _fileSystem = fileSystem; _environment = environment; _globber = globber; _log = log; _arguments = arguments; _processRunner = processRunner; _registry = registry; _tools = tools; }
/// <summary> /// Initializes a new instance of the <see cref="CakeContext"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="globber">The globber.</param> /// <param name="log">The log.</param> /// <param name="arguments">The arguments.</param> /// <param name="processRunner">The process runner.</param> /// <param name="registry">The registry.</param> /// <param name="tools">The tool locator.</param> public CakeContext( IFileSystem fileSystem, ICakeEnvironment environment, IGlobber globber, ICakeLog log, ICakeArguments arguments, IProcessRunner processRunner, IRegistry registry, IToolLocator tools) { if (fileSystem == null) { throw new ArgumentNullException(nameof(fileSystem)); } if (environment == null) { throw new ArgumentNullException(nameof(environment)); } if (globber == null) { throw new ArgumentNullException(nameof(globber)); } if (log == null) { throw new ArgumentNullException(nameof(log)); } if (arguments == null) { throw new ArgumentNullException(nameof(arguments)); } if (processRunner == null) { throw new ArgumentNullException(nameof(processRunner)); } if (tools == null) { throw new ArgumentNullException(nameof(tools)); } FileSystem = fileSystem; Environment = environment; Globber = globber; Log = log; Arguments = arguments; ProcessRunner = processRunner; Registry = registry; Tools = tools; }
/// <summary> /// Initializes a new instance of the <see cref="NpmPackageInstaller"/> class. /// </summary> /// <param name="processRunner">The process runner.</param> /// <param name="log">The log.</param> /// <param name="contentResolver">The content resolver.</param> /// <param name="config">The configuration.</param> /// <param name="toolLocator">The ToolLocator.</param> /// <param name="environment">The Environment.</param> /// <param name="fileSystem">The Filesystem.</param> public NpmPackageInstaller( IProcessRunner processRunner, ICakeLog log, INpmContentResolver contentResolver, ICakeConfiguration config, IToolLocator toolLocator, ICakeEnvironment environment, IFileSystem fileSystem) { _processRunner = processRunner ?? throw new ArgumentNullException(nameof(processRunner)); _log = log ?? throw new ArgumentNullException(nameof(log)); _contentResolver = contentResolver ?? throw new ArgumentNullException(nameof(contentResolver)); _config = config ?? throw new ArgumentNullException(nameof(config)); _toolLocator = toolLocator ?? throw new ArgumentNullException(nameof(toolLocator)); _environment = environment ?? throw new ArgumentNullException(nameof(environment)); _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); }
/// <summary> /// Initializes a new instance of the <see cref="UPackTool{TSettings}"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="tools">The tools.</param> /// <param name="resolver">The resolver.</param> protected UPackTool( IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, IUPackToolResolver resolver) : base(fileSystem, environment, processRunner, tools) { if (resolver == null) { throw new ArgumentNullException(nameof(resolver)); } _resolver = resolver; this.FileSystem = fileSystem; this.Environment = environment; }
public CakeContextFixture() { var cakeRuntime = Substitute.For <ICakeRuntime>(); cakeRuntime.BuiltFramework.Returns(new FrameworkName(".NET Framework", new Version(4, 5, 2))); cakeRuntime.CakeVersion.Returns(typeof(ICakeRuntime).GetTypeInfo().Assembly.GetName().Version); FileSystem = Substitute.For <IFileSystem>(); Environment = Substitute.For <ICakeEnvironment>(); Environment.Runtime.Returns(cakeRuntime); Globber = Substitute.For <IGlobber>(); Log = Substitute.For <ICakeLog>(); Arguments = Substitute.For <ICakeArguments>(); ProcessRunner = Substitute.For <IProcessRunner>(); Registry = Substitute.For <IRegistry>(); Tools = Substitute.For <IToolLocator>(); }
/// <summary> /// Initializes a new instance of the <see cref="GitRepositoryIssuesProvider"/> class. /// </summary> /// <param name="log">The Cake log context.</param> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The Cake environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="toolLocator">The tool locator.</param> /// <param name="issueProviderSettings">Settings for the issue provider.</param> public GitRepositoryIssuesProvider( ICakeLog log, IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator toolLocator, GitRepositoryIssuesSettings issueProviderSettings) : base(log) { fileSystem.NotNull(nameof(fileSystem)); environment.NotNull(nameof(environment)); processRunner.NotNull(nameof(processRunner)); toolLocator.NotNull(nameof(toolLocator)); issueProviderSettings.NotNull(nameof(issueProviderSettings)); this.IssueProviderSettings = issueProviderSettings; this.runner = new GitRunner(fileSystem, environment, processRunner, toolLocator); }
/// <summary> /// Initializes a new instance of the <see cref="NuGetToolResolver" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="tools">The tool locator.</param> public NuGetToolResolver(IFileSystem fileSystem, ICakeEnvironment environment, IToolLocator tools) { if (fileSystem == null) { throw new ArgumentNullException("fileSystem"); } if (environment == null) { throw new ArgumentNullException("environment"); } if (tools == null) { throw new ArgumentNullException("tools"); } _fileSystem = fileSystem; _environment = environment; _tools = tools; }
/// <summary> /// Initializes a new instance of the <see cref="UPackToolResolver" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="tools">The tool locator</param> public UPackToolResolver(IFileSystem fileSystem, ICakeEnvironment environment, IToolLocator tools) { if (fileSystem == null) { throw new ArgumentNullException(nameof(fileSystem)); } if (environment == null) { throw new ArgumentNullException(nameof(environment)); } if (tools == null) { throw new ArgumentNullException(nameof(tools)); } _fileSystem = fileSystem; _environment = environment; _tools = tools; }
/// <summary> /// Initializes a new instance of the <see cref="Tool{TSettings}"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="processRunner">The process runner.</param> /// <param name="tools">The tool locator.</param> protected Tool(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools) { if (fileSystem == null) { throw new ArgumentNullException(nameof(fileSystem)); } if (environment == null) { throw new ArgumentNullException(nameof(environment)); } if (processRunner == null) { throw new ArgumentNullException(nameof(processRunner)); } _fileSystem = fileSystem; _environment = environment; _processRunner = processRunner; _tools = tools; }
public ToolResolverFixture(PlatformFamily family, bool is64Bit, Version frameworkVersion) { Environment = Substitute.For <ICakeEnvironment>(); Environment.Platform.Returns(info => { var platform = Substitute.For <ICakePlatform>(); platform.Is64Bit.Returns(is64Bit); platform.Family.Returns(family); return(platform); }); Environment.Runtime.Returns(info => { var runtime = Substitute.For <ICakeRuntime>(); runtime.BuiltFramework.Returns(callInfo => new FrameworkName(".Net 4.5.2", frameworkVersion)); return(runtime); }); FileSystem = Substitute.For <IFileSystem>(); ToolLocator = Substitute.For <IToolLocator>(); }
/// <summary> /// Initializes a new instance of the <see cref="CakeContext"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="globber">The globber.</param> /// <param name="log">The log.</param> /// <param name="arguments">The arguments.</param> /// <param name="processRunner">The process runner.</param> /// <param name="registry">The registry.</param> /// <param name="tools">The tool locator.</param> /// <param name="data">The data service.</param> public CakeContext( IFileSystem fileSystem, ICakeEnvironment environment, IGlobber globber, ICakeLog log, ICakeArguments arguments, IProcessRunner processRunner, IRegistry registry, IToolLocator tools, ICakeDataService data) { FileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); Environment = environment ?? throw new ArgumentNullException(nameof(environment)); Globber = globber ?? throw new ArgumentNullException(nameof(globber)); Log = log ?? throw new ArgumentNullException(nameof(log)); Arguments = arguments ?? throw new ArgumentNullException(nameof(arguments)); ProcessRunner = processRunner ?? throw new ArgumentNullException(nameof(processRunner)); Registry = registry ?? throw new ArgumentNullException(nameof(registry)); Tools = tools ?? throw new ArgumentNullException(nameof(tools)); Data = data ?? throw new ArgumentNullException(nameof(data)); }
/// <summary> /// Initializes a new instance of the <see cref="PaketToolResolver" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> /// <param name="tools">The tool locator.</param> /// <param name="processRunner">The process runner.</param> /// <param name="arguments">The arguments.</param> /// <param name="log">The log.</param> internal PaketToolResolver(IFileSystem fileSystem, ICakeEnvironment environment, IToolLocator tools, IProcessRunner processRunner, ICakeArguments arguments, ICakeLog log) { if (fileSystem == null) { throw new ArgumentNullException(nameof(fileSystem)); } if (environment == null) { throw new ArgumentNullException(nameof(environment)); } if (tools == null) { throw new ArgumentNullException(nameof(tools)); } if (processRunner == null) { throw new ArgumentNullException(nameof(processRunner)); } if (arguments == null) { throw new ArgumentNullException(nameof(arguments)); } if (log == null) { throw new ArgumentNullException(nameof(log)); } FileSystem = fileSystem; Environment = environment; Tools = tools; ProcessRunner = processRunner; Arguments = arguments; Log = log; }
public AppPackagerResolver(IFileSystem fileSystem, ICakeEnvironment environment, IToolLocator tools, IRegistry registry) { if (fileSystem == null) { throw new ArgumentNullException(nameof(fileSystem)); } if (environment == null) { throw new ArgumentNullException(nameof(environment)); } if (tools == null) { throw new ArgumentNullException(nameof(tools)); } if (registry == null) { throw new ArgumentNullException(nameof(registry)); } _fileSystem = fileSystem; _environment = environment; _tools = tools; _registry = registry; }