[build] linux platform

This commit is contained in:
2018-01-28 16:05:57 +03:00
parent 24373aa85a
commit 9ebed21c5f
6 changed files with 73 additions and 11 deletions

View File

@@ -44,4 +44,4 @@ module.exports = () => {
})
};
module.exports.log = log;
module.exports.log = _log;

View File

@@ -79,7 +79,6 @@ class Haxe extends Sdk {
if (!Array.isArray(packages)) {
packages = Object.entries(packages).map(([k, v]) => ({name: k, version: v}));
}
console.log('packages', packages);
for (let pack of packages) {
const args = [];
@@ -88,7 +87,6 @@ class Haxe extends Sdk {
args.push('install', pack);
} else if (typeof pack === 'object') {
version = pack.version;
console.log('z', version.substr(0, 3));
if (version.substr(0, 3) === 'git') {
pack.git = version;
version = null;
@@ -108,7 +106,6 @@ class Haxe extends Sdk {
} else if (pack.git) {
path += '/git';
}
console.log('p', path);
if (!fs.existsSync(path)) {
promise = promise.then(next(args));
}
@@ -186,6 +183,7 @@ class Haxe extends Sdk {
const result = {
'flash': `${buildDir}/flash/bin/*.swf`,
'html5': `${buildDir}/html5/bin/**/*`,
'linux': `${buildDir}/linux/bin/**/*`,
}[params.platform];
vfs.src(result).pipe(through.obj((file, enc, cb) => {
file.debug = debug;

43
tasks/tail.js Normal file
View File

@@ -0,0 +1,43 @@
const through = require('through2');
const colors = require('ansi-colors');
const log = require('fancy-log');
const TAG = colors.green('[tail]');
const { Writable } = require('stream');
const { StringDecoder } = require('string_decoder');
class StringWritable extends Writable {
constructor(handler, options) {
super(options);
this.handler = handler;
const state = this._writableState;
this._decoder = new StringDecoder(state.defaultEncoding);
this.data = '';
}
_write(chunk, encoding, callback) {
if (encoding === 'buffer') {
chunk = this._decoder.write(chunk);
for (const line of chunk.split('\n')) if (line.length) {
this.handler(line);
}
}
this.data += chunk;
callback();
}
_final(callback) {
this.data += this._decoder.end();
callback();
}
}
module.exports = (handler) => {
return through.obj(function (file, enc, callback) {
file.contents.pipe(new StringWritable(handler));
this.push(file);
callback();
});
};