예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGetTool{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="globber">The globber.</param>
 /// <param name="resolver">The NuGet tool resolver.</param>
 protected NuGetTool(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IProcessRunner processRunner,
     IGlobber globber,
     INuGetToolResolver resolver)
     : base(fileSystem, environment, processRunner, globber)
 {
     _resolver = resolver;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGetSetApiKey"/> class.
 /// </summary>
 /// <param name="fileSystem">The file system.</param>
 /// <param name="environment">The environment.</param>
 /// <param name="processRunner">The process runner.</param>
 /// <param name="globber">The globber.</param>
 /// <param name="resolver">The NuGet tool resolver.</param>
 public NuGetSetApiKey(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IProcessRunner processRunner,
     IGlobber globber,
     INuGetToolResolver resolver)
     : base(fileSystem, environment, processRunner, globber, resolver)
 {
     _environment = environment;
 }
예제 #3
0
 public FileCopierFixture()
 {
     _environment = FakeEnvironment.CreateUnixEnvironment();
     _environment.WorkingDirectory = "/working";
     _fileSystem = new FakeFileSystem(_environment);
     _globber    = new Globber(_fileSystem, _environment);
     Context     = new CakeContextFixture {
         Environment = _environment, FileSystem = _fileSystem, Globber = _globber
     }.CreateContext();
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GitReleaseManagerTool{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="globber">The globber.</param>
 /// <param name="resolver">The GitReleaseManager tool resolver.</param>
 protected GitReleaseManagerTool(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IProcessRunner processRunner,
     IGlobber globber,
     IGitReleaseManagerToolResolver resolver)
     : base(fileSystem, environment, processRunner, globber)
 {
     _resolver = resolver;
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGetPacker"/> 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="globber">The globber.</param>
 /// <param name="nugetToolResolver">The NuGet tool resolver</param>
 public NuGetPacker(IFileSystem fileSystem, ICakeEnvironment environment,
                    IProcessRunner processRunner, ICakeLog log, IGlobber globber,
                    IToolResolver nugetToolResolver)
     : base(fileSystem, environment, processRunner, globber)
 {
     _fileSystem        = fileSystem;
     _environment       = environment;
     _processor         = new NuspecProcessor(_fileSystem, _environment, log);
     _nugetToolResolver = nugetToolResolver;
 }
예제 #6
0
파일: Tool.cs 프로젝트: ghuntley/cake
        protected Tool(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IGlobber globber)
            : this(fileSystem, environment, processRunner, (IToolLocator)null)
        {
            if (globber == null)
            {
                throw new ArgumentNullException("globber");
            }

            _globber = globber;
        }
예제 #7
0
 public NuGetV2ContentResolver(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IGlobber globber,
     ICakeLog log) : base(fileSystem, environment, globber)
 {
     _fileSystem  = fileSystem;
     _environment = environment;
     _log         = log;
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DockerTool{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="globber">The globber.</param>
 protected DockerTool(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IProcessRunner processRunner,
     IGlobber globber)
     : base(fileSystem, environment, processRunner, globber)
 {
     _fileSystem  = fileSystem;
     _environment = environment;
 }
예제 #9
0
 public NuGetContentResolver(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IGlobber globber,
     ICakeLog log)
 {
     _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));
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IISExpressRunner{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="globber">The globber.</param>
 /// <param name="registry">The registry.</param>
 /// <param name="log">The log.</param>
 /// <param name="advProcessRunner">The adv process runner.</param>
 protected IISExpressRunner(IFileSystem fileSystem, ICakeEnvironment environment,
                            IProcessRunner processRunner,
                            IGlobber globber, IRegistry registry, ICakeLog log, IAdvProcessRunner advProcessRunner)
     : base(fileSystem, environment, processRunner, globber)
 {
     _registry         = registry;
     _log              = log;
     _advProcessRunner = advProcessRunner;
     _cakeEnvironment  = environment;
     _fileSystem       = fileSystem;
 }
예제 #11
0
 public NuGetContentResolver(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IGlobber globber,
     ICakeLog log)
 {
     _fileSystem  = fileSystem;
     _environment = environment;
     _globber     = globber;
     _log         = log;
 }
예제 #12
0
        public LiquibaseRunnerTests()
        {
            _processRunner = Substitute.For <IProcessRunner>();
            _cakeLog       = Substitute.For <ICakeLog>();
            _cakeTools     = Substitute.For <IToolLocator>();
            _globber       = new PassThroughGlobber();
            _platform      = Substitute.For <ICakePlatform>();

            _settings = new LiquibaseSettings();
            _runner   = new LiquibaseRunner(_processRunner, _cakeLog, _cakeTools, _globber, _platform);
        }
예제 #13
0
        /// <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="toolResolvers">The tool resolvers.</param>
        /// <param name="registry">The registry.</param>
        public CakeContext(
            IFileSystem fileSystem,
            ICakeEnvironment environment,
            IGlobber globber,
            ICakeLog log,
            ICakeArguments arguments,
            IProcessRunner processRunner,
            IEnumerable <IToolResolver> toolResolvers,
            IRegistry registry)
        {
            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 (toolResolvers == null)
            {
                throw new ArgumentNullException("toolResolvers");
            }

            _fileSystem    = fileSystem;
            _environment   = environment;
            _globber       = globber;
            _log           = log;
            _arguments     = arguments;
            _processRunner = processRunner;

            // Create the tool resolver lookup table.
            _toolResolverLookup = toolResolvers.ToLookup(
                key => key.Name, value => value,
                StringComparer.OrdinalIgnoreCase);

            _registry = registry;
        }
예제 #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DotNetToolContentResolver"/> 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="config">the configuration.</param>
 public DotNetToolContentResolver(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IGlobber globber,
     ICakeLog log,
     ICakeConfiguration config)
 {
     _fileSystem  = fileSystem;
     _environment = environment;
     _globber     = globber;
     _log         = log;
     _config      = config;
 }
예제 #15
0
 /// <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;
 }
예제 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConvertTo"/> class.
 /// </summary>
 /// <param name="fileSystem">The file system.</param>
 /// <param name="environment">The environment.</param>
 /// <param name="processRunner">The process runner.</param>
 /// <param name="globber">The globber.</param>
 protected ConvertTool(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IProcessRunner processRunner,
     IGlobber globber)
     : base(fileSystem, environment, processRunner, globber)
 {
     if (environment == null)
     {
         throw new ArgumentNullException("environment");
     }
     this.environment = environment;
 }
예제 #17
0
 /// <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="globber">The globber.</param>
 /// <param name="registry">The registry.</param>
 /// <param name="resolver">The resolver.</param>
 internal SignToolSignRunner(
     IFileSystem fileSystem,
     ICakeEnvironment environment,
     IProcessRunner processRunner,
     IGlobber globber,
     IRegistry registry,
     ISignToolResolver resolver)
     : base(fileSystem, environment, processRunner, globber)
 {
     _fileSystem  = fileSystem;
     _environment = environment;
     _resolver    = resolver ?? new SignToolResolver(_fileSystem, _environment, registry);
 }
 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>();
 }
예제 #19
0
        public static SeekerOfEditors GetSeeker(ICakeEnvironment environment, IGlobber globber, ICakeLog log, IFileSystem fileSystem)
        {
            if (environment.Platform.Family == PlatformFamily.Windows)
            {
                return(new WindowsSeekerOfEditors(environment, globber, log));
            }

            if (environment.Platform.Family == PlatformFamily.OSX)
            {
                return(new OSXSeekerOfEditors(environment, globber, log, fileSystem));
            }

            throw new NotSupportedException("Cannot locate Unity Editors. Only Windows and OSX platform is supported.");
        }
예제 #20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LightRunner"/> class.
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="environment">The Cake environment.</param>
        /// <param name="globber">The globber.</param>
        /// <param name="processRunner">The process runner.</param>
        public LightRunner(IFileSystem fileSystem, ICakeEnvironment environment, IGlobber globber, IProcessRunner processRunner)
            : base(fileSystem, environment, processRunner, globber)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            if (globber == null)
            {
                throw new ArgumentNullException("globber");
            }

            _environment = environment;
        }
예제 #21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="XmlDocExampleCodeParser"/> class.
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="globber">The globber.</param>
        public XmlDocExampleCodeParser(IFileSystem fileSystem, IGlobber globber)
        {
            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }

            if (globber == null)
            {
                throw new ArgumentNullException("globber");
            }

            _fileSystem = fileSystem;
            _globber    = globber;
        }
예제 #22
0
파일: CakeContext.cs 프로젝트: qhris/cake
        /// <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;
        }
예제 #23
0
        /// <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="XmlDocExampleCodeParser"/> class.
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="globber">The globber.</param>
        /// <param name="log">The log.</param>
        public XmlDocExampleCodeParser(IFileSystem fileSystem, IGlobber globber, ICakeLog log)
        {
            if (fileSystem == null)
            {
                throw new ArgumentNullException(nameof(fileSystem));
            }

            if (globber == null)
            {
                throw new ArgumentNullException(nameof(globber));
            }

            _fileSystem = fileSystem;
            _globber    = globber;
            _log        = log;
        }
예제 #25
0
 /// <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="globber">The globber.</param>
 public NuGetToolResolver(IFileSystem fileSystem, ICakeEnvironment environment, IGlobber globber)
 {
     if (fileSystem == null)
     {
         throw new ArgumentNullException("fileSystem");
     }
     if (environment == null)
     {
         throw new ArgumentNullException("environment");
     }
     if (globber == null)
     {
         throw new ArgumentNullException("globber");
     }
     _fileSystem  = fileSystem;
     _environment = environment;
     _globber     = globber;
 }
예제 #26
0
 /// <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));
 }
예제 #27
0
        private ICakeContext GetMoqContext(
            HelperFixture fixture,
            IGlobber globber,
            IRegistry registry,
            ICakeArguments args)
        {
            var log = new FakeLog();

            var contextMock = new Mock <ICakeContext>();

            contextMock.SetupGet(t => t.FileSystem).Returns(fixture.FileSystem);
            contextMock.SetupGet(t => t.Environment).Returns(fixture.Environment);
            contextMock.SetupGet(t => t.Globber).Returns(globber);
            contextMock.SetupGet(t => t.Log).Returns(log);
            contextMock.SetupGet(t => t.Arguments).Returns(args);
            contextMock.SetupGet(t => t.ProcessRunner).Returns(fixture.ProcessRunner);
            contextMock.SetupGet(t => t.Registry).Returns(registry);
            contextMock.SetupGet(t => t.Tools).Returns(fixture.Tools);

            return(contextMock.Object);
        }
예제 #28
0
        public XUnit2RunnerFixture(FilePath toolPath = null, bool defaultToolExist = true)
        {
            Process = Substitute.For <IProcess>();
            Process.GetExitCode().Returns(0);

            ProcessRunner = Substitute.For <IProcessRunner>();
            ProcessRunner.Start(Arg.Any <FilePath>(), Arg.Any <ProcessSettings>()).Returns(Process);

            Environment = Substitute.For <ICakeEnvironment>();
            Environment.WorkingDirectory = "/Working";

            Globber = Substitute.For <IGlobber>();
            Globber.Match("./tools/**/xunit.console.exe").Returns(new[] { (FilePath)"/Working/tools/xunit.console.exe" });

            FileSystem = Substitute.For <IFileSystem>();
            FileSystem.Exist(Arg.Is <FilePath>(a => a.FullPath == "/Working/tools/xunit.console.exe")).Returns(defaultToolExist);

            if (toolPath != null)
            {
                FileSystem.Exist(Arg.Is <FilePath>(a => a.FullPath == toolPath.FullPath)).Returns(true);
            }
        }
        public RoslynNightlyScriptSessionFactory(
            IFileSystem fileSystem,
            ICakeEnvironment environment,
            IGlobber globber,
            ICakeLog log)
        {
            _fileSystem  = fileSystem;
            _environment = environment;
            _globber     = globber;
            _log         = log;

            _paths = new FilePath[]
            {
                @"net45/Microsoft.CodeAnalysis.dll",
                @"net45/Microsoft.CodeAnalysis.Scripting.CSharp.dll",
                @"net45/Microsoft.CodeAnalysis.Scripting.dll",
                @"net45/Microsoft.CodeAnalysis.Desktop.dll",
                @"net45/Microsoft.CodeAnalysis.CSharp.dll",
                @"net45/Microsoft.CodeAnalysis.CSharp.Desktop.dll",
                @"portable-net45+win8+wp8+wpa81/System.Collections.Immutable.dll",
                @"portable-net45+win8/System.Reflection.Metadata.dll",
            };
        }
예제 #30
0
파일: Tool.cs 프로젝트: stgwilli/cake
        /// <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="globber">The globber.</param>
        protected Tool(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IGlobber globber)
        {
            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            if (processRunner == null)
            {
                throw new ArgumentNullException("processRunner");
            }
            if (globber == null)
            {
                throw new ArgumentNullException("globber");
            }

            _fileSystem    = fileSystem;
            _environment   = environment;
            _processRunner = processRunner;
            _globber       = globber;
        }
예제 #31
0
 public NuGetInstaller(IFileSystem fileSystem, IGlobber globber)
 {
     _fileSystem = fileSystem;
     _globber = globber;
 }
 internal void Initialize( IGlobber globber )
 {
     _globber = globber;
 }