Skip to content
Browse files

Removed getTask calls, make prereq-iteration async.

  • Loading branch information...
1 parent d585d83 commit bf63f29bdf3ad76ef4fe707fa0bb3c324cb61668 @mde mde committed
Showing with 6 additions and 4 deletions.
  1. +0 −1 bin/cli.js
  2. +5 −2 lib/task.js
  3. +1 −1 lib/task_visitor.js
View
1 bin/cli.js
@@ -78,7 +78,6 @@ if (!program.preemptiveOption()) {
jake.showAllTaskDescriptions(opts.tasks);
}
else {
- //jake.run('__root__', true);
jake.Task['__root__'].invoke();
}
}
View
7 lib/task.js
@@ -55,9 +55,12 @@ TaskMixin = new (function () {
};
this.handlePrereqComplete = function (prereq) {
+ var self = this;
this._currentPrereqIndex++;
if (this._currentPrereqIndex < this.prereqs.length) {
- TaskVisitor.visitNextPrereq(this);
+ setTimeout(function () {
+ TaskVisitor.visitNextPrereq(self);
+ }, 0);
}
else {
this.run();
@@ -134,7 +137,7 @@ FileDirectoryMixin = new (function () {
if (prereqs.length) {
for (var i = 0, ii = prereqs.length; i < ii; i++) {
prereqName = prereqs[i];
- prereqTask = jake.getTask(prereqName);
+ prereqTask = jake.Task[prereqName];
// Run the action if:
// 1. The prereq is a normal task (not file/dir)
// 2. The prereq is a file-task with a mod-date more recent than
View
2 lib/task_visitor.js
@@ -35,7 +35,7 @@ var TaskVisitor = new (function () {
, stats;
if (name) {
parsed = parsePrereqName(name);
- prereq = jake.getTask(parsed.name);
+ prereq = jake.Task[parsed.name];
// Task doesn't exist, assume static file -- create a
// dummy FileTask if file actually exists

0 comments on commit bf63f29

Please sign in to comment.
Something went wrong with that request. Please try again.