コード例 #1
0
ファイル: MsBuildTask.cs プロジェクト: vardars/ci-factory
 private string GetLoggerArgs(IIntegrationResult result)
 {
     ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
     builder.Append("/l:");
     builder.Append(Logger);
     builder.Append(";");
     builder.Append(MsBuildOutputFile(result));
     return builder.ToString();
 }
コード例 #2
0
ファイル: SvnProcessHelper.cs プロジェクト: nfrey/qreal
        public static ProcessResult RunSvnProcess(SvnOptions svnLoginOptions, ProcessArgumentBuilder argBuilder)
        {
            argBuilder.AddArgument("--non-interactive");
            argBuilder.AddArgument("--no-auth-cache");

            ProcessInfo info = new ProcessInfo("svn.exe", argBuilder.ToString());

            ProcessExecutor executor = new ProcessExecutor();
            ProcessResult result = executor.Execute(info);
            return result;
        }
コード例 #3
0
ファイル: NUnitArgument.cs プロジェクト: vardars/ci-factory
        public override string ToString()
        {
            ProcessArgumentBuilder argsBuilder = new ProcessArgumentBuilder();
            argsBuilder.AddArgument("/xml", "=", outputfile);
            argsBuilder.AddArgument("/nologo");

            foreach (string assemblyName in assemblies)
            {
                argsBuilder.AddArgument(assemblyName);
            }
            return argsBuilder.ToString();
        }
コード例 #4
0
ファイル: MsBuildTask.cs プロジェクト: vardars/ci-factory
        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();
        }
コード例 #5
0
ファイル: BitKeeper.cs プロジェクト: derrills1/ccnet_gitmode
 private string BuildPushProcessArgs()
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.AppendArgument("push");
     return buffer.ToString();
 }
コード例 #6
0
ファイル: BitKeeper.cs プロジェクト: derrills1/ccnet_gitmode
 private string BuildGetSourceArguments()
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.Append("pull");
     return buffer.ToString();
 }
コード例 #7
0
ファイル: Mks.cs プロジェクト: derrills1/ccnet_gitmode
 private void RemoveReadOnlyAttribute()
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.AddArgument("-R");
     buffer.AddArgument("/s", SandboxRoot + "\\*");
     Execute(new ProcessInfo("attrib", buffer.ToString()));
 }
コード例 #8
0
ファイル: Mks.cs プロジェクト: derrills1/ccnet_gitmode
 //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();
 }
コード例 #9
0
ファイル: Mks.cs プロジェクト: derrills1/ccnet_gitmode
 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();
 }
コード例 #10
0
        /// <summary>
        /// Updates and fetches git submodules.
        /// </summary>
        /// <param name="result"></param>
        private void GitUpdateSubmodules(IIntegrationResult result)
        {
            ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
            buffer.AddArgument("submodule");
            buffer.AddArgument("update");

            // initialize progress information
            var bpi = GetBuildProgressInformation(result);
            bpi.SignalStartRunTask(string.Concat("git ", buffer.ToString()));

            // enable Stdout monitoring
            ProcessExecutor.ProcessOutput += ProcessExecutor_ProcessOutput;

            Execute(NewProcessInfo(buffer.ToString(), result));

            // remove Stdout monitoring
            ProcessExecutor.ProcessOutput -= ProcessExecutor_ProcessOutput;
        }
コード例 #11
0
		/// <summary>
		/// Clone a repository into a new directory with "git clone 'repository' 'working directory'".
		/// </summary>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitClone(IIntegrationResult result)
		{
			string wd = BaseWorkingDirectory(result);

			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("clone");
			buffer.AddArgument(Repository);
			buffer.AddArgument(wd);

			// initialize progress information
			var bpi = GetBuildProgressInformation(result);
			bpi.SignalStartRunTask(string.Concat("git ", buffer.ToString()));

			// enable Stdout monitoring
			ProcessExecutor.ProcessOutput += ProcessExecutor_ProcessOutput;

			ProcessInfo pi = NewProcessInfo(buffer.ToString(), result);
			// Use upper level of the working directory, because the
			// working directory currently does not exist and
			// will be created by "git clone". "git clone" will fail if
			// the working directory already exist.
			pi.WorkingDirectory = Path.GetDirectoryName(wd.Trim().TrimEnd(Path.DirectorySeparatorChar));
			Execute(pi);

			// remove Stdout monitoring
			ProcessExecutor.ProcessOutput -= ProcessExecutor_ProcessOutput;
		}
コード例 #12
0
		private ProcessResult GitLogHistory(string branchNameOrRevision, IIntegrationResult to)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("log");
			buffer.AddArgument(branchNameOrRevision);
			AppendLogOptions(buffer);
			return Execute(NewProcessInfo(buffer.ToString(), to));
		}
コード例 #13
0
		/// <summary>
		/// Get the hash of the latest commit in the remote repository.
		/// </summary>
		/// <param name="branchNameOrRevision">Name of the branch or revision</param>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private string GitLogOriginHash(string branchNameOrRevision, IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("log");
			buffer.AddArgument(branchNameOrRevision);
			buffer.AddArgument("-1");
			buffer.AddArgument("--pretty=format:\"%H\"");
			return Execute(NewProcessInfo(buffer.ToString(), result)).StandardOutput.Trim();
		}
コード例 #14
0
ファイル: RakeTask.cs プロジェクト: derrills1/ccnet_gitmode
        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();
        }
コード例 #15
0
        /// <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();
        }
コード例 #16
0
		/// <summary>
		/// Push a specific tag with "git push origin tag 'tag name'".
		/// </summary>
		/// <param name="tagName">Naem of the tag to push.</param>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitPushTag(string tagName, IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("push");
			buffer.AddArgument("origin");
			buffer.AddArgument("tag");
			buffer.AddArgument(tagName);

			// initialize progress information
			var bpi = GetBuildProgressInformation(result);
			bpi.SignalStartRunTask(string.Concat("git ", buffer.ToString()));

			// enable Stdout monitoring
			ProcessExecutor.ProcessOutput += ProcessExecutor_ProcessOutput;

			Execute(NewProcessInfo(buffer.ToString(), result));

			// remove Stdout monitoring
			ProcessExecutor.ProcessOutput -= ProcessExecutor_ProcessOutput;
		}
コード例 #17
0
 /// <summary>
 /// Initialize the git submodules.
 /// </summary>
 /// <param name="result">IIntegrationResult of the current build.</param>
 private void GitInitSubmodules(IIntegrationResult result)
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.AddArgument("submodule");
     buffer.AddArgument("init");
     Execute(NewProcessInfo(buffer.ToString(), result));
 }
コード例 #18
0
		/// <summary>
		/// Call "git config 'name' 'value'" to set local repository properties.
		/// </summary>
		/// <param name="name">Name of the config parameter.</param>
		/// <param name="value">Value of the config parameter.</param>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitConfigSet(string name, string value, IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("config");
			buffer.AddArgument(name);
			buffer.AddArgument(value);
			Execute(NewProcessInfo(buffer.ToString(), result));
		}
コード例 #19
0
ファイル: Mks.cs プロジェクト: derrills1/ccnet_gitmode
 //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();
 }
コード例 #20
0
		/// <summary>
		/// Call "git config --get 'name'" to get the value of a local repository property.
        /// The command returns error code 1 if the key was not found and error code 2 if multiple key values were found. 
		/// </summary>
		/// <param name="name">Name of the config parameter.</param>
		/// <param name="result">IIntegrationResult of the current build.</param>
		/// <returns>Result of the "git config --get 'name'" command.</returns>
        private string GitConfigGet(string name, IIntegrationResult result)
		{
		    ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
		    buffer.AddArgument("config");
		    buffer.AddArgument("--get");
		    buffer.AddArgument(name);
		    return
		        Execute(NewProcessInfo(buffer.ToString(), result, ProcessPriorityClass.Normal, new int[] {0, 1, 2})).
		            StandardOutput.Trim();
		}
コード例 #21
0
ファイル: Mks.cs プロジェクト: derrills1/ccnet_gitmode
 //MEMBER_INFO_TEMPLATE = "memberinfo -S {SandboxRoot\SandboxFile} --user={user} --password={password} {member}"
 private string BuildMemberInfoCommandXml(Modification modification)
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.AppendArgument("memberinfo --xmlapi");
     AppendCommonArguments(buffer, false, true);
     string modificationPath = (modification.FolderName == null) ? SandboxRoot : Path.Combine(SandboxRoot, modification.FolderName);
     buffer.AddArgument(Path.Combine(modificationPath, modification.FileName));
     return buffer.ToString();
 }
コード例 #22
0
		/// <summary>
        /// Checkout a remote branch or revision with the "git checkout -q -f 'origin/branchName'" or "git checkout -q -f 'revision'" command.
		/// </summary>
		/// <param name="branchOrRevision">Name of the branch to checkout.</param>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitCheckoutRemoteBranch(string branchOrRevision, IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("checkout");
			buffer.AddArgument("-q");
			buffer.AddArgument("-f");
			buffer.AddArgument(branchOrRevision);

			// initialize progress information
			var bpi = GetBuildProgressInformation(result);
			bpi.SignalStartRunTask(string.Concat("git ", buffer.ToString()));

			// enable Stdout monitoring
			ProcessExecutor.ProcessOutput += ProcessExecutor_ProcessOutput;

			Execute(NewProcessInfo(buffer.ToString(), result));

			// remove Stdout monitoring
			ProcessExecutor.ProcessOutput -= ProcessExecutor_ProcessOutput;
		}
コード例 #23
0
ファイル: Mks.cs プロジェクト: derrills1/ccnet_gitmode
 //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();
 }
コード例 #24
0
		/// <summary>
		/// Clean the working tree with "git clean -d -f -x".
		/// </summary>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitClean(IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("clean");
			buffer.AddArgument("-d");
			buffer.AddArgument("-f");
			buffer.AddArgument("-x");
			Execute(NewProcessInfo(buffer.ToString(), result));
		}
コード例 #25
0
ファイル: BitKeeper.cs プロジェクト: derrills1/ccnet_gitmode
 private string BuildCloneToArguments()
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.AppendArgument("clone");
     buffer.AppendArgument(".");
     buffer.AppendArgument(CloneTo);
     return buffer.ToString();
 }
コード例 #26
0
		/// <summary>
		/// Automatically stage files that have been modified and deleted
		/// and commit them with the "git commit --all --allow-empty -m 'message'"
		/// command.
		/// </summary>
		/// <param name="commitMessage">Commit message.</param>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitCommitAll(string commitMessage, IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("commit");
			buffer.AddArgument("--all");
			buffer.AddArgument("--allow-empty");
			buffer.AddArgument("-m", commitMessage);
			Execute(NewProcessInfo(buffer.ToString(), result));
		}
コード例 #27
0
ファイル: BitKeeper.cs プロジェクト: derrills1/ccnet_gitmode
 private string BuildHistoryProcessArgs()
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.AppendArgument("changes");
     buffer.AppendArgument("-R");
     if (FileHistory)
         buffer.AppendArgument("-v");
     return buffer.ToString();
 }
コード例 #28
0
		/// <summary>
		/// Add all modified and all untracked files that are not ignored by .gitignore
		/// to the git index with the "git add --all" command.
		/// </summary>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitAddAll(IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("add");
			buffer.AddArgument("--all");
			Execute(NewProcessInfo(buffer.ToString(), result));
		}
コード例 #29
0
ファイル: BitKeeper.cs プロジェクト: derrills1/ccnet_gitmode
 private string BuildTagProcessArgs(string label)
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.AppendArgument("tag");
     buffer.AppendArgument(label);
     return buffer.ToString();
 }
コード例 #30
0
		/// <summary>
		/// Create a unsigned tag with "git tag -a -m 'message' 'tag name'".
		/// </summary>
		/// <param name="tagName">Name of the tag.</param>
		/// <param name="tagMessage">Tag commit message.</param>
		/// <param name="result">IIntegrationResult of the current build.</param>
		private void GitCreateTag(string tagName, string tagMessage, IIntegrationResult result)
		{
			ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
			buffer.AddArgument("tag");
			buffer.AddArgument("-a");
			buffer.AddArgument("-m", tagMessage);
			buffer.AddArgument(tagName);
			Execute(NewProcessInfo(buffer.ToString(), result));
		}