Skip to content
Browse files

formatting

  • Loading branch information...
1 parent bd53c57 commit c6c721ff95d98865f21162bc1bd3506fc6500da6 @joeferner committed
Showing with 26 additions and 29 deletions.
  1. +26 −29 lib/builder.js
View
55 lib/builder.js
@@ -115,7 +115,7 @@ Builder.prototype.appendLinkerLibrary = function (lib) {
flag = '-l' + lib;
}
this.appendUnique('LINKFLAGS', flag);
-}
+};
Builder.prototype.appendLinkerSearchDir = function (dir) {
if (isArray(dir)) {
@@ -128,14 +128,14 @@ Builder.prototype.appendLinkerSearchDir = function (dir) {
flag = '-L' + dir;
}
this.appendUnique('LINKFLAGS', flag);
-}
+};
Builder.prototype.appendIncludeDir = function (dir) {
if (isArray(dir)) {
return dir.forEach(this.appendIncludeDir.bind(this));
}
this.appendUnique('CXXFLAGS', '-I' + dir);
-}
+};
Builder.prototype.getFlags = function (flagGroupName) {
var flags = this.flagGroups[flagGroupName];
@@ -143,7 +143,7 @@ Builder.prototype.getFlags = function (flagGroupName) {
flags = this.flagGroups[flagGroupName] = [];
}
return flags;
-}
+};
Builder.prototype.appendUnique = function (flagGroupName, newFlags) {
newFlags = isArray(newFlags) ? newFlags : [newFlags];
@@ -154,14 +154,14 @@ Builder.prototype.appendUnique = function (flagGroupName, newFlags) {
flags.push(newFlags[i]);
}
}
-}
+};
Builder.prototype.appendSource = function (fileName) {
if (isArray(fileName)) {
return fileName.forEach(this.appendSource.bind(this));
}
this.sourceFiles.push(fileName);
-}
+};
Builder.prototype.appendSourceDir = function (dirName) {
if (isArray(dirName)) {
@@ -174,7 +174,7 @@ Builder.prototype.appendSourceDir = function (dirName) {
this.appendSource(path.join(dirName, fileName));
}
}
-}
+};
Builder.prototype.getCompilerArgs = function (fileName, outFileName) {
fileName = path.resolve(fileName);
@@ -190,7 +190,7 @@ Builder.prototype.getCompilerArgs = function (fileName, outFileName) {
args.push(outFileName);
}
return args;
-}
+};
Builder.prototype.getLinkerArgs = function (outFileName) {
this.createDir(path.dirname(outFileName));
@@ -205,7 +205,7 @@ Builder.prototype.getLinkerArgs = function (outFileName) {
}
args = args.concat(flags);
return args;
-}
+};
Builder.prototype.createDir = function (dirName) {
var parent = path.dirname(dirName);
@@ -215,7 +215,7 @@ Builder.prototype.createDir = function (dirName) {
if (!existsSync(dirName)) {
fs.mkdirSync(dirName);
}
-}
+};
Builder.prototype._runCommandLine = function (cmd, args, callback) {
var child = childProcess.spawn(cmd, args);
@@ -228,7 +228,7 @@ Builder.prototype._runCommandLine = function (cmd, args, callback) {
child.on('exit', function (code) {
callback(code);
});
-}
+};
Builder.prototype._flattenArray = function (arr) {
var results = [];
@@ -236,7 +236,7 @@ Builder.prototype._flattenArray = function (arr) {
results = results.concat(arr[i]);
}
return results;
-}
+};
Builder.prototype._parseDepFile = function (depData) {
var deps = depData.split('\n').slice(1).map(function (item) {
@@ -250,7 +250,7 @@ Builder.prototype._parseDepFile = function (depData) {
return item.length > 0;
});
return deps;
-}
+};
Builder.prototype._getMaxTime = function (files) {
var maxTime = new Date(1900);
@@ -261,7 +261,7 @@ Builder.prototype._getMaxTime = function (files) {
}
}
return maxTime;
-}
+};
Builder.prototype._shouldCompile = function (outFileName, depFileName) {
try {
@@ -273,7 +273,7 @@ Builder.prototype._shouldCompile = function (outFileName, depFileName) {
//console.log(e);
return true;
}
-}
+};
Builder.prototype._shouldLink = function (outFileName, objectFiles) {
try {
@@ -284,7 +284,7 @@ Builder.prototype._shouldLink = function (outFileName, objectFiles) {
//console.log(e);
return true;
}
-}
+};
Builder.prototype._compile = function (curFileIdx, callback) {
var self = this;
@@ -320,7 +320,7 @@ Builder.prototype._compile = function (curFileIdx, callback) {
self.currentTask++;
callback(0);
}
-}
+};
Builder.prototype.compile = function (callback) {
this.currentTask = this.currentTask || 0;
@@ -370,9 +370,9 @@ Builder.prototype.compile = function (callback) {
callback();
}
}
- }
+ };
doCompile();
-}
+};
Builder.prototype.link = function (callback) {
this.currentTask = this.currentTask || 0;
@@ -425,7 +425,7 @@ Builder.prototype.link = function (callback) {
objectFilesStr,
path.relative(this.projectDir, outFileName))));
}
-}
+};
Builder.prototype.compileAndLink = function (callback) {
this.currentTask = 0;
@@ -448,7 +448,7 @@ Builder.prototype.compileAndLink = function (callback) {
callback();
});
});
-}
+};
Builder.prototype.run = function (options, callback) {
callback = callback || function () {};
@@ -483,7 +483,7 @@ Builder.prototype.run = function (options, callback) {
this.printHelp();
callback(null);
}
-}
+};
Builder.prototype.printHelp = function () {
console.log("mnm [options] action");
@@ -497,7 +497,7 @@ Builder.prototype.printHelp = function () {
console.log(" -v, --verbose Print verbose messages.");
console.log(" -Wall, --showWarnings Show all compiler warnings.");
console.log("");
-}
+};
Builder.prototype.failIfNotExists = function (dirName, message) {
dirName = path.resolve(dirName);
@@ -505,22 +505,19 @@ Builder.prototype.failIfNotExists = function (dirName, message) {
message = message || "Could not find '%s'.";
this.fail(message, dirName);
}
-}
+};
Builder.prototype.fail = function (message) {
- if (message instanceof Error) {
- message = message.message;
- }
var msg = util.format.apply(this, arguments);
console.error(ansi.red("ERROR: " + msg));
process.exit(1);
-}
+};
Builder.prototype.trimQuotes = function (str) {
if (str) {
str = str.replace(/^"/, '').replace(/"$/, '');
}
return str;
-}
+};
module.exports = Builder;

0 comments on commit c6c721f

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