public TaskInvocation(object script, Task task, MethodInfo method, IList<TaskArgument> arguments) { this.script = script; this.task = task; this.method = method; values = Bind(arguments); }
public void AddDependency(Task dependency) { if (dependency == this) throw new RecursiveTaskCallException(this); var via = new List<string>(); if (dependency.IsDependantUpon(this, via)) throw new CyclicDependencyException(this, dependency, string.Join(" -> ", via) + " -> " + FullName); dependencies.Add(dependency); }
public BuildResult Find(Task[] tasks) { if (!CachedAssemblyExists()) return null; if (CapturedVariablesMismatch()) return null; var references = ReadReferences(); var assembly = ReadAssembly(); var symbols = ReadSymbols(); return new BuildResult(tasks, references, null, assembly, debug ? symbols : null); }
public BuildResult( Task[] tasks, AssemblyReference[] references, EnvironmentVariable[] variables, byte[] assembly, byte[] symbols) { Tasks = tasks; References = references; AssemblyBytes = assembly; SymbolBytes = symbols; Variables = variables; Assembly = Load(); Reflect(); }
public CachingEngine(Engine engine, FileInfo script, Task[] tasks, bool reset) { this.engine = engine; this.script = script; this.tasks = tasks; this.reset = reset; }
bool IsDependantUpon(Task other, ICollection<string> chain) { chain.Add(FullName); return dependencies.Contains(other) || dependencies.Any(dependency => dependency.IsDependantUpon(other, chain)); }
public static DuplicateTaskException Create(Task existent, Task duplicate) { return Create(existent.Signature, duplicate.Signature); }
public TaskInvocationException(Task task, Exception source) : base(string.Format("'{0}' task failed. Error: '{1}'", task, source.Message), source) { this.source = source; }
public TaskArgumentException(Task task, string parameter, int position, string message) : base("Failed to bind parameter '{1}' in position {2} when invoking task '{0}'.\r\nError: {3}", task, parameter, position, message) { }
public TaskArgumentException(Task task, string message) : base("Failed to bind parameters for task '{0}'.\r\nError: {1}", task, message) { }
public RecursiveTaskCallException(Task task) : base("Recursive call detected within '{0}' task", task) { }
public CyclicDependencyException(Task from, Task to, string via) : base("Cyclic dependency detected from '{0}' to '{1}' via {2}", from, to, via) { }