当前位置: 首页>>代码示例>>C#>>正文


C# IIntegrationResult.AddTaskResult方法代码示例

本文整理汇总了C#中IIntegrationResult.AddTaskResult方法的典型用法代码示例。如果您正苦于以下问题:C# IIntegrationResult.AddTaskResult方法的具体用法?C# IIntegrationResult.AddTaskResult怎么用?C# IIntegrationResult.AddTaskResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IIntegrationResult的用法示例。


在下文中一共展示了IIntegrationResult.AddTaskResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

 public void Run(IIntegrationResult result)
 {
     ProcessResult processResult = executor.Execute(NewProcessInfo(result));
     string buildOutputFile = MsBuildOutputFile(result);
     if (File.Exists(buildOutputFile))
     {
         result.AddTaskResult(new FileTaskResult(buildOutputFile));
     }
     result.AddTaskResult(new ProcessTaskResult(processResult));
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:10,代码来源:MsBuildTask.cs

示例2: Execute

				protected override bool Execute(IIntegrationResult result)
				{
					var info = this.CreateProcessInfo(result);
					var processResult = this.TryToRun(
							info,
							result);

					result.AddTaskResult(new ProcessTaskResult(processResult));
					if (processResult.TimedOut)
						result.AddTaskResult(MakeTimeoutBuildResult(info));

					return processResult.Succeeded;
				}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:13,代码来源:CallHelloWorldTask.cs

示例3: Run

        public virtual void Run(IIntegrationResult result)
        {
            string outputFile = result.BaseFromArtifactsDirectory(OutputFile);

            ProcessResult nunitResult = processExecutor.Execute(NewProcessInfo(outputFile, result));
            result.AddTaskResult(new ProcessTaskResult(nunitResult));
            if (File.Exists(outputFile))
            {
                result.AddTaskResult(new FileTaskResult(outputFile));
            }
            else
            {
                Log.Warning(string.Format("NUnit test output file {0} was not created", outputFile));
            }
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:15,代码来源:NUnitTask.cs

示例4: Run

 public void Run(IIntegrationResult result)
 {
     foreach (string mergeFile in MergeFiles)
     {
         string fullMergeFile = mergeFile;
         if (!Path.IsPathRooted(mergeFile))
         {
             fullMergeFile = Path.Combine(result.WorkingDirectory, mergeFile);
         }
         WildCardPath path = new WildCardPath(fullMergeFile);
         FileInfo[] files = path.GetFiles();
         foreach (FileInfo fileInfo in files)
         {
             Log.Info("Merging file: " + fileInfo);
             if (fileInfo.Exists)
             {
                 result.AddTaskResult((new FileTaskResult(fileInfo)));
             }
             else
             {
                 Log.Warning("File not Found: " + fileInfo);
             }
         }
     }
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:25,代码来源:MergeFilesTask.cs

示例5: Execute

        /// <summary>
        /// Executes the specified result.	
        /// </summary>
        /// <param name="result">The result.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        protected override bool Execute(IIntegrationResult result)
        {
            result.BuildProgressInformation.SignalStartRunTask(!string.IsNullOrEmpty(Description) ? Description : "Executing null task");
            System.Threading.Thread.Sleep(5000);

            if (SimulateFailure)
            {
                result.AddTaskResult(SimulateFailureMessage);
                throw new System.Exception(SimulateFailureMessage);
            }
            else
            {
                result.AddTaskResult("All OK for " + (!string.IsNullOrEmpty(Description) ? Description : "Null task"));
            }
            
            return true;
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:23,代码来源:NullTask.cs

示例6: Execute

 /// <summary>
 /// Execute the actual task functionality.
 /// </summary>
 /// <param name="result">The result details to use.</param>
 /// <returns>
 /// True if the task was successful, false otherwise.
 /// </returns>
 protected override bool Execute(IIntegrationResult result)
 {
     result.BuildProgressInformation
         .SignalStartRunTask("Adding a comment to the log");
     (this.Logger ?? new DefaultLogger())
         .Debug("Logging " + (this.FailTask ? "error " : string.Empty) + "message: " + this.Message);
     result.AddTaskResult(
         new GeneralTaskResult(!this.FailTask, Message));
     return true;
 }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:17,代码来源:CommentTask.cs

示例7: Run

        public void Run(IIntegrationResult result)
        {
            ProcessResult processResult = AttemptToExecute(NewProcessInfoFrom(result));
            result.AddTaskResult(new ProcessTaskResult(processResult));

            if (processResult.TimedOut)
            {
                throw new BuilderException(this, "Command Line Build timed out (after " + BuildTimeoutSeconds + " seconds)");
            }
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:10,代码来源:ExecutableTask.cs

示例8: LabelSourceControl

 public override void LabelSourceControl(IIntegrationResult result)
 {
     if (result.Succeeded)
     {
         var processResult = this.ExecuteCommand(result, 
             "label", result.Label);
         result.AddTaskResult(
             new ProcessTaskResult(processResult));
     }
 }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:10,代码来源:GetMyCodeSourceControl.cs

示例9: Execute

        protected override bool Execute(IIntegrationResult result)
        {
            result.BuildProgressInformation
                .SignalStartRunTask("Sending a hello world greeting");
            for (var loop = 0; loop < this.RepeatCount; loop++)
            {
                result.AddTaskResult(
                    new HelloWorldTaskResult(this.PersonsName, result));
            }

            return true;
        }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:12,代码来源:HelloWorldTask2.cs

示例10: Run

 public void Run(IIntegrationResult result)
 {
     if (_reportFileName.Equals(String.Empty))
         _reportFileName = result.ProjectName;
     _instrument.NUnitTask = _nunit;
     _instrument.ReportName = _reportFileName;
     _instrument.Instrument();
     _builder.Run(result);
     _nunit.Run(result);
     _instrument.Report();
     result.AddTaskResult(new FileTaskResult(new FileInfo(_reportFileName)));
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:12,代码来源:CoverageTask.cs

示例11: Run

        public void Run(IIntegrationResult result)
        {
            result.BuildProgressInformation
                .SignalStartRunTask("Sending a hello world greeting");
            for (var loop = 0; loop < this.RepeatCount; loop++)
            {
                result.AddTaskResult("Hello " + this.PersonsName +
                    " from " + result.ProjectName +
                    "(build started " + result.StartTime.ToString() + ")");
            }

            result.Status = IntegrationStatus.Success;
        }
开发者ID:kyght,项目名称:CruiseControl.NET,代码行数:13,代码来源:HelloWorldTask.cs

示例12: Run

        public void Run(IIntegrationResult result)
        {
            foreach (FilePair Pair in this.FilePairs)
            {
                string XmlFilePath = Pair.XmlFile;
                if (!Path.IsPathRooted(XmlFilePath))
                {
                    XmlFilePath = Path.Combine(result.WorkingDirectory, XmlFilePath);
                }

                string XslFilePath = Pair.XslFile;
                if (!Path.IsPathRooted(XslFilePath))
                {
                    XslFilePath = Path.Combine(result.WorkingDirectory, XslFilePath);
                }

                string XslFileName = Path.GetFileName(XslFilePath);
                if (!File.Exists(XslFilePath))
                {
                    Log.Warning("File not Found: " + XslFileName);
                }

                WildCardPath Pattern = new WildCardPath(XmlFilePath);
                FileInfo[] Files = Pattern.GetFiles();
                foreach (FileInfo XmlFileInfo in Files)
                {
                    Log.Info(String.Format("Merging file {0} through {1}", XmlFileInfo, XslFileName));
                    if (XmlFileInfo.Exists)
                    {
                        string Data;
                        String Contents;
                        using (TextReader Reader = XmlFileInfo.OpenText())
                        {
                            Contents = Reader.ReadToEnd();
                        }
                        XslTransformer Transformer = new XslTransformer();
                        Data = Transformer.Transform(Contents, XslFilePath, new Dictionary<string, string>());
                        result.AddTaskResult((new XslMergerTaskResult(Data)));
                    }
                    else
                    {
                        Log.Warning("File not Found: " + XmlFileInfo);
                    }
                }
            }
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:46,代码来源:XslMerger.cs

示例13: Execute

        /// <summary>
        /// Run the task.
        /// </summary>
        /// <param name="result"></param>
        protected override bool Execute(IIntegrationResult result)
        {
            result.BuildProgressInformation.SignalStartRunTask(!string.IsNullOrEmpty(Description) ? Description : "Running NCover reporting");

            // Make sure there is a root directory
            rootPath = BaseDirectory;
            if (string.IsNullOrEmpty(rootPath)) rootPath = result.WorkingDirectory;

            // Take a before snapshot of all the files
            var outputDirectory = new DirectoryInfo(RootPath(OutputDir, false));
            var oldFiles = GenerateOriginalFileList(outputDirectory);

            // Run the executable
            var processResult = TryToRun(CreateProcessInfo(result), result);
            result.AddTaskResult(new ProcessTaskResult(processResult));

            // Check for any new files and copy them to the artefact folder
            if (!processResult.Failed)
            {
                outputDirectory.Refresh();
                var newFiles = ListFileDifferences(oldFiles, outputDirectory);
                if (newFiles.Length > 0)
                {
                    // Copy all the new files over
                    var publishDir = Path.Combine(result.BaseFromArtifactsDirectory(result.Label), "NCover");
                    Log.Debug(string.Format("Copying {0} files to {1}", newFiles.Length, publishDir));

                    var index = outputDirectory.FullName.Length + 1;
                    foreach (FileInfo newFile in newFiles)
                    {
                        var fileInfo = new FileInfo(Path.Combine(publishDir, newFile.FullName.Substring(index)));
                        if (!fileInfo.Directory.Exists) fileInfo.Directory.Create();
                        newFile.CopyTo(fileInfo.FullName, true);
                    }
                }
            }

            return !processResult.Failed;
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:43,代码来源:NCoverReportTask.cs

示例14: Execute

        /// <summary>
        /// Execute the actual task functionality.
        /// </summary>
        /// <param name="result">The result to use.</param>
        /// <returns><c>true</c> if the task was successful; <c>false</c> otherwise.</returns>
        protected override bool Execute(IIntegrationResult result)
        {
            var fakeOutputFile = GetFakeOutputFile(result);

            //delete old nant output logfile, if exist
            fileDirectoryDeleter.DeleteIncludingReadOnlyObjects(fakeOutputFile);

            result.BuildProgressInformation.SignalStartRunTask(!string.IsNullOrEmpty(Description) ? Description :
                string.Format(System.Globalization.CultureInfo.CurrentCulture,"Executing FAKE - {0}", ToString()));

						var info = CreateProcessInfo(result);
            var processResult = TryToRun(info, result);

            if (File.Exists(fakeOutputFile))
                result.AddTaskResult(new FileTaskResult(fakeOutputFile));

            result.AddTaskResult(new ProcessTaskResult(processResult, true));

						if (processResult.TimedOut)
							result.AddTaskResult(MakeTimeoutBuildResult(info));

            return processResult.Succeeded;
        }
开发者ID:nickdevore,项目名称:CruiseControl.NET,代码行数:28,代码来源:FakeTask.cs

示例15: Execute

        /// <summary>
        /// Run the specified PowerShell and add its output to the build results.
        /// </summary>
        /// <param name="result">the IIntegrationResult object for the build</param>
        protected override bool Execute(IIntegrationResult result)
        {
            result.BuildProgressInformation.SignalStartRunTask(string.Format("Executing {0}", Executable));

            ProcessInfo processInfo = NewProcessInfoFrom(result);

            ProcessResult processResult = AttemptToExecute(processInfo);

            if (!StringUtil.IsWhitespace(processResult.StandardOutput) || !StringUtil.IsWhitespace(processResult.StandardError))
            {
                // The PowerShell produced some output.  We need to transform it into an XML build report
                // fragment so the rest of CC.Net can process it.
                ProcessResult newResult = new ProcessResult(
                    MakeBuildResult(processResult.StandardOutput,string.Empty),
                    MakeBuildResult(processResult.StandardError, "Error"),
                    processResult.ExitCode,
                    processResult.TimedOut,
                    processResult.Failed);

                processResult = newResult;
            }
            result.AddTaskResult(new ProcessTaskResult(processResult));

            if (processResult.TimedOut)
            {
                throw new BuilderException(this, "Command Line Build timed out (after " + BuildTimeoutSeconds + " seconds)");
            }

            return !processResult.Failed;
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:34,代码来源:PowerShellTask.cs


注:本文中的IIntegrationResult.AddTaskResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。