本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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());
}
示例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);
}
示例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;
}
示例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");
}