Skip to content

Commit

Permalink
Removed getTask calls, make prereq-iteration async.
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Dec 31, 2011
1 parent d585d83 commit bf63f29
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion bin/cli.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ if (!program.preemptiveOption()) {
jake.showAllTaskDescriptions(opts.tasks); jake.showAllTaskDescriptions(opts.tasks);
} }
else { else {
//jake.run('__root__', true);
jake.Task['__root__'].invoke(); jake.Task['__root__'].invoke();
} }
} }
Expand Down
7 changes: 5 additions & 2 deletions lib/task.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ TaskMixin = new (function () {
}; };


this.handlePrereqComplete = function (prereq) { this.handlePrereqComplete = function (prereq) {
var self = this;
this._currentPrereqIndex++; this._currentPrereqIndex++;
if (this._currentPrereqIndex < this.prereqs.length) { if (this._currentPrereqIndex < this.prereqs.length) {
TaskVisitor.visitNextPrereq(this); setTimeout(function () {
TaskVisitor.visitNextPrereq(self);
}, 0);
} }
else { else {
this.run(); this.run();
Expand Down Expand Up @@ -134,7 +137,7 @@ FileDirectoryMixin = new (function () {
if (prereqs.length) { if (prereqs.length) {
for (var i = 0, ii = prereqs.length; i < ii; i++) { for (var i = 0, ii = prereqs.length; i < ii; i++) {
prereqName = prereqs[i]; prereqName = prereqs[i];
prereqTask = jake.getTask(prereqName); prereqTask = jake.Task[prereqName];
// Run the action if: // Run the action if:
// 1. The prereq is a normal task (not file/dir) // 1. The prereq is a normal task (not file/dir)
// 2. The prereq is a file-task with a mod-date more recent than // 2. The prereq is a file-task with a mod-date more recent than
Expand Down
2 changes: 1 addition & 1 deletion lib/task_visitor.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var TaskVisitor = new (function () {
, stats; , stats;
if (name) { if (name) {
parsed = parsePrereqName(name); parsed = parsePrereqName(name);
prereq = jake.getTask(parsed.name); prereq = jake.Task[parsed.name];


// Task doesn't exist, assume static file -- create a // Task doesn't exist, assume static file -- create a
// dummy FileTask if file actually exists // dummy FileTask if file actually exists
Expand Down

0 comments on commit bf63f29

Please sign in to comment.