예제 #1
0
        public void Run(SonarSettings settings)
        {
            Prepare(settings);

            var arguments = settings.GetArguments(_environment);

            _log.Information(arguments.RenderSafe());

            if (_environment.Runtime.IsCoreClr)
            {
                var tool = _toolsLocator.Resolve(CORECLR_TOOL_NAME);
                if (tool == null)
                {
                    throw new Exception($"No CoreCLR executable found ({CORECLR_TOOL_NAME})");
                }
                _log.Debug("We're launching for CoreCLR with executable " + tool.FullPath);
                _coreRunner.Execute(new FilePath("dummy.file").MakeAbsolute(_environment), tool.FullPath, arguments, new DotNetCoreToolSettings {
                });
            }
            else
            {
                _log.Debug("We're launching for CLR.");
                Run(settings, arguments, new ProcessSettings {
                    RedirectStandardOutput = settings.Silent
                }, null);
            }
        }
예제 #2
0
        public static void DotNetCoreTool(this ICakeContext context, FilePath projectPath, string command, ProcessArgumentBuilder arguments, DotNetCoreToolSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var runner = new DotNetCoreToolRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);

            runner.Execute(projectPath, command, arguments, settings);
        }
        protected override void RunTool()
        {
            var tool = new DotNetCoreToolRunner(FileSystem, Environment, ProcessRunner, Tools);

            tool.Execute(ProjectPath, Command, Arguments, Settings);
        }