[neko] added

This commit is contained in:
2018-04-30 20:33:18 +03:00
parent 28ad6f9c81
commit c89833e80f
5 changed files with 101 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ const fse = require('fs-extra');
const path = require('path');
const exec = require('./exec');
const Sdk = require('./sdk');
const Neko = require('./neko');
const colors = require('ansi-colors');
const log = require('fancy-log');
const vfs = require('vinyl-fs');
@@ -39,6 +40,7 @@ class Haxe extends Sdk {
constructor(version) {
super(Haxe.ID, version || Haxe.VERSION);
this.neko = new Neko();
}
get prepared() {
@@ -50,6 +52,7 @@ class Haxe extends Sdk {
}
activate() {
this.neko.activate()
process.env.HAXE_VERSION = this.version;
process.env.HAXE_STD_PATH = path.join(this.binPath, 'std');
process.env.HAXE_HOME = this.binPath;
@@ -59,7 +62,7 @@ class Haxe extends Sdk {
}
prepare() {
return super.prepare().then(() => this.activate());
return Promise.all([this.neko.prepare(), super.prepare()]);
}
get link() {
@@ -81,6 +84,7 @@ class Haxe extends Sdk {
openfl(command, platform, config, debug=false) {
log(this.tag, colors.cyan(`openfl build ${platform}`));
this.activate()
const buildDir = path.join(os.tmpdir(), 'build', config.name);
fse.ensureDirSync(buildDir);
@@ -99,6 +103,7 @@ class Haxe extends Sdk {
build(platform, config, debug=false) {
log(this.tag, colors.cyan(`build ${platform}`));
this.activate()
const buildDir = path.join(os.tmpdir(), 'build', config.name);
fse.ensureDirSync(buildDir);
@@ -130,6 +135,7 @@ class Haxe extends Sdk {
}
install(packages) {
this.activate()
let promise = this.haxelib(['setup', path.join(this.path, 'lib')]);
const next = (args) => () => {
log(this.tag, colors.cyan('haxelib', 'install'), colors.magenta(args[1]));