Esempio n. 1
0
        public FilePath?Finalize(
            IPatcherRun patcher,
            FilePath outputPath)
        {
            if (!_fileSystem.File.Exists(outputPath))
            {
                _reporter.ReportRunProblem(patcher.Key, patcher.Name,
                                           new ArgumentException($"Patcher {patcher.Name} did not produce output file."));
                return(null);
            }

            _reporter.ReportRunSuccessful(patcher.Key, patcher.Name, outputPath);
            return(outputPath);
        }
Esempio n. 2
0
        public async Task <FilePath?> Run(
            IGroupRun groupRun,
            PatcherPrepBundle prepBundle,
            CancellationToken cancellation,
            FilePath?sourcePath,
            RunParameters runParameters)
        {
            try
            {
                // Finish waiting for prep, if it didn't finish
                var prepException = await prepBundle.Prep.ConfigureAwait(false);

                if (prepException != null)
                {
                    return(null);
                }

                var args = GetRunArgs.GetArgs(
                    groupRun,
                    prepBundle.Run,
                    sourcePath,
                    runParameters);

                _fs.Directory.CreateDirectory(args.OutputPath.Directory !);

                _logger.Information("================= Starting Patcher {Patcher} Run =================", prepBundle.Run.Name);

                _reporter.ReportStartingRun(prepBundle.Run.Key, prepBundle.Run.Name);
                await prepBundle.Run.Run(args,
                                         cancel : cancellation).ConfigureAwait(false);

                if (cancellation.IsCancellationRequested)
                {
                    return(null);
                }

                return(FinalizePatcherRun.Finalize(prepBundle.Run, args.OutputPath));
            }
            catch (TaskCanceledException)
            {
                return(null);
            }
            catch (Exception ex)
            {
                _reporter.ReportRunProblem(prepBundle.Run.Key, prepBundle.Run.Name, ex);
                return(null);
            }
        }
Esempio n. 3
0
 public void ReportRunProblem(object?key, IPatcherRun patcher, Exception ex)
 {
     _wrapped.ReportRunProblem(patcher, ex);
 }