private static void InternalExecute(AnalysisConfig config, IEnumerable <string> userCmdLineArguments, ILogger logger, ProjectInfoAnalysisResult result)
        {
            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 = FindScannerExe();
                result.RanToCompletion = ExecuteJavaRunner(config, userCmdLineArguments, logger, exeFileName, result.FullPropertiesFilePath);
            }
        }
        public static void WriteSummaryReport(AnalysisConfig config, ProjectInfoAnalysisResult result, ILogger logger)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (result == null)
            {
                throw new ArgumentNullException("result");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            var builder = new ProjectInfoReportBuilder(config, result, logger);
            builder.Generate();
        }
        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");
            }

            var result = new PropertiesFileGenerator(config, logger).GenerateFile();

            Debug.Assert(result != null, "Not expecting the file generator to return null");
            result.RanToCompletion = false;

            SonarProjectPropertiesValidator.Validate(
                config.SonarScannerWorkingDirectory,
                result.Projects,
                onValid: () =>
            {
                ProjectInfoReportBuilder.WriteSummaryReport(config, result, logger);

                result.RanToCompletion = InternalExecute(config, userCmdLineArguments, logger, result.FullPropertiesFilePath);
            },
                onInvalid: (invalidFolders) =>
            {
                // LOG error message
                logger.LogError(Resources.ERR_ConflictingSonarProjectProperties, string.Join(", ", invalidFolders));
            });

            return(result);
        }