public AnalysisResult execute() { AnalysisResult result = new AnalysisResult(); Map<String, String> props = new HashMap<>(); props.putAll(tester.globalProperties); props.putAll(taskProperties); Batch.builder() .setGlobalProperties(props) .setEnableLoggingConfiguration(true) .addComponents(new EnvironmentInformation("mediumTest", "1.0"), tester.pluginInstaller, tester.globalRefProvider, tester.qualityProfiles, tester.rulesLoader, tester.branchConfigurationLoader, tester.projectRefProvider, tester.activeRules, tester.serverIssues, tester.settingsLoader, result) .setLogOutput(tester.logOutput) .build().execute(); return result; }
public void setUp(boolean verbose) { Batch.Builder builder = Batch.builder() .setEnableLoggingConfiguration(true) .addComponents( loader, new EnvironmentInformation("mediumTest", "1.0")); if (verbose) { builder.setBootstrapProperties(Collections.singletonMap("sonar.verbose", "true")); } batch = builder.build(); }
Batch createBatch(String sonarVersion, Properties properties, List<Object> extensions) { initLogging(properties); EnvironmentInformation env = new EnvironmentInformation(properties.getProperty("sonarRunner.app"), properties.getProperty("sonarRunner.appVersion")); return Batch.builder() .setEnvironment(env) .addComponents(extensions) .setBootstrapProperties((Map) properties) .build(); }
@Override public Batch createBatch(Properties properties, @Nullable final org.sonar.runner.batch.LogOutput logOutput, @Nullable List<Object> extensions) { EnvironmentInformation env = new EnvironmentInformation(properties.getProperty("sonarRunner.app"), properties.getProperty("sonarRunner.appVersion")); Batch.Builder builder = Batch.builder() .setEnvironment(env) .setBootstrapProperties((Map) properties); if (extensions != null) { builder.addComponents(extensions); } if (logOutput != null) { // Do that is a separate class to avoid NoClassDefFoundError for org/sonar/batch/bootstrapper/LogOutput Compatibility.setLogOutputFor5dot2(builder, logOutput); } return builder.build(); } }
private BatchMediumTester(BatchMediumTesterBuilder builder) { batch = Batch.builder() .setEnableLoggingConfiguration(true) .addComponents( new EnvironmentInformation("mediumTest", "1.0"), builder.pluginsReferential, builder.globalRefProvider, builder.projectRefProvider, builder.serverIssues, builder.serverLineHashes, new DefaultDebtModel()) .setBootstrapProperties(builder.bootstrapProperties) .build(); }