-
-
Save xdghcnt/501a7e9b293fd270405c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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