public static Switch <T> Switch <T>(this Task <T> condition, T case1, IObsoleteTask task1) { var s = condition.Switch(); s[case1] = task1; return(s); }
public void BeginTask(IObsoleteTask task, IBounceCommand command) { if (logOptions.ReportTaskStart && task.IsLogged && command.IsLogged) { StdOut.WriteLine("{0} task: {1}", command.PresentTense, task); } }
public void BeginTarget(IObsoleteTask task, string name, IBounceCommand command) { if (logOptions.ReportTargetStart) { StdOut.WriteLine("{0} target: {1}", command.PresentTense, name); } }
public static Switch <T> Switch <T>(this Task <T> condition, T case1, IObsoleteTask task1, T case2, IObsoleteTask task2, T case3, IObsoleteTask task3) { var s = condition.Switch(case1, task1, case2, task2); s[case3] = task3; return(s); }
public ILog CreateLogForTask(IObsoleteTask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions) { if (TeamCityVersion < 6) { return(new TeamCity5Log(stdout, logOptions, new TaskLogMessageFormatter(task))); } return(new TeamCityLog(stdout, logOptions, new TaskLogMessageFormatter(task))); }
public static bool IsDependentOn(this IObsoleteTask task, IObsoleteTask dependency) { if (task == dependency) { return true; } else { return task.Dependencies.Select(d => d.Task).Any(t => t.IsDependentOn(dependency)); } }
public void EnsureInvokedAtLeastOnce(IObsoleteTask task, IBounceCommand command) { if (!InvokedTasks.Contains(task)) { Invoke(task, command); InvokedTasks.Add(task); } }
public TaskWithEnumerationsInFields(IObsoleteTask a, IObsoleteTask b, SomeTask c) { A = new [] { a }; B = new[] { b }; C = new List <SomeTask> { c }; }
public TaskWithEnumerationsInProperties(Func <IObsoleteTask> a, IObsoleteTask b, SomeTask c) { getA = a; B = new[] { b }; C = new List <SomeTask> { c }; }
private TaskDependency CreateTaskDependency(IObsoleteTask task, string name) { return(new TaskDependency(task) { Name = name, CleanAfterBuild = Member.CleanAfterBuild }); }
public void EndTarget(IObsoleteTask task, string name, IBounceCommand command, TaskResult result) { if (logOptions.ReportTargetEnd) { if (result == TaskResult.Success) { StdOut.WriteLine("{0} target: {1}", command.PastTense, name); } else { StdErr.WriteLine("failed to {0} target: {1}", command.InfinitiveTense, name); } } }
public void EndTask(IObsoleteTask task, IBounceCommand command, TaskResult result) { if (logOptions.ReportTaskEnd && task.IsLogged && command.IsLogged) { if (result == TaskResult.Success) { StdOut.WriteLine("{0} task: {1}", command.PastTense, task); } else { StdErr.WriteLine("failed to {0} task: {1}", command.InfinitiveTense, task); } } }
public static bool IsDependentOn(this IObsoleteTask task, IObsoleteTask dependency) { if (task == dependency) { return(true); } else { return(task.Dependencies.Select(d => d.Task).Any(t => t.IsDependentOn(dependency))); } }
private void TestOptional(bool conditionValue, bool shouldRun, Func <Task <bool>, IObsoleteTask, IObsoleteTask> getTask) { var output = new StringWriter(); Task <bool> condition = conditionValue; var text = "shouldn't see this"; IObsoleteTask optionalTask = getTask(condition, new FakePrintTask(output, text)); optionalTask.TestBuild(); Assert.That(output.ToString(), Is.EqualTo(shouldRun? text + ";": String.Empty)); }
private void EndTaskLog(IObsoleteTask task, IBounceCommand command, TaskResult result, string targetName, ILog outerLogger) { if (targetName != null) { Log.TaskLog.EndTarget(task, targetName, command, result); } else { Log.TaskLog.EndTask(task, command, result); } Log = outerLogger; }
private static IEnumerable <TaskDependency> GetNonNullDependencies(IObsoleteTask task) { var deps = task.Dependencies; if (deps == null) { return(new TaskDependency[0]); } else { return(deps.Where(d => d != null && d.Task != null)); } }
public void EndTarget(IObsoleteTask task, string name, IBounceCommand command, TaskResult result) { if (logOptions.ReportTargetEnd) { if (result == TaskResult.Success) { StdOut.WriteLine("{0} target: {1}", command.PastTense, name); } else { StdErr.WriteLine("failed to {0} target: {1}", command.InfinitiveTense, name); } } }
private void InvokeAndLog(IObsoleteTask task, IBounceCommand command) { using (var taskScope = Bounce.TaskScope(task, command, null)) { try { task.Describe(Bounce.DescriptionOutput); task.Invoke(command, Bounce); taskScope.TaskSucceeded(); } catch (BounceException) { throw; } catch (Exception e) { throw new TaskException(task, e); } } }
public IEnumerable<IParameter> FindParametersInTask(IObsoleteTask task) { var walker = new TaskWalker(); var parameters = new HashSet<IParameter>(); walker.Walk(new TaskDependency(task), null, dependency => { var param = dependency.Task as IParameter; if (param != null) { parameters.Add(param); } }); return parameters; }
private void InvokeAndLog(IObsoleteTask task, IBounceCommand command) { using (var taskScope = Bounce.TaskScope(task, command, null)) { try { task.Describe(Bounce.DescriptionOutput); task.Invoke(command, Bounce); taskScope.TaskSucceeded(); } catch (BounceException) { throw; } catch (Exception e) { throw new TaskException(task, e); } } }
public void EndTask(IObsoleteTask task, IBounceCommand command, TaskResult result) { if (logOptions.ReportTaskEnd && task.IsLogged && command.IsLogged) { if (result == TaskResult.Success) { StdOut.WriteLine("{0} task: {1}", command.PastTense, task); } else { StdErr.WriteLine("failed to {0} task: {1}", command.InfinitiveTense, task); } } }
public IEnumerable <IParameter> FindParametersInTask(IObsoleteTask task) { var walker = new TaskWalker(); var parameters = new HashSet <IParameter>(); walker.Walk(new TaskDependency(task), null, dependency => { var param = dependency.Task as IParameter; if (param != null) { parameters.Add(param); } }); return(parameters); }
private ITaskScope CreateTaskScope(IObsoleteTask task, IBounceCommand command, string targetName) { ILog previousLogger = Log; Log = LogFactory.CreateLogForTask(task, LogOptions.StdOut, LogOptions.StdErr, LogOptions); if (targetName != null) { Log.TaskLog.BeginTarget(task, targetName, command); } else { Log.TaskLog.BeginTask(task, command); } return(new TaskScope( outerLogger => EndTaskLog(task, command, TaskResult.Success, targetName, outerLogger), outerLogger => EndTaskLog(task, command, TaskResult.Failure, targetName, outerLogger), previousLogger)); }
public void BeginTask(IObsoleteTask task, IBounceCommand command) { output.WriteLine(TeamCityFormatter.FormatTeamCityMessage("progressStart", task.SmallDescription)); }
public void TaskException(IObsoleteTask task, string message) { }
public TaskException(IObsoleteTask task, Exception innerException) : base(String.Format("task {0} failed: {1}", task, innerException.Message), innerException) { Task = task; }
private void RegisterCleanupAfterBuild(IObsoleteTask task) { Walker.Walk(new TaskDependency(task), CleanAfterBuildRegister.RegisterDependency, null); }
private void Describe(IObsoleteTask task, IBounceCommand command) { Walker.Walk(new TaskDependency(task), null, dep => DescribeIfNotDescribed(dep, command)); }
public TaskLogMessageFormatter(IObsoleteTask task) { this.task = task; }
public void EndTarget(IObsoleteTask task, string name, IBounceCommand command, TaskResult result) { }
public TaskException(IObsoleteTask task, string message) : base(String.Format("task {0} failed: {1}", task, message)) { Task = task; }
private static void InvokeTask(ITargetBuilderBounce bounce, IBounceCommand command, string name, IObsoleteTask task) { using (var targetScope = bounce.TaskScope(task, command, name)) { bounce.Invoke(command, task); targetScope.TaskSucceeded(); } }
public void Invoke(IBounceCommand command, IObsoleteTask task) { TargetInvoker.Invoke(command, task); }
public ILog CreateLogForTask(IObsoleteTask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions) { return new Log(stdout, stderr, logOptions, new TaskLogMessageFormatter(task)); }
public TaskDependency(IObsoleteTask task) { Task = task; }
public TaskLogMessageFormatter(IObsoleteTask task) { this.task = task; }
public void EndTask(IObsoleteTask task, IBounceCommand command, TaskResult result) { }
public void BeginTarget(IObsoleteTask task, string name, IBounceCommand command) { output.WriteLine(TeamCityFormatter.FormatTeamCityMessage("progressStart", name)); }
public ILog CreateLogForTask(IObsoleteTask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions) { if (TeamCityVersion < 6) return new TeamCity5Log(stdout, logOptions, new TaskLogMessageFormatter(task)); return new TeamCityLog(stdout, logOptions, new TaskLogMessageFormatter(task)); }
public void BeginTask(IObsoleteTask task, IBounceCommand command) { }
public ILog CreateLogForTask(IObsoleteTask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions) { return(new Log(stdout, stderr, logOptions, new TaskLogMessageFormatter(task))); }
public void EndTarget(IObsoleteTask task, string name, IBounceCommand command, TaskResult result) { }
public void Invoke(IBounceCommand command, IObsoleteTask task) { command.InvokeCommand(() => Build(task, command), () => Clean(task, command), () => Describe(task, command)); }
public void EndTask(IObsoleteTask task, IBounceCommand command, TaskResult result) { }
private void Build(IObsoleteTask task, IBounceCommand command) { Walker.Walk(new TaskDependency(task), null, dep => BuildIfNotAlreadyBuilt(dep, command)); RegisterCleanupAfterBuild(task); }
public void EnsureInvokedAtLeastOnce(IObsoleteTask task, IBounceCommand command) { if (!InvokedTasks.Contains(task)) { Invoke(task, command); InvokedTasks.Add(task); } }
private void Clean(IObsoleteTask task, IBounceCommand command) { Walker.Walk(new TaskDependency(task), dep => CleanIfNotAlreadyCleaned(dep, command), null); }
public void Invoke(IBounceCommand command, IObsoleteTask task) { command.InvokeCommand(() => Build(task, command), () => Clean(task, command), () => Describe(task, command)); }
public ITaskScope TaskScope(IObsoleteTask task, IBounceCommand command, string targetName) { return new Mock<ITaskScope>().Object; }
private void Build(IObsoleteTask task, IBounceCommand command) { Walker.Walk(new TaskDependency(task), null, dep => BuildIfNotAlreadyBuilt(dep, command)); RegisterCleanupAfterBuild(task); }
public virtual void Invoke(IBounceCommand command, IObsoleteTask task) { task.Invoke(command, this); }
protected Task() { DependsOn = new IObsoleteTask[0]; }
public void EndTask(IObsoleteTask task, IBounceCommand command, TaskResult result) { output.WriteLine(TeamCityFormatter.FormatTeamCityMessage("progressFinish", task.SmallDescription)); }
public void BeginTask(IObsoleteTask task, IBounceCommand command) { }
public void EndTarget(IObsoleteTask task, string name, IBounceCommand command, TaskResult result) { output.WriteLine(TeamCityFormatter.FormatTeamCityMessageWithFields("buildStatus", "status", result == TaskResult.Success? "SUCCESS": "FAILURE")); output.WriteLine(TeamCityFormatter.FormatTeamCityMessage("progressFinish", name)); }
private void RegisterCleanupAfterBuild(IObsoleteTask task) { Walker.Walk(new TaskDependency(task), CleanAfterBuildRegister.RegisterDependency, null); }
private void Clean(IObsoleteTask task, IBounceCommand command) { Walker.Walk(new TaskDependency(task), dep => CleanIfNotAlreadyCleaned(dep, command), null); }
public void BeginTarget(IObsoleteTask task, string name, IBounceCommand command) { }
public void BeginTarget(IObsoleteTask task, string name, IBounceCommand command) { }
private void Describe(IObsoleteTask task, IBounceCommand command) { Walker.Walk(new TaskDependency(task), null, dep => DescribeIfNotDescribed(dep, command)); }