本文整理汇总了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));
}
示例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;
}
示例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));
}
}
示例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);
}
}
}
}
示例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;
}
示例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;
}
示例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)");
}
}
示例8: LabelSourceControl
public override void LabelSourceControl(IIntegrationResult result)
{
if (result.Succeeded)
{
var processResult = this.ExecuteCommand(result,
"label", result.Label);
result.AddTaskResult(
new ProcessTaskResult(processResult));
}
}
示例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;
}
示例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)));
}
示例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;
}
示例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);
}
}
}
}
示例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;
}
示例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;
}
示例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;
}