[build] udpate to gulp-haxetool 0.0.2

This commit is contained in:
2018-04-03 17:03:33 +03:00
parent 836eebaf11
commit b12b26b87e
8 changed files with 121 additions and 97 deletions

View File

@@ -3,28 +3,30 @@ const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const babel = require('gulp-babel');
const template = require('gulp-template');
const yargs = require('yargs');
const Haxe = require('gulp-haxetool').Haxe;
const FlashPlayer = require('gulp-haxetool').FlashPlayer;
const {Haxe, FlashPlayer} = require('gulp-haxetool');
const version = require('./version');
const prepare = require('./prepare');
const generate = prepare.generate;
const debug = require('./debug');
const Debug = require('./debug');
const webserver = require('gulp-webserver');
const run = require('gulp-run');
const tail = require('./tail');
const deb = require('gulp-debian');
const dateformat = require('dateformat');
const build = (platform, values) => function build() {
const argv = yargs.argv;
const build = (platform, values, debug) => function build() {
const build = dateformat(new Date(), 'yyyy-mm-dd HH:MM:ss');
let macro = [`CompilationOption.set('build','${build}')`];
if (debug) macro = macro.concat(debug.macro());
return gulp.src('.')
.pipe(new Haxe().openfl({
command: 'build',
platform: platform,
version: version,
debug: argv.dev,
values: values
debug: debug,
values: {...values, proto_debug:debug},
macro: macro,
}))
.pipe(gulp.dest(`target/${platform}`));
};
@@ -99,10 +101,10 @@ exports['client'] = gulp.series(
const testFlash = function() {
const argv = yargs.argv;
return build('flash', {proto_debug: true})()
.pipe(new FlashPlayer().run(argv.dev))
.pipe(debug());
const debug = new Debug();
return build('flash', {}, debug)()
.pipe(new FlashPlayer().run(true))
.pipe(debug.run());
};
const testHtml5 = (dom) => function() {
@@ -116,13 +118,16 @@ const testHtml5 = (dom) => function() {
)();
};
const testLinux = gulp.series(
build('linux'),
() => gulp.src('target/linux/tankz')
.pipe(run('./tankz', {cwd: 'target/linux', verbosity: 1}))
.pipe(tail(debug.log))
const testLinux = () => {
const debug = new Debug();
return gulp.series(
build('linux', {}, debug),
() => gulp.src('target/linux/tankz')
.pipe(run('./tankz', {cwd: 'target/linux', verbosity: 1}))
.pipe(tail(Debug.log))
//.pipe(gulp.dest('target/log'))
);
)();
};