[gulp] udpate project
This commit is contained in:
@@ -9,7 +9,6 @@ const webserver = require('gulp-webserver');
|
||||
const run = require('gulp-run');
|
||||
const tail = require('./tail');
|
||||
const deb = require('gulp-debian');
|
||||
const dateformat = require('dateformat');
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -33,6 +32,19 @@ class Config {
|
||||
this.values = values;
|
||||
this.macro = macro;
|
||||
}
|
||||
|
||||
update({name, version, lib=[], cp=[], main=null, values={}, macro=[]}) {
|
||||
return new Config({
|
||||
name: name || this.name,
|
||||
version: version || this.version,
|
||||
//lib: this.lib.concat(lib), //ToDo: check if object
|
||||
lib: this.lib,
|
||||
cp: this.cp.concat(cp),
|
||||
main: main || this.main,
|
||||
values: {...this.values, ...values},
|
||||
macro: this.macro.concat(macro),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,8 +64,7 @@ class Builder {
|
||||
}
|
||||
|
||||
macro(debug) {
|
||||
const build = dateformat(new Date(), 'yyyy-mm-dd HH:MM:ss');
|
||||
let macro = [`CompilationOption.set('build','${build}')`];
|
||||
let macro = [];
|
||||
if (debug) {
|
||||
macro = macro.concat(debug.macro());
|
||||
}
|
||||
@@ -86,6 +97,9 @@ class OpenFLBuilder extends Builder {
|
||||
command: 'build',
|
||||
platform: this.platform,
|
||||
version: this.config.version,
|
||||
lib: this.config.lib,
|
||||
cp: this.config.cp,
|
||||
main: this.config.main,
|
||||
debug: debug,
|
||||
values: this.config.values,
|
||||
macro: this.macro(debug),
|
||||
@@ -112,10 +126,10 @@ class HaxeBuilder extends Builder {
|
||||
lib: this.config.lib,
|
||||
cp: this.config.cp,
|
||||
main: this.config.main,
|
||||
outputFile: this.config.name + '.n', // ToDo: for neko only
|
||||
debug: debug,
|
||||
values: this.config.values,
|
||||
macro: this.macro(debug),
|
||||
values: this.config.values
|
||||
outputFile: this.config.name + '.n', // ToDo: for neko only
|
||||
}))
|
||||
.pipe(gulp.dest(`${this.target}/${this.platform}`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user