private ProcessInfo GetSourceProcessInfo(IIntegrationResult result, bool getByLabel) { ProcessArgumentBuilder builder = new ProcessArgumentBuilder(); if (getByLabel) { builder.AddArgument("getlabel", Folder); builder.AddArgument(result.Label); } else { builder.AddArgument("get", Folder); } if (UseVaultWorkingDirectory) { builder.AppendArgument("-merge overwrite -performdeletions removeworkingcopy"); } else { builder.AddArgument("-destpath", result.BaseFromWorkingDirectory(WorkingDirectory)); builder.AppendArgument("-merge overwrite"); } builder.AppendArgument("-setfiletime checkin -makewritable"); AddCommonOptionalArguments(builder); return(ProcessInfoFor(builder.ToString(), result)); }
// 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()); }
/// <summary> /// Gets the process arguments. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> /// <remarks></remarks> protected override string GetProcessArguments(IIntegrationResult result) { ProcessArgumentBuilder b = new ProcessArgumentBuilder(); b.AddArgument("/nologo"); if (!string.IsNullOrEmpty(Targets)) { b.AddArgument("/t:"); string targets = string.Empty; foreach (string target in Targets.Split(';')) { if (!(targets != null && targets.Length == 0)) { targets = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0};{1}", targets, StringUtil.AutoDoubleQuoteString(target)); } else { targets = StringUtil.AutoDoubleQuoteString(target); } } b.Append(targets); } b.AppendArgument(GetPropertyArgs(result)); b.AppendArgument(BuildArgs); b.AddArgument(ProjectFile); b.AppendArgument(GetLoggerArgs(result)); return(b.ToString()); }
/// <summary> /// Gets the process arguments. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> /// <remarks></remarks> protected override string GetProcessArguments(IIntegrationResult result) { ProcessArgumentBuilder args = new ProcessArgumentBuilder(); args.AddArgument("--rakefile", Rakefile); if (Silent) { args.AddArgument("--silent"); } else if (Quiet) { args.AddArgument("--quiet"); } if (Trace) { args.AddArgument("--trace"); } args.AppendArgument(BuildArgs); foreach (string t in Targets) { args.AppendArgument(t); } return(args.ToString()); }
private string BuildTagProcessArgs(string label) { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument("tag"); buffer.AppendArgument(label); return(buffer.ToString()); }
private string BuildCloneToArguments() { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument("clone"); buffer.AppendArgument("."); buffer.AppendArgument(CloneTo); return(buffer.ToString()); }
//CHECKPOINT_TEMPLATE = "checkpoint -d "Cruise Control.Net Build -{lebel}" -L "CCNET Build - {lebel}" -R -S {SandboxRoot\SandboxFile} --user={user} --password={password} --quiet" private string BuildCheckpointCommand(string label) { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument("checkpoint"); buffer.AppendArgument("-d \"Cruise Control.Net Build - {0}\"", label); buffer.AppendArgument("-L \"Build - {0}\"", label); AppendCommonArguments(buffer, true); return buffer.ToString(); }
/// <summary> /// Gets the process arguments. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> /// <remarks></remarks> protected override string GetProcessArguments(IIntegrationResult result) { var buffer = new ProcessArgumentBuilder(); buffer.AppendArgument(StringUtil.AutoDoubleQuoteString(BuildFile)); buffer.AppendArgument("logfile={0}", StringUtil.AutoDoubleQuoteString(GetFakeOutputFile(result))); AppendIntegrationResultProperties(buffer, result); return(buffer.ToString()); }
/// <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()); }
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(); }
/// <summary> /// News the get source process info. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> /// <remarks></remarks> public ProcessInfo NewGetSourceProcessInfo(IIntegrationResult result) { ProcessArgumentBuilder builder = new ProcessArgumentBuilder(); builder.AppendArgument(string.Format(System.Globalization.CultureInfo.CurrentCulture,"update {0}", result.BaseFromWorkingDirectory(WorkingDirectory))); if (Forced) { builder.AppendArgument("--forced"); } return NewProcessInfoWithArgs(result, builder.ToString()); }
// HISTORY_COMMAND_FORMAT = "log TrunkUrl --revision \"{{{StartDate}}}:{{{EndDate}}}\" --verbose --xml --non-interactive"; private ProcessInfo NewHistoryProcessInfo(IIntegrationResult from, IIntegrationResult to) { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AddArgument("log"); buffer.AddArgument(TrunkUrl); buffer.AppendArgument(string.Format("-r \"{{{0}}}:{{{1}}}\"", FormatCommandDate(from.StartTime), FormatCommandDate(to.StartTime))); buffer.AppendArgument("--verbose --xml"); AppendCommonSwitches(buffer); return(NewProcessInfo(buffer.ToString(), to)); }
/// <summary> /// Goes to branch process info. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> /// <remarks></remarks> public ProcessInfo GoToBranchProcessInfo(IIntegrationResult result) { ProcessArgumentBuilder builder = new ProcessArgumentBuilder(); builder.AppendArgument(string.Format(System.Globalization.CultureInfo.CurrentCulture,"stb {0}", Branch)); if (!(Repository != null && Repository.Length == 0)) { builder.AppendArgument(string.Format(System.Globalization.CultureInfo.CurrentCulture,"-repository={0}", Repository)); } builder.AppendArgument("--noupdate"); return NewProcessInfoWithArgs(result, builder.ToString()); }
//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(); }
// TAG_COMMAND_FORMAT = "copy --message "CCNET build label" "trunkUrl" "tagBaseUrl/label" private ProcessInfo NewLabelProcessInfo(IIntegrationResult result) { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument("copy"); buffer.AppendArgument(TagMessage(result.Label)); buffer.AppendArgument(TagSource(result.LastChangeNumber)); buffer.AppendArgument(TagDestination(result.Label)); AppendRevision(buffer, result.LastChangeNumber); AppendCommonSwitches(buffer); return(NewProcessInfo(buffer.ToString(), result)); }
// Added to support SvnRevisionLabeller private ProcessInfo NewInfoProcessInfo(IIntegrationResult result) { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AddArgument("info"); buffer.AddArgument(TrunkUrl); buffer.AppendArgument(string.Format("-r \"{{{0}}}\"", DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture))); buffer.AppendArgument("--xml"); AppendCommonSwitches(buffer); return(NewProcessInfo(buffer.ToString(), result)); }
private string BuildHistoryProcessArgs() { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument("changes"); buffer.AppendArgument("-R"); if (FileHistory) { buffer.AppendArgument("-v"); } return(buffer.ToString()); }
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()); }
/// <summary> /// Gets the latest Subversion revision by checking the last log entry. /// </summary> /// <remarks> /// If an error occurs while parsing the Subversion log, the revision number will be returned /// as a <c>0</c>. /// </remarks> /// <returns>The last revision number.</returns> protected virtual int GetRevision() { // Set up the command-line arguments required ProcessArgumentBuilder argBuilder = new ProcessArgumentBuilder(); argBuilder.AppendArgument("log"); argBuilder.AppendArgument("--xml"); argBuilder.AppendArgument("--limit 1"); argBuilder.AddArgument(Quote(Url)); if (TrustServerCertificate) { argBuilder.AppendArgument("--trust-server-cert"); } if (!String.IsNullOrEmpty(Username)) { AppendCommonSwitches(argBuilder); } // Run the svn log command and capture the results ProcessResult result = RunSvnProcess(argBuilder); Log.Debug("Received XML : " + result.StandardOutput); try { // Load the results into an XML document XmlDocument xml = new XmlDocument(); xml.LoadXml(result.StandardOutput); // Retrieve the revision number from the XML XmlNode node = xml.SelectSingleNode(RevisionXPath); return(Convert.ToInt32(node.InnerText)); } catch (XmlException) { return(0); } catch (XPathException) { return(0); } catch (OverflowException) { return(0); } catch (FormatException) { return(0); } }
/// <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()); }
/// <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); AppendBuildArguments(buffer); AppendIntegrationResultProperties(buffer, result); AppendTargets(buffer); return(buffer.ToString()); }
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()); }
// HISTORY_COMMAND_FORMAT = "log TrunkUrl --revision \"{{{StartDate}}}:{{{EndDate}}}\" --verbose --xml --non-interactive"; private ProcessInfo NewHistoryProcessInfo(IIntegrationResult from, IIntegrationResult to) { Log.Info(string.Format("{0}:Begin", System.Reflection.MethodBase.GetCurrentMethod().Name)); ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AddArgument("log"); Log.Info(string.Format("{0}:TrunkUrl={1}", System.Reflection.MethodBase.GetCurrentMethod().Name, TrunkUrl)); buffer.AddArgument(TrunkUrl); Log.Info(string.Format("{0}:-r '{1}'", System.Reflection.MethodBase.GetCurrentMethod().Name, string.Format("-r \"{{{0}}}:{{{1}}}\"", FormatCommandDate(from.StartTime), FormatCommandDate(to.StartTime)))); buffer.AppendArgument(string.Format("-r \"{{{0}}}:{{{1}}}\"", FormatCommandDate(from.StartTime), FormatCommandDate(to.StartTime))); buffer.AppendArgument("--verbose --xml"); AppendCommonSwitches(buffer); return(NewProcessInfo(buffer.ToString(), to)); }
private void AppendTargets(ProcessArgumentBuilder buffer) { foreach (string t in Targets) { buffer.AppendArgument(t); } }
private void AppendTargets(ProcessArgumentBuilder buffer) { for (int i = 0; i < Targets.Length; i++) { buffer.AppendArgument(Targets[i]); } }
private string BuildPushProcessArgs() { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument("push"); return(buffer.ToString()); }
//VIEEWSANDBOX_TEMPLATE = "viewsandbox -R {SandboxRoot\SandboxFile} --user={user} --password={password} --quiet --xmlapi" private string BuildSandboxModsCommand() { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument("viewsandbox --nopersist --filter=changed:all --xmlapi"); AppendCommonArguments(buffer, true); return buffer.ToString(); }
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"); }
/// <summary> /// Labels the process info. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> /// <remarks></remarks> public ProcessInfo LabelProcessInfo(IIntegrationResult result) { string labelName = LabelPrefix + result.Label; ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AppendArgument(string.Format(System.Globalization.CultureInfo.CurrentCulture,"label -R lb:{0} .", labelName)); return NewProcessInfoWithArgs(result, buffer.ToString()); }
/// <summary> /// Generate the list of reports to generate. /// </summary> /// <param name="buffer"></param> private void GenerateReportList(ProcessArgumentBuilder buffer) { var reportList = new List <NCoverReportType>(); if ((Reports != null) && (Reports.Length > 0)) { reportList.AddRange(Reports); } else { reportList.Add(NCoverReportType.FullCoverageReport); } foreach (var report in reportList) { var path = OutputDir; if (report == NCoverReportType.FullCoverageReport) { path = RootPath(path, false); } else { path = RootPath(string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0}.html", report), false); } buffer.AppendArgument("//or \"{0}\"", string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0}:Html:{1}", report, path)); } }