示例#1
0
        public TaskInvocation(object script, Task task, MethodInfo method, IList<TaskArgument> arguments)
        {
            this.script = script;
            this.task = task;
            this.method = method;

            values = Bind(arguments);
        }
示例#2
0
文件: Task.cs 项目: jthelin/Nake
        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);
        }
示例#3
0
文件: Caching.cs 项目: jthelin/Nake
        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);
        }
示例#4
0
文件: Engine.cs 项目: jthelin/Nake
 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();
 }
示例#5
0
文件: Caching.cs 项目: jthelin/Nake
 public CachingEngine(Engine engine, FileInfo script, Task[] tasks, bool reset)
 {
     this.engine = engine;
     this.script = script;
     this.tasks = tasks;
     this.reset = reset;
 }
示例#6
0
文件: Task.cs 项目: jthelin/Nake
        bool IsDependantUpon(Task other, ICollection<string> chain)
        {
            chain.Add(FullName);

            return dependencies.Contains(other) ||
                   dependencies.Any(dependency => dependency.IsDependantUpon(other, chain));
        }
示例#7
0
 public static DuplicateTaskException Create(Task existent, Task duplicate)
 {
     return Create(existent.Signature, duplicate.Signature);
 }
示例#8
0
 public TaskInvocationException(Task task, Exception source)
     : base(string.Format("'{0}' task failed. Error: '{1}'", task, source.Message), source)
 {
     this.source = source;
 }
示例#9
0
 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)
 {
 }
示例#10
0
 public TaskArgumentException(Task task, string message)
     : base("Failed to bind parameters for task '{0}'.\r\nError: {1}", task, message)
 {
 }
示例#11
0
 public RecursiveTaskCallException(Task task)
     : base("Recursive call detected within '{0}' task", task)
 {
 }
示例#12
0
 public CyclicDependencyException(Task from, Task to, string via)
     : base("Cyclic dependency detected from '{0}' to '{1}' via {2}", from, to, via)
 {
 }