[build] added gulp builder
This commit is contained in:
39
build/prepare.js
Executable file
39
build/prepare.js
Executable 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;
|
||||
Reference in New Issue
Block a user