public ProjectInfoAnalysisResult Execute(AnalysisConfig config, IEnumerable <string> userCmdLineArguments, ILogger logger) { if (config == null) { throw new ArgumentNullException("config"); } if (userCmdLineArguments == null) { throw new ArgumentNullException("userCmdLineArguments"); } if (logger == null) { throw new ArgumentNullException("logger"); } ProjectInfoAnalysisResult result = PropertiesFileGenerator.GenerateFile(config, logger); Debug.Assert(result != null, "Not expecting the file generator to return null"); result.RanToCompletion = false; SonarProjectPropertiesValidator.Validate( config.SonarRunnerWorkingDirectory, result.Projects, onValid: () => { InternalExecute(config, userCmdLineArguments, logger, result); }, onInvalid: (invalidFolders) => { // LOG error message logger.LogError(Resources.ERR_ConflictingSonarProjectProperties, string.Join(", ", invalidFolders)); }); return(result); }
public ProjectInfoAnalysisResult Execute(AnalysisConfig config, IEnumerable <string> userCmdLineArguments, ILogger logger) { if (config == null) { throw new ArgumentNullException("config"); } if (userCmdLineArguments == null) { throw new ArgumentNullException("userCmdLineArguments"); } if (logger == null) { throw new ArgumentNullException("logger"); } ProjectInfoAnalysisResult result = PropertiesFileGenerator.GenerateFile(config, logger); Debug.Assert(result != null, "Not expecting the file generator to return null"); result.RanToCompletion = false; SonarProjectPropertiesValidator.Validate( config.SonarRunnerWorkingDirectory, result.Projects, onValid: () => { ProjectInfoReportBuilder.WriteSummaryReport(config, result, logger); if (result.FullPropertiesFilePath == null) { // We expect a detailed error message to have been logged explaining // why the properties file generation could not be performed logger.LogInfo(Resources.MSG_PropertiesGenerationFailed); } else { string exeFileName = FindRunnerExe(config, logger); if (exeFileName != null) { result.RanToCompletion = ExecuteJavaRunner(config, userCmdLineArguments, logger, exeFileName, result.FullPropertiesFilePath); } } }, onInvalid: (invalidFolders) => { // LOG error message logger.LogError(Resources.ERR_ConflictingSonarProjectProperties, string.Join(", ", invalidFolders)); }); return(result); }