[neko] added
This commit is contained in:
@@ -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]));
|
||||
|
||||
Reference in New Issue
Block a user