import org.sonar.batch.events.BatchStepEvent;
import org.sonar.batch.events.EventBus;
import org.sonar.batch.index.DefaultIndex;
+import org.sonar.batch.index.ResourcePersister;
import org.sonar.batch.index.ScanPersister;
import org.sonar.batch.issue.ignore.scanner.IssueExclusionsLoader;
import org.sonar.batch.report.PublishReportJob;
private final IssueExclusionsLoader issueExclusionsLoader;
private final AnalysisMode analysisMode;
private final DatabaseSession session;
+ private final ResourcePersister resourcePersister;
public DefaultPhaseExecutor(Phases phases, DecoratorsExecutor decoratorsExecutor,
MavenPluginsConfigurator mavenPluginsConfigurator, InitializersExecutor initializersExecutor,
SensorContext sensorContext, DefaultIndex index,
EventBus eventBus, PublishReportJob publishReportJob, ProjectInitializer pi,
ScanPersister[] persisters, FileSystemLogger fsLogger, JsonReport jsonReport, DefaultModuleFileSystem fs, QProfileVerifier profileVerifier,
- IssueExclusionsLoader issueExclusionsLoader, AnalysisMode analysisMode, DatabaseSession session) {
+ IssueExclusionsLoader issueExclusionsLoader, AnalysisMode analysisMode, DatabaseSession session, ResourcePersister resourcePersister) {
this.phases = phases;
this.decoratorsExecutor = decoratorsExecutor;
this.mavenPluginsConfigurator = mavenPluginsConfigurator;
this.issueExclusionsLoader = issueExclusionsLoader;
this.analysisMode = analysisMode;
this.session = session;
+ this.resourcePersister = resourcePersister;
}
/**
sensorsExecutor.execute(sensorContext);
}
+ // Special case for views. ProjectCountDecorator need resource id...
+ resourcePersister.persist();
+
if (phases.isEnabled(Phases.Phase.DECORATOR)) {
decoratorsExecutor.execute();
}
ResourcePersister resourcePersister = new ResourcePersister(null, null, null, null, null);
ScanPersister[] persisters = new ScanPersister[] {otherPersister, measurePersister, resourcePersister};
DefaultPhaseExecutor executor = new DefaultPhaseExecutor(null, null, null, null, null, null,
- null, null, null, null, null, persisters, null, null, null, null, null, null, null);
+ null, null, null, null, null, persisters, null, null, null, null, null, null, null, null);
assertThat(executor.sortedPersisters()).containsSubsequence(resourcePersister, measurePersister);
persisters = new ScanPersister[] {measurePersister, resourcePersister, otherPersister};
executor = new DefaultPhaseExecutor(null, null, null, null, null, null,
- null, null, null, null, null, persisters, null, null, null, null, null, null, null);
+ null, null, null, null, null, persisters, null, null, null, null, null, null, null, null);
assertThat(executor.sortedPersisters()).containsSubsequence(resourcePersister, measurePersister);
persisters = new ScanPersister[] {measurePersister, otherPersister, resourcePersister};
executor = new DefaultPhaseExecutor(null, null, null, null, null, null,
- null, null, null, null, null, persisters, null, null, null, null, null, null, null);
+ null, null, null, null, null, persisters, null, null, null, null, null, null, null, null);
assertThat(executor.sortedPersisters()).containsSubsequence(resourcePersister, measurePersister);
}