Permalink
Browse files

Switch to JavaScript style. Sorry Francisco.

  • Loading branch information...
1 parent 8eab69d commit 58ca3906caf6a7ae5c41afbc4a1b089438f2f1a8 @tlrobinson tlrobinson committed Jan 19, 2011
Showing with 227 additions and 375 deletions.
  1. +22 −34 lib/jake.js
  2. +43 −65 lib/jake/application.js
  3. +14 −24 lib/jake/clean.js
  4. +8 −11 lib/jake/filecreationtask.js
  5. +38 −66 lib/jake/filelist.js
  6. +11 −17 lib/jake/filetask.js
  7. +65 −115 lib/jake/task.js
  8. +26 −43 lib/jake/taskmanager.js
View
@@ -27,59 +27,53 @@ var SYSTEM = require("system");
var UTIL = require("narwhal/util");
var OS = require("os");
-var Task = require("jake/task").Task;
-var FileTask = require("jake/filetask").FileTask;
-var FileCreationTask = require("jake/filecreationtask").FileCreationTask;
-var TaskManager = require("jake/taskmanager").TaskManager;
-var Application = require("jake/application").Application;
+var Task = require("./jake/task").Task;
+var FileTask = require("./jake/filetask").FileTask;
+var FileCreationTask = require("./jake/filecreationtask").FileCreationTask;
+var TaskManager = require("./jake/taskmanager").TaskManager;
+var Application = require("./jake/application").Application;
+var FileList = require("./jake/filelist").FileList;
// Exports
exports.Task = Task;
exports.FileTask = FileTask;
exports.FileCreationTask = FileCreationTask;
exports.TaskManager = TaskManager;
exports.Application = Application;
+exports.FileList = FileList;
var application = null;
-exports.application = function()
-{
+exports.application = function() {
if (!application)
application = new Application();
return application;
}
-exports.setApplication = function(/*Application*/ anApplication)
-{
+exports.setApplication = function(/*Application*/ anApplication) {
application = anApplication;
}
exports.EARLY = new Date(-10000,1,1,0,0,0,0).getTime();
-exports.task = function()
-{
+exports.task = function() {
return Task.defineTask.apply(Task, arguments);
}
-exports.file = function()
-{
+exports.file = function() {
return FileTask.defineTask.apply(FileTask, arguments);
}
-exports.fileCreate = function()
-{
+exports.fileCreate = function() {
return FileCreationTask.defineTask.apply(FileCreationTask, arguments);
}
-exports.directory = function(aDirectory)
-{
+exports.directory = function(aDirectory) {
var oldLength = null;
- while (aDirectory !== "." && aDirectory.length !== oldLength)
- {
- exports.fileCreate(aDirectory, function(aTask)
- {
+ while (aDirectory !== "." && aDirectory.length !== oldLength) {
+ exports.fileCreate(aDirectory, function(aTask) {
var taskName = aTask.name();
if (!FILE.exists(taskName))
@@ -91,16 +85,14 @@ exports.directory = function(aDirectory)
}
}
-exports.filedir = function()
-{
- var fileTask = FileTask.defineTask.apply(FileTask, arguments),
- fileDirectory = FILE.dirname(fileTask.name());
+exports.filedir = function() {
+ var fileTask = FileTask.defineTask.apply(FileTask, arguments);
+ var fileDirectory = FILE.dirname(fileTask.name());
exports.directory (fileDirectory);
exports.file (fileTask.name(), fileDirectory);
}
-exports.FileList = require("jake/filelist").FileList;
/*
# Return the original directory where the Rake application was started.
def original_dir
@@ -110,23 +102,19 @@ exports.FileList = require("jake/filelist").FileList;
// record the initial SYSTEM.env so we know what needs to be serialized later
var envInitial = Object.freeze(UTIL.copy(SYSTEM.env));
-function serializeEnv(/*Object*/ env)
-{
+function serializeEnv(/*Object*/ env) {
return Object.keys(env).map(function(key) {
return (env[key] !== envInitial[key]) ? key + "=" + OS.enquote(env[key]) : null;
}).filter(function(x) { return !!x; }).join(" ");
}
-exports.subjake = function(/*Array<String> | String*/ directories, /*String*/ aTaskName, /*Object*/ env)
-{
+exports.subjake = function(/*Array<String> | String*/ directories, /*String*/ aTaskName, /*Object*/ env) {
if (!Array.isArray(directories))
directories = [directories];
- directories.forEach(function(/*String*/ aDirectory)
- {
- if (FILE.isDirectory(aDirectory))
- {
+ directories.forEach(function(/*String*/ aDirectory) {
+ if (FILE.isDirectory(aDirectory)) {
if (OS.system("cd " + OS.enquote(aDirectory) + " && " + serializeEnv(env) + " jake " + OS.enquote(aTaskName)))
OS.exit(1);
}
Oops, something went wrong.

0 comments on commit 58ca390

Please sign in to comment.