本文整理汇总了C#中ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder.AppendIf方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessArgumentBuilder.AppendIf方法的具体用法?C# ProcessArgumentBuilder.AppendIf怎么用?C# ProcessArgumentBuilder.AppendIf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder
的用法示例。
在下文中一共展示了ProcessArgumentBuilder.AppendIf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetProcessArguments
/// <summary>
/// Retrieve the arguments
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
protected override string GetProcessArguments(IIntegrationResult result)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
var coverageFile = string.IsNullOrEmpty(CoverageFile) ? "coverage.xml" : CoverageFile;
buffer.AppendArgument(RootPath(coverageFile, true));
// Add all the NCover arguments
buffer.AppendIf(ClearCoverageFilters, "//ccf");
foreach (var filter in CoverageFilters ?? new CoverageFilter[0])
{
buffer.AppendArgument("//cf {0}", filter.ToParamString());
}
foreach (var threshold in MinimumThresholds ?? new CoverageThreshold[0])
{
buffer.AppendArgument("//mc {0}", threshold.ToParamString());
}
buffer.AppendIf(UseMinimumCoverage, "//mcsc");
buffer.AppendIf(XmlReportFilter != NCoverReportFilter.Default, "//rdf {0}", XmlReportFilter.ToString());
foreach (var threshold in SatisfactoryThresholds ?? new CoverageThreshold[0])
{
buffer.AppendArgument("//sct {0}", threshold.ToParamString());
}
buffer.AppendIf(NumberToReport > 0, "//smf {0}", NumberToReport.ToString());
buffer.AppendIf(!string.IsNullOrEmpty(TrendOutputFile), "//at \"{0}\"", RootPath(TrendOutputFile, false));
buffer.AppendArgument("//bi \"{0}\"", string.IsNullOrEmpty(BuildId) ? result.Label : BuildId);
buffer.AppendIf(!string.IsNullOrEmpty(HideElements), "//hi \"{0}\"", HideElements);
buffer.AppendIf(!string.IsNullOrEmpty(TrendInputFile), "//lt \"{0}\"", RootPath(TrendInputFile, false));
GenerateReportList(buffer);
buffer.AppendIf(!string.IsNullOrEmpty(ProjectName), "//p \"{0}\"", ProjectName);
buffer.AppendIf(SortBy != NCoverSortBy.None, "//so \"{0}\"", SortBy.ToString());
buffer.AppendIf(TopUncoveredAmount > 0, "//tu \"{0}\"", TopUncoveredAmount.ToString());
buffer.AppendIf(MergeMode != NCoverMergeMode.Default, "//mfm \"{0}\"", MergeMode.ToString());
buffer.AppendIf(!string.IsNullOrEmpty(MergeFile), "//s \"{0}\"", RootPath(MergeFile, false));
buffer.AppendIf(!string.IsNullOrEmpty(WorkingDirectory), "//w \"{0}\"", RootPath(WorkingDirectory, false));
return buffer.ToString();
}
示例2: GetProcessArguments
/// <summary>
/// Retrieve the arguments
/// </summary>
/// <param name="result">The result to use.</param>
/// <returns>The arguments to pass to the process.</returns>
protected override string GetProcessArguments(IIntegrationResult result)
{
var buffer = new ProcessArgumentBuilder();
buffer.AppendIf(this.Recurse, "-r");
buffer.AppendArgument("-t" + this.Threshold.ToString(CultureInfo.CurrentCulture));
buffer.AppendArgument("-w" + this.Width.ToString(CultureInfo.CurrentCulture));
buffer.AppendArgument("-oConsole");
// Add the focus
if (!string.IsNullOrEmpty(this.Focus))
{
buffer.AppendArgument("-f" + this.QuoteSpaces(this.Focus));
}
// Add the lines to exclude
foreach (var line in this.LinesToExclude ?? new string[0])
{
buffer.AppendArgument("-x" + this.QuoteSpaces(line));
}
// Add the lines to exclude
foreach (var line in this.FilesToExclude ?? new string[0])
{
buffer.AppendArgument("-e" + this.QuoteSpaces(line));
}
buffer.AppendArgument(this.FileMask);
return buffer.ToString();
}
示例3: NewGetSourceProcessInfo
private ProcessInfo NewGetSourceProcessInfo(IIntegrationResult result)
{
ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
AppendCvsRoot(builder);
builder.AppendArgument("-q update -d -P"); // build directories, prune empty directories
builder.AppendIf(CleanCopy, "-C");
builder.AddArgument("-r", Branch);
return NewProcessInfoWithArgs(result, builder.ToString());
}
示例4: GetProcessArguments
/// <summary>
/// Gets the process arguments.
/// </summary>
/// <param name="result">The result.</param>
/// <returns></returns>
/// <remarks></remarks>
protected override string GetProcessArguments(IIntegrationResult result)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AppendIf(NoLogo, "-nologo");
buffer.AppendArgument(@"-buildfile:{0}", StringUtil.AutoDoubleQuoteString(BuildFile));
buffer.AppendArgument("-logger:{0}", Logger);
buffer.AppendArgument("-logfile:{0}", StringUtil.AutoDoubleQuoteString(GetNantOutputFile(result)));
buffer.AppendArgument("-listener:{0}", Listener);
buffer.AppendArgument(BuildArgs);
AppendIntegrationResultProperties(buffer, result);
AppendTargets(buffer);
return buffer.ToString();
}
示例5: GetProcessArguments
/// <summary>
/// Gets the process arguments.
/// </summary>
/// <param name="result">The result.</param>
/// <returns></returns>
/// <remarks></remarks>
protected override string GetProcessArguments(IIntegrationResult result)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AppendIf(!string.IsNullOrEmpty(ConfigFile), "--config {0}", StringUtil.AutoDoubleQuoteString(ConfigFile));
buffer.AppendIf(!string.IsNullOrEmpty(RuleSet), "--set {0}", RuleSet);
buffer.AppendIf(!string.IsNullOrEmpty(IgnoreFile), "--ignore {0}", StringUtil.AutoDoubleQuoteString(IgnoreFile));
buffer.AppendIf(Limit > 0, "--limit {0}", Limit.ToString(CultureInfo.CurrentCulture));
buffer.AppendIf(!string.IsNullOrEmpty(Severity), "--severity {0}", Severity);
buffer.AppendIf(!string.IsNullOrEmpty(Confidence), "--confidence {0}", Confidence);
buffer.AppendIf(Quiet, "--quiet");
buffer.AppendIf(Verbose, "--verbose");
// append output xml file
buffer.AppendArgument("--xml {0}", StringUtil.AutoDoubleQuoteString(GetGendarmeOutputFile(result)));
// append assembly list or list file
CreateAssemblyList(buffer);
return buffer.ToString();
}
示例6: BuildLogProcessInfoArgs
// cvs [-d :ext:mycvsserver:/cvsroot/myrepo] -q log -N "-d>2004-12-24 12:00:00 GMT" -rmy_branch (with branch)
// cvs [-d :ext:mycvsserver:/cvsroot/myrepo] -q log -Nb "-d>2004-12-24 12:00:00 GMT" (without branch)
// public const string HISTORY_COMMAND_FORMAT = @"{0}-q log -N{3} ""-d>{1}""{2}"; // -N means 'do not show tags'
private string BuildLogProcessInfoArgs(DateTime from)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
AppendCvsRoot(buffer);
buffer.AddArgument("-q"); // quiet
buffer.AddArgument("rlog");
buffer.AddArgument("-N"); // do not show tags
buffer.AppendIf(SuppressRevisionHeader, "-S");
if (string.IsNullOrEmpty(Branch))
{
buffer.AddArgument("-b"); // only list revisions on HEAD
}
else
{
buffer.AppendArgument("-r{0}", Branch); // list revisions on branch
}
buffer.AppendArgument(@"""-d>{0}""", FormatCommandDate(from));
if (!string.IsNullOrEmpty(RestrictLogins))
{
foreach (string login in RestrictLogins.Split(','))
{
buffer.AppendArgument("-w{0}", login.Trim());
}
}
buffer.AddArgument(Module);
return buffer.ToString();
}
示例7: AppendNoLogoArg
private void AppendNoLogoArg(ProcessArgumentBuilder buffer)
{
buffer.AppendIf(NoLogo, "-nologo");
}
示例8: CreateHistoryArguments
private string CreateHistoryArguments(string fromDate)
{
ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
builder.AppendArgument("lshist -r -nco");
builder.AppendIf(Branch != null, "-branch \"{0}\"", Branch);
builder.AppendArgument("-since {0}", fromDate);
builder.AppendArgument("-fmt \"%u{0}%Vd{0}%En{0}%Vn{0}%o{0}!%l{0}!%a{0}%Nc", ClearCaseHistoryParser.DELIMITER);
builder.Append(ClearCaseHistoryParser.END_OF_LINE_DELIMITER + "\\n\"");
builder.AppendArgument("\"{0}\"", ViewPath);
return builder.ToString();
}
示例9: GetProcessArguments
/// <summary>
/// Retrieve the arguments
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
protected override string GetProcessArguments(IIntegrationResult result)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.Append(RootPath(ProgramToCover, true));
if (!string.IsNullOrEmpty(TestProject))
{
string testProject;
if (!string.IsNullOrEmpty(WorkingDirectory))
{
testProject = Path.Combine(RootPath(WorkingDirectory, false), TestProject);
testProject = StringUtil.AutoDoubleQuoteString(testProject);
}
else
{
testProject = RootPath(TestProject, true);
}
buffer.AppendArgument(testProject);
}
buffer.AppendArgument(ProgramParameters);
// Add all the NCover arguments
buffer.AppendIf(!string.IsNullOrEmpty(LogFile), "//l \"{0}\"", RootPath(LogFile, false));
buffer.AppendIf(LogLevel != NCoverLogLevel.Default, "//ll {0}", LogLevel.ToString());
buffer.AppendIf(!string.IsNullOrEmpty(ProjectName), "//p \"{0}\"", ProjectName);
buffer.AppendIf(!string.IsNullOrEmpty(CoverageFile), "//x \"{0}\"", RootPath(CoverageFile, false));
buffer.AppendIf(string.IsNullOrEmpty(CoverageFile), "//x \"{0}\"", RootPath("Coverage.xml", false));
buffer.AppendIf(!string.IsNullOrEmpty(CoverageMetric), "//ct \"{0}\"", CoverageMetric);
buffer.AppendIf(!string.IsNullOrEmpty(ExcludedAttributes), "//ea \"{0}\"", ExcludedAttributes);
buffer.AppendIf(!string.IsNullOrEmpty(ExcludedAssemblies), "//eas \"{0}\"", ExcludedAssemblies);
buffer.AppendIf(!string.IsNullOrEmpty(ExcludedFiles), "//ef \"{0}\"", ExcludedFiles);
buffer.AppendIf(!string.IsNullOrEmpty(ExcludedMethods), "//em \"{0}\"", ExcludedMethods);
buffer.AppendIf(!string.IsNullOrEmpty(ExcludedTypes), "//et \"{0}\"", ExcludedTypes);
buffer.AppendIf(!string.IsNullOrEmpty(IncludedAttributes), "//ia \"{0}\"", IncludedAttributes);
buffer.AppendIf(!string.IsNullOrEmpty(IncludedAssemblies), "//ias \"{0}\"", IncludedAssemblies);
buffer.AppendIf(!string.IsNullOrEmpty(IncludedFiles), "//if \"{0}\"", IncludedFiles);
buffer.AppendIf(!string.IsNullOrEmpty(IncludedTypes), "//it \"{0}\"", IncludedTypes);
buffer.AppendIf(DisableAutoexclusion, "//na");
buffer.AppendIf(!string.IsNullOrEmpty(ProcessModule), "//pm \"{0}\"", ProcessModule);
buffer.AppendIf(!string.IsNullOrEmpty(SymbolSearch), "//ssp \"{0}\"", SymbolSearch);
buffer.AppendIf(!string.IsNullOrEmpty(TrendFile), "//at \"{0}\"", RootPath(TrendFile, false));
buffer.AppendArgument("//bi \"{0}\"", !string.IsNullOrEmpty(BuildId) ? BuildId : result.Label);
buffer.AppendIf(!string.IsNullOrEmpty(SettingsFile), "//cr \"{0}\"", RootPath(SettingsFile, false));
buffer.AppendIf(Register, "//reg");
buffer.AppendIf(!string.IsNullOrEmpty(WorkingDirectory), "//w \"{0}\"", RootPath(WorkingDirectory, false));
buffer.AppendIf(ApplicationLoadWait > 0, "//wal {0}", ApplicationLoadWait.ToString(CultureInfo.CurrentCulture));
buffer.AppendIf(CoverIis, "//iis");
buffer.AppendIf(ServiceTimeout > 0, "//st {0}", ServiceTimeout.ToString(CultureInfo.CurrentCulture));
buffer.AppendIf(!string.IsNullOrEmpty(WindowsService), "//svc {0}", WindowsService);
return buffer.ToString();
}
示例10: GetProcessArguments
/// <summary>
/// Retrieve the arguments
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
protected override string GetProcessArguments(IIntegrationResult result)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.Append(RootPath(ProjectFile, true));
buffer.AppendIf(Silent, "/Silent");
buffer.AppendIf(EmitXml, "/EmitVisualNDependBinXml ");
if ((InputDirs != null) && (InputDirs.Length > 0))
{
List<string> dirs = new List<string>();
foreach (string dir in InputDirs)
{
dirs.Add(RootPath(dir, true));
}
buffer.AppendArgument("/InDirs {0}", string.Join(" ", dirs.ToArray()));
}
buffer.AppendArgument("/OutDir {0}", RootPath(OutputDir, true));
if (!string.IsNullOrEmpty(ReportXslt))
{
buffer.AppendArgument("/XslForReport {0}", RootPath(ReportXslt, true));
}
return buffer.ToString();
}
示例11: GetProcessArguments
/// <summary>
/// Retrieve the arguments
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
protected override string GetProcessArguments(IIntegrationResult result)
{
var buffer = new ProcessArgumentBuilder();
buffer.AppendArgument("/wd:{0}", this.QuoteSpaces(this.rootPath));
buffer.AppendArgument("/out:{0}", this.RootPath(string.IsNullOrEmpty(this.OutputFile) ? defaultOutput : this.OutputFile, true));
buffer.AppendArgument("/t:{0}", this.ProfilerTimeOut.ToString());
switch (this.TraceLevelValue)
{
case TraceLevel.Line:
buffer.AppendArgument("/ll");
break;
case TraceLevel.Method:
buffer.AppendArgument("/ml");
break;
}
buffer.AppendIf(this.ForceOverwrite, "/f");
buffer.AppendIf(this.OnlyWithSource, "/ows");
buffer.AppendIf(this.UseSampling, "/sm");
buffer.AppendIf(this.IncludeSubProcesses, "/sp");
buffer.AppendIf(this.RecordSqlAndIO, "/rs");
buffer.AppendArgument("/is:{0}", GenerateOnOff(this.IncludeSource));
buffer.AppendArgument("/in:{0}", GenerateOnOff(this.AllowInlining));
buffer.AppendArgument("/comp:{0}", GenerateOnOff(this.Compensate));
buffer.AppendArgument("/simp:{0}", GenerateOnOff(this.SimplifyStackTraces));
buffer.AppendArgument("/notriv:{0}", GenerateOnOff(this.AvoidTrivial));
buffer.AppendIf(!string.IsNullOrEmpty(this.Service), "/service:{0}", this.QuoteSpaces(this.Service));
buffer.AppendIf(!string.IsNullOrEmpty(this.ComPlus), "/complus:{0}", this.QuoteSpaces(this.ComPlus));
buffer.AppendIf(!string.IsNullOrEmpty(this.Silverlight), "/silverlight:{0}", this.QuoteSpaces(this.Silverlight));
buffer.AppendIf(!string.IsNullOrEmpty(this.Application), "/e:{0}", this.RootPath(this.Application, true));
buffer.AppendIf(!string.IsNullOrEmpty(this.ApplicationArguments), "/args:{0}", this.ApplicationArguments);
buffer.AppendIf(this.Quiet, "/q");
buffer.AppendIf(this.Verbose, "/v");
buffer.AppendIf(!string.IsNullOrEmpty(this.XmlArgsFile), "/argfile:{0}", this.RootPath(this.XmlArgsFile, true));
buffer.AppendIf(this.Threshold.HasValue, "/threshold:{0}", this.Threshold.ToString());
buffer.AppendIf(!string.IsNullOrEmpty(this.SummaryCsvFile), "/csv:{0}", this.RootPath(this.SummaryCsvFile, true));
buffer.AppendIf(!string.IsNullOrEmpty(this.SummaryXmlFile), "/xml:{0}", this.RootPath(this.SummaryXmlFile, true));
buffer.AppendIf(!string.IsNullOrEmpty(this.SummaryHtmlFile), "/h:{0}", this.RootPath(this.SummaryHtmlFile, true));
buffer.AppendIf(!string.IsNullOrEmpty(this.CallTreeXmlFile), "/calltree:{0}", this.RootPath(this.CallTreeXmlFile, true));
buffer.AppendIf(!string.IsNullOrEmpty(this.CallTreeHtmlFile), "/cth:{0}", this.RootPath(this.CallTreeHtmlFile, true));
buffer.AppendIf(!string.IsNullOrEmpty(this.DataFile), "/data:{0}", this.RootPath(this.DataFile, true));
return buffer.ToString();
}
示例12: AppendRevision
private void AppendRevision(ProcessArgumentBuilder buffer, int revision)
{
buffer.AppendIf(revision > 0, "--revision {0}", revision.ToString());
}
示例13: NewGetSourceProcessInfo
private ProcessInfo NewGetSourceProcessInfo(IIntegrationResult result, string dir)
{
ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
AppendCvsRoot(builder);
builder.AppendArgument("-q update -d -P"); // build directories, prune empty directories
builder.AppendIf(CleanCopy, "-C");
builder.AppendIf(UseHistory && dir != null, "-l");
builder.AppendIf(UseHistory && dir != null, "\"{0}\"", dir);
return NewProcessInfoWithArgs(result, builder.ToString());
}
示例14: BuildHistoryProcessInfoArgs
// cvs [-d :ext:mycvsserver:/cvsroot/myrepo] -q log -N "-d>2004-12-24 12:00:00 'GMT'" -rmy_branch (with branch)
// cvs [-d :ext:mycvsserver:/cvsroot/myrepo] -q log -Nb "-d>2004-12-24 12:00:00 'GMT'" (without branch)
// public const string HISTORY_COMMAND_FORMAT = @"{0}-q log -N{3} ""-d>{1}""{2}"; // -N means 'do not show tags'
// in cvs, date 'to' is implicitly now
// todo: if cvs will accept a 'to' date, it would be nicer to
// include that for some harmony with the vss version
private string BuildHistoryProcessInfoArgs(DateTime from, string dir)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
AppendCvsRoot(buffer);
buffer.AppendArgument("-q log -N");
buffer.AppendIf(UseHistory, "-l");
buffer.AppendIf(StringUtil.IsBlank(Branch), "-b");
buffer.AppendArgument(@"""-d>{0}""", FormatCommandDate(from));
buffer.AppendArgument("-r{0}", Branch);
if (! StringUtil.IsBlank(RestrictLogins))
{
foreach (string login in RestrictLogins.Split(','))
{
buffer.AppendArgument("-w{0}", login.Trim());
}
}
buffer.AppendIf(UseHistory && dir != null, @"""{0}""", dir);
return buffer.ToString();
}
示例15: AddCommonOptionalArguments
protected void AddCommonOptionalArguments(ProcessArgumentBuilder builder)
{
builder.AddArgument("-host", _shim.Host);
builder.AddArgument("-user", _shim.Username);
builder.AddArgument("-password", _shim.Password);
builder.AddArgument("-repository", _shim.Repository);
builder.AppendIf(_shim.Ssl, "-ssl");
builder.AddArgument("-proxyserver", _shim.proxyServer);
builder.AddArgument("-proxyport", _shim.proxyPort);
builder.AddArgument("-proxyuser", _shim.proxyUser);
builder.AddArgument("-proxypassword", _shim.proxyPassword);
builder.AddArgument("-proxydomain", _shim.proxyDomain);
builder.AppendArgument(_shim.otherVaultArguments);
}