use of com.facebook.buck.rage.AutomatedReport in project buck by facebook.
the class RageCommand method runWithoutHelp.
@Override
public int runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException {
ProjectFilesystem filesystem = params.getCell().getFilesystem();
BuckConfig buckConfig = params.getBuckConfig();
RageConfig rageConfig = RageConfig.of(buckConfig);
ProcessExecutor processExecutor = new DefaultProcessExecutor(params.getConsole());
VersionControlCmdLineInterfaceFactory vcsFactory = new DefaultVersionControlCmdLineInterfaceFactory(params.getCell().getFilesystem().getRootPath(), new PrintStreamProcessExecutorFactory(), new VersionControlBuckConfig(buckConfig), buckConfig.getEnvironment());
Optional<VcsInfoCollector> vcsInfoCollector = VcsInfoCollector.create(vcsFactory.createCmdLineInterface());
ExtraInfoCollector extraInfoCollector = new DefaultExtraInfoCollector(rageConfig, filesystem, processExecutor);
Optional<WatchmanDiagReportCollector> watchmanDiagReportCollector = WatchmanDiagReportCollector.newInstanceIfWatchmanUsed(params.getCell(), filesystem, processExecutor, new ExecutableFinder(), params.getEnvironment());
AbstractReport report;
DefaultDefectReporter reporter = new DefaultDefectReporter(filesystem, params.getObjectMapper(), rageConfig, params.getBuckEventBus(), params.getClock());
if (params.getConsole().getAnsi().isAnsiTerminal() && !nonInteractive) {
report = new InteractiveReport(reporter, filesystem, params.getObjectMapper(), params.getConsole(), params.getStdIn(), params.getBuildEnvironmentDescription(), vcsInfoCollector, rageConfig, extraInfoCollector, watchmanDiagReportCollector);
} else {
report = new AutomatedReport(reporter, filesystem, params.getObjectMapper(), params.getConsole(), params.getBuildEnvironmentDescription(), gatherVcsInfo ? vcsInfoCollector : Optional.empty(), rageConfig, extraInfoCollector);
}
Optional<DefectSubmitResult> defectSubmitResult = report.collectAndSubmitResult();
report.presentDefectSubmitResult(defectSubmitResult, showJson);
return 0;
}
Aggregations