本文整理汇总了C#中ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder.AppendArgument方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessArgumentBuilder.AppendArgument方法的具体用法?C# ProcessArgumentBuilder.AppendArgument怎么用?C# ProcessArgumentBuilder.AppendArgument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder
的用法示例。
在下文中一共展示了ProcessArgumentBuilder.AppendArgument方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSvnRevision
public static int GetSvnRevision(SvnOptions svnOptions)
{
ProcessArgumentBuilder argBuilder = new ProcessArgumentBuilder();
argBuilder.AppendArgument("log");
argBuilder.AppendArgument("--xml");
argBuilder.AppendArgument("--limit 1");
argBuilder.AddArgument(StringHelper.Quote(svnOptions.Url));
ProcessResult result = RunSvnProcess(svnOptions, argBuilder);
XmlDocument xml = new XmlDocument();
xml.LoadXml(result.StandardOutput);
XmlNode node = xml.SelectSingleNode("/log/logentry/@revision");
return Convert.ToInt32(node.InnerText);
}
示例2: Args
private string Args(IIntegrationResult result)
{
ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
builder.AddArgument("/nologo");
if (! StringUtil.IsBlank(Targets)) builder.AddArgument("/t:" + Targets);
builder.AddArgument(GetPropertyArgs(result));
builder.AppendArgument(BuildArgs);
builder.AddArgument(ProjectFile);
builder.AddArgument(GetLoggerArgs(result));
return builder.ToString();
}
示例3: Args
private string Args(IIntegrationResult result)
{
ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
builder.AppendArgument("-nologo");
builder.AppendArgument("-NoProfile");
builder.AppendArgument("-NonInteractive");
builder.AppendArgument("-file");
if (!string.IsNullOrEmpty(Script))
{
if (Script.IndexOf(":") == 1) //drive letter specified, so it's not a relative path
{
builder.AppendArgument(@"""" + Script + @"""");
}
else
{
if (ConfiguredScriptsDirectory.EndsWith("\\"))
{
builder.AppendArgument(@"""" + ConfiguredScriptsDirectory + Script + @"""");
}
else
{
builder.AppendArgument(@"""" + ConfiguredScriptsDirectory + "\\" + Script + @"""");
}
}
}
if (!string.IsNullOrEmpty(BuildArgs)) builder.AppendArgument(BuildArgs);
return builder.ToString();
}
示例4: BuildPushProcessArgs
private string BuildPushProcessArgs()
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AppendArgument("push");
return buffer.ToString();
}
示例5: BuildCloneToArguments
private string BuildCloneToArguments()
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AppendArgument("clone");
buffer.AppendArgument(".");
buffer.AppendArgument(CloneTo);
return buffer.ToString();
}
示例6: BuildResyncCommand
//RESYNC_TEMPLATE = "resync --overwriteChanged --restoreTimestamp-R -S {SandboxRoot\SandboxFile} --user={user} --password={password} --quiet"
private string BuildResyncCommand()
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AppendArgument("resync");
buffer.AppendArgument("--overwriteChanged");
buffer.AppendArgument("--restoreTimestamp");
buffer.AppendArgument("--forceConfirm=yes");
buffer.AppendArgument("--includeDropped");
AppendCommonArguments(buffer, true);
return buffer.ToString();
}
示例7: BuildDisconnectCommand
private string BuildDisconnectCommand()
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AppendArgument("disconnect");
buffer.AppendArgument("--user={0}", User);
buffer.AppendArgument("--password={0}", Password);
buffer.AppendArgument("--quiet");
buffer.AppendArgument("--forceConfirm=yes");
return buffer.ToString();
}
示例8: AppendCommonArguments
private void AppendCommonArguments(ProcessArgumentBuilder buffer, bool recurse, bool omitSandbox)
{
if (recurse)
{
buffer.AppendArgument("-R");
}
if (!omitSandbox)
{
buffer.AddArgument("-S", Path.Combine(SandboxRoot, SandboxFile));
}
buffer.AppendArgument("--user={0}", User);
buffer.AppendArgument("--password={0}", Password);
buffer.AppendArgument("--quiet");
}
示例9: 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();
}
示例10: 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();
}
示例11: CreateAssemblyList
private void CreateAssemblyList(ProcessArgumentBuilder buffer)
{
if (string.IsNullOrEmpty(AssemblyListFile) && (Assemblies == null || Assemblies.Length == 0))
throw new ConfigurationException("[GendarmeTask] Neither 'assemblyListFile' nor 'assemblies' are specified. Please specify one of them.");
// append the assembly list file if set
if (!string.IsNullOrEmpty(AssemblyListFile))
buffer.AppendArgument(string.Concat("@", StringUtil.AutoDoubleQuoteString(AssemblyListFile)));
// build the assembly list by the assembly match collection
foreach (AssemblyMatch asm in Assemblies)
buffer.AppendArgument(asm.Expression);
}
示例12: 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();
}
示例13: GetProcessArguments
/// <summary>
/// Gets the process arguments.
/// </summary>
/// <param name="result">The result.</param>
/// <returns></returns>
protected override string GetProcessArguments(IIntegrationResult result)
{
var builder = new ProcessArgumentBuilder();
builder.Append("\"" + this.fileToValidate + "\"");
builder.AppendArgument("-n");
builder.AppendArgument("-f=x");
builder.AppendArgument("-l=\"{0}\"", this.validationLogFile);
return builder.ToString();
}
示例14: AppendBuildArguments
private void AppendBuildArguments(ProcessArgumentBuilder buffer)
{
var args = System.Text.RegularExpressions.Regex.Split(BuildArgs, @"\n");
foreach (string t in args)
{
if (!string.IsNullOrEmpty(t.Trim())) buffer.AppendArgument(t);
}
}
示例15: 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();
}