当前位置: 首页>>代码示例>>C#>>正文


C# AnalysisConfig.GetAnalysisSettings方法代码示例

本文整理汇总了C#中SonarQube.Common.AnalysisConfig.GetAnalysisSettings方法的典型用法代码示例。如果您正苦于以下问题:C# AnalysisConfig.GetAnalysisSettings方法的具体用法?C# AnalysisConfig.GetAnalysisSettings怎么用?C# AnalysisConfig.GetAnalysisSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SonarQube.Common.AnalysisConfig的用法示例。


在下文中一共展示了AnalysisConfig.GetAnalysisSettings方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public bool Execute(string[] args, AnalysisConfig config, TeamBuildSettings settings, ILogger logger)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            IAnalysisPropertyProvider provider;
            if (!ArgumentProcessor.TryProcessArgs(args, logger, out provider))
            {
                return false;
            }

            logger.Verbosity = VerbosityCalculator.ComputeVerbosity(config.GetAnalysisSettings(true), logger);
            LogStartupSettings(config, settings, logger);

            if (!CheckEnvironmentConsistency(config, settings, logger))
            {
                return false;
            }

            // if initialisation fails a warning will have been logged at the source of the failure
            bool initialised = this.codeCoverageProcessor.Initialise(config, settings, logger);

            if (initialised && !this.codeCoverageProcessor.ProcessCoverageReports())
            {
                //  if processing fails, stop the workflow
                return false;
            }

            ProjectInfoAnalysisResult result = InvokeSonarRunner(provider, config, logger);
            this.reportBuilder.GenerateReports(settings, config, result, logger);
            return result.RanToCompletion;
        }
开发者ID:BrightLight,项目名称:sonar-msbuild-runner,代码行数:46,代码来源:MSBuildPostProcessor.cs

示例2: TryGetRegularExpression

        private string TryGetRegularExpression(AnalysisConfig config)
        {
            Debug.Assert(config != null, "Not expecting the supplied config to be null");

            string regEx;
            config.GetAnalysisSettings(true).TryGetValue(TestRegExSettingId, out regEx);

            if (!string.IsNullOrWhiteSpace(regEx))
            {
                this.Log.LogMessage(MessageImportance.Low, Resources.IsTest_UsingRegExFromConfig, regEx);
            }

            return regEx;
        }
开发者ID:clintcparker,项目名称:sonar-msbuild-runner,代码行数:14,代码来源:IsTestFileByName.cs

示例3: GetAnalysisPropertiesToWrite

        /// <summary>
        /// Returns all of the analysis properties that should
        /// be written to the sonar-project properties file
        /// </summary>
        private static AnalysisProperties GetAnalysisPropertiesToWrite(AnalysisConfig config, ILogger logger)
        {
            AnalysisProperties properties = new AnalysisProperties();

            properties.AddRange(config.GetAnalysisSettings(false).GetAllProperties()
                // Strip out any sensitive properties
                .Where(p => !p.ContainsSensitiveData()));

            // There are some properties we want to override regardless of what the user sets
            AddOrSetProperty(VSBootstrapperPropertyKey, "false", properties, logger);

            return properties;
        }
开发者ID:BrightLight,项目名称:sonar-msbuild-runner,代码行数:17,代码来源:PropertiesFileGenerator.cs

示例4: GetSensitiveFileSettings

        private static IEnumerable<string> GetSensitiveFileSettings(AnalysisConfig config, IEnumerable<string> userCmdLineArguments)
        {
            IEnumerable<Property> allPropertiesFromConfig = config.GetAnalysisSettings(false).GetAllProperties();

            return allPropertiesFromConfig.Where(p => p.ContainsSensitiveData() && !UserSettingExists(p, userCmdLineArguments))
                .Select(p => p.AsSonarRunnerArg());
        }
开发者ID:HSAR,项目名称:sonar-msbuild-runner,代码行数:7,代码来源:SonarRunner.Wrapper.cs

示例5: AssertSettingDoesNotExist

 private static void AssertSettingDoesNotExist(string key, AnalysisConfig actualConfig)
 {
     Property setting;
     bool found = actualConfig.GetAnalysisSettings(true).TryGetProperty(key, out setting);
     Assert.IsFalse(found, "The setting should not exist. Key: {0}", key);
 }
开发者ID:BlackSwanBay,项目名称:sonar-msbuild-runner,代码行数:6,代码来源:AnalysisConfigGeneratorTests.cs

示例6: FindBranch

        private static string FindBranch(AnalysisConfig config)
        {
            string branch = null;

            IAnalysisPropertyProvider localSettings = config.GetAnalysisSettings(includeServerSettings: false);
            Debug.Assert(localSettings != null);

            localSettings.TryGetValue(SonarProperties.ProjectBranch, out branch);

            return branch;
        }
开发者ID:Rinorragi,项目名称:sonar-msbuild-runner,代码行数:11,代码来源:SummaryReportBuilder.cs

示例7: VerifySummaryReportData

        private static void VerifySummaryReportData(
            SummaryReportBuilder.SummaryReportData summaryReportData,
            ProjectInfoAnalysisResult analysisResult,
            string expectedHostUrl,
            AnalysisConfig config)
        {
            string expectedUrl;
            string branch;

            config.GetAnalysisSettings(false).TryGetValue("sonar.branch", out branch);

            if (String.IsNullOrEmpty(branch))
            {
                expectedUrl = String.Format(
                    SummaryReportBuilder.DashboardUrlFormat, 
                    expectedHostUrl, 
                    config.SonarProjectKey);
            }
            else
            {
                expectedUrl = String.Format(
                    SummaryReportBuilder.DashboardUrlFormatWithBranch, 
                    expectedHostUrl, 
                    config.SonarProjectKey, 
                    branch);
            }

            Assert.AreEqual(expectedUrl, summaryReportData.DashboardUrl, "Invalid dashboard url");
            Assert.AreEqual(analysisResult.RanToCompletion, summaryReportData.Succeeded, "Invalid outcome");

        }
开发者ID:BrightLight,项目名称:sonar-msbuild-runner,代码行数:31,代码来源:SummaryReportBuilderTests.cs


注:本文中的SonarQube.Common.AnalysisConfig.GetAnalysisSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。