Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
config.task("build-all", function (task) {
var def = Vow.defer();
try {
var makePlatform = task.getMakePlatform(),
nodes = Object.keys(makePlatform.getProjectConfig().getNodeConfigs());
makePlatform._cache = new Cache(makePlatform._cacheStorage, makePlatform._projectName);
Vow.all(nodes.map(function (node) {
return makePlatform.initNode(node);
})).then(function () {
try {
var targets = [];
Object.keys(makePlatform._nodes).forEach(function (nodePath) {
targets = targets.concat(makePlatform._nodes[nodePath]._targetNamesToBuild.map(function (targetName) {
return nodePath + "/" + targetName;
}));
});
var count = 0,
tasks = chunk(targets, chunkSize).map(function (targetsChunk) {
return function (callback) {
task.log("Building " + count + " - " + (count += chunkSize) + " targets");
task.buildTargets(targetsChunk).then(
function () {
callback(null, true);
},
function (error) {
callback(error);
}
);
};
});
async.series(tasks, function (error) {
if (error)
def.reject(error);
else
def.resolve();
});
} catch (error) {
def.reject(error);
}
});
} catch (error) {
def.reject(error);
}
return def.promise();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.