private final ProjectReactor reactor;
private final Settings settings;
private ProjectBuilder[] projectBuilders;
+ private ProjectExclusions exclusions;
public ProjectReactorReady(ProjectExclusions exclusions, ProjectReactor reactor, Settings settings, @Nullable ProjectBuilder[] projectBuilders) {
+ this.exclusions = exclusions;
this.reactor = reactor;
this.settings = settings;
this.projectBuilders = projectBuilders;
}
public void start() {
+ // 1 Apply project builders
ProjectBuilderContext context = new ProjectBuilderContext() {
@Override
for (ProjectBuilder projectBuilder : projectBuilders) {
projectBuilder.build(context);
}
+
+ // 2 Apply project exclusions
+ exclusions.apply();
+
+ // 3 Validate final reactor
ProjectReactorValidator validator = new ProjectReactorValidator(settings);
validator.validate(reactor);
}
ProjectReactor reactor = newReactor("root", "sub1", "sub2");
ProjectExclusions exclusions = new ProjectExclusions(settings, reactor, null);
- exclusions.start();
+ exclusions.apply();
assertThat(reactor.getProject("root")).isNotNull();
assertThat(reactor.getProject("sub1")).isNull();
Settings settings = new Settings();
ProjectReactor reactor = newReactor("root", "sub1", "sub2");
ProjectExclusions exclusions = new ProjectExclusions(settings, reactor, null);
- exclusions.start();
+ exclusions.apply();
assertThat(reactor.getProject("root")).isNotNull();
assertThat(reactor.getProject("sub1")).isNotNull();
settings.setProperty("sonar.includedModules", "sub1");
ProjectReactor reactor = newReactor("root", "sub1", "sub2");
ProjectExclusions exclusions = new ProjectExclusions(settings, reactor, null);
- exclusions.start();
+ exclusions.apply();
assertThat(reactor.getProject("root")).isNotNull();
assertThat(reactor.getProject("sub1")).isNotNull();
ProjectReactor reactor = new ProjectReactor(root);
ProjectExclusions exclusions = new ProjectExclusions(settings, reactor, null);
- exclusions.start();
+ exclusions.apply();
assertThat(reactor.getProject("root")).isNotNull();
assertThat(reactor.getProject("sub1")).isNull();
ProjectReactor reactor = newReactor("root", "sub1", "sub2");
ProjectExclusions exclusions = new ProjectExclusions(settings, reactor, null);
- exclusions.start();
+ exclusions.apply();
}
@Test
settings.setProperty("sonar.skippedModules", "struts-taglib");
ProjectExclusions exclusions = new ProjectExclusions(settings, reactor, null);
- exclusions.start();
+ exclusions.apply();
assertThat(reactor.getProject("org.apache.struts:struts")).isNotNull();
assertThat(reactor.getProject("org.apache.struts:struts-core")).isNotNull();