Example #1
0
 private string GetLoggerArgs(IIntegrationResult result)
 {
     ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
     builder.Append("/l:");
     builder.Append(Logger);
     builder.Append(";");
     builder.Append(MsBuildOutputFile(result));
     return builder.ToString();
 }
Example #2
0
 private string BuildGetSourceArguments()
 {
     ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
     buffer.Append("pull");
     return buffer.ToString();
 }
		private void AddStandardArguments(
			ProcessArgumentBuilder builder,
			string destinationDirectory)
		{
			builder.AddArgument(RepositoryRoot);
			builder.AddArgument(destinationDirectory);
			builder.Append(standardArguments);
			builder.Append(AdditionalArguments);
		}
 /// <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 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();
		}
Example #6
0
		private string GetLoggerArgs(IIntegrationResult result)
		{
			ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
			builder.Append("/l:");
			if (string.IsNullOrEmpty(Logger))
			{
                // Since hot-swapping shadow copies the files, we also need to move the logger over
                var loggerPath = shadowCopier.RetrieveFilePath("ThoughtWorks.CruiseControl.MsBuild.dll");
                if (!string.IsNullOrEmpty(loggerPath)) builder.Append(StringUtil.AutoDoubleQuoteString(loggerPath) + ";");
			}
			else
			{
				builder.Append(CheckAndQuoteLoggerSetting(Logger) + ";");
			}

			builder.Append(StringUtil.AutoDoubleQuoteString(MsBuildOutputFile(result)));
			return builder.ToString();
		}
Example #7
0
		private static string GetPropertyArgs(IIntegrationResult result)
		{
			ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
			builder.Append("/p:");

			int count = 0;
			// We have to sort this alphabetically, else the unit tests
			// that expect args in a certain order are unpredictable
			IDictionary properties = result.IntegrationProperties;
			foreach (string key in properties.Keys)
			{
				if (count > 0) builder.Append(";");
				builder.Append(string.Format(System.Globalization.CultureInfo.CurrentCulture,"{0}={1}", key, StringUtil.AutoDoubleQuoteString(StringUtil.IntegrationPropertyToString(result.IntegrationProperties[key]))));
				count++;
			}

			return builder.ToString();
		}
Example #8
0
        /// <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();
		}
        private int GetRevisionCount(IIntegrationResult result)
        {
            var buffer = new ProcessArgumentBuilder();

            buffer.Append("rev-list --count HEAD");

            var output = new ProcessExecutor().Execute(NewProcessInfo(buffer.ToString(), BaseWorkingDirectory(result))).StandardOutput.Trim().Replace("'", "");
            int rev;
            int.TryParse(output, out rev);

            return rev;
        }
Example #10
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(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();
 }
        /// <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();
        }
Example #12
0
        private string GetPropertyArgs(IIntegrationResult result)
        {
            ProcessArgumentBuilder builder = new ProcessArgumentBuilder();
            builder.Append("/p:");

            int count = 0;
            foreach (string key in result.IntegrationProperties.Keys)
            {
                if (count > 0) builder.Append(";");
                builder.Append(string.Format("{0}={1}", key, result.IntegrationProperties[key]));
                count++;
            }

            return builder.ToString();
        }