[build] added gulp builder

This commit is contained in:
2017-12-17 22:29:16 +03:00
parent 823799e8fb
commit 69c2b735a0
24 changed files with 1273 additions and 4 deletions

39
build/prepare.js Executable file
View File

@@ -0,0 +1,39 @@
const AdobeAir = require('../tasks/adobeAir');
const Haxe = require('../tasks/haxe');
const FlashPlayer = require('../tasks/flashplayer');
const packages = [
{name:'openfl', version:'6.0.1'},
{name:'lime', version:'5.3.0'},
'promhx',
'protohx',
'haxework',
];
const prepareOne = (value) => {
switch (value) {
case Haxe.ID:
const haxe = new Haxe();
return haxe.prepare().then(() => haxe.install(packages));
case AdobeAir.ID:
return new AdobeAir().prepare();
case FlashPlayer.ID:
return new FlashPlayer().prepare();
default:
throw Error(`Unknown target: ${value}`)
}
};
const prepare = (...targets) => function prepare() {
const tasks = targets.map((target) => prepareOne(target));
return Promise.all(tasks);
};
const update = () => {
return new Haxe().upgrade();
};
module.exports = prepare;
module.exports.update = update;