Search in sources :

Example 1 with AutomatedReport

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;
}
Also used : ExecutableFinder(com.facebook.buck.io.ExecutableFinder) VcsInfoCollector(com.facebook.buck.rage.VcsInfoCollector) AutomatedReport(com.facebook.buck.rage.AutomatedReport) DefaultProcessExecutor(com.facebook.buck.util.DefaultProcessExecutor) DefaultExtraInfoCollector(com.facebook.buck.rage.DefaultExtraInfoCollector) ExtraInfoCollector(com.facebook.buck.rage.ExtraInfoCollector) RageConfig(com.facebook.buck.rage.RageConfig) DefaultVersionControlCmdLineInterfaceFactory(com.facebook.buck.util.versioncontrol.DefaultVersionControlCmdLineInterfaceFactory) VersionControlBuckConfig(com.facebook.buck.util.versioncontrol.VersionControlBuckConfig) ProcessExecutor(com.facebook.buck.util.ProcessExecutor) DefaultProcessExecutor(com.facebook.buck.util.DefaultProcessExecutor) DefaultVersionControlCmdLineInterfaceFactory(com.facebook.buck.util.versioncontrol.DefaultVersionControlCmdLineInterfaceFactory) VersionControlCmdLineInterfaceFactory(com.facebook.buck.util.versioncontrol.VersionControlCmdLineInterfaceFactory) DefectSubmitResult(com.facebook.buck.rage.DefectSubmitResult) VersionControlBuckConfig(com.facebook.buck.util.versioncontrol.VersionControlBuckConfig) WatchmanDiagReportCollector(com.facebook.buck.rage.WatchmanDiagReportCollector) AbstractReport(com.facebook.buck.rage.AbstractReport) InteractiveReport(com.facebook.buck.rage.InteractiveReport) DefaultDefectReporter(com.facebook.buck.rage.DefaultDefectReporter) ProjectFilesystem(com.facebook.buck.io.ProjectFilesystem) PrintStreamProcessExecutorFactory(com.facebook.buck.util.PrintStreamProcessExecutorFactory) DefaultExtraInfoCollector(com.facebook.buck.rage.DefaultExtraInfoCollector)

Aggregations

ExecutableFinder (com.facebook.buck.io.ExecutableFinder)1 ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)1 AbstractReport (com.facebook.buck.rage.AbstractReport)1 AutomatedReport (com.facebook.buck.rage.AutomatedReport)1 DefaultDefectReporter (com.facebook.buck.rage.DefaultDefectReporter)1 DefaultExtraInfoCollector (com.facebook.buck.rage.DefaultExtraInfoCollector)1 DefectSubmitResult (com.facebook.buck.rage.DefectSubmitResult)1 ExtraInfoCollector (com.facebook.buck.rage.ExtraInfoCollector)1 InteractiveReport (com.facebook.buck.rage.InteractiveReport)1 RageConfig (com.facebook.buck.rage.RageConfig)1 VcsInfoCollector (com.facebook.buck.rage.VcsInfoCollector)1 WatchmanDiagReportCollector (com.facebook.buck.rage.WatchmanDiagReportCollector)1 DefaultProcessExecutor (com.facebook.buck.util.DefaultProcessExecutor)1 PrintStreamProcessExecutorFactory (com.facebook.buck.util.PrintStreamProcessExecutorFactory)1 ProcessExecutor (com.facebook.buck.util.ProcessExecutor)1 DefaultVersionControlCmdLineInterfaceFactory (com.facebook.buck.util.versioncontrol.DefaultVersionControlCmdLineInterfaceFactory)1 VersionControlBuckConfig (com.facebook.buck.util.versioncontrol.VersionControlBuckConfig)1 VersionControlCmdLineInterfaceFactory (com.facebook.buck.util.versioncontrol.VersionControlCmdLineInterfaceFactory)1