diff --git a/haxetool/project.js b/haxetool/project.js old mode 100644 new mode 100755 index e031e38..24fa292 --- a/haxetool/project.js +++ b/haxetool/project.js @@ -20,6 +20,7 @@ const rename = require('gulp-rename'); const template = require('lodash.template'); const tar = require('gulp-tar'); const gzip = require('gulp-gzip'); +const zip = require('gulp-zip'); const streamToPromise = (stream) => { return new Promise((resolve, reject) => { @@ -243,6 +244,28 @@ LinuxArchivePacker.NAME = 'archive'; Packer.register(Platform.LINUX, LinuxArchivePacker.NAME, LinuxArchivePacker); +/** + * + */ +class WindowsArchivePacker extends Packer { + + constructor(config) { + super(config, Platform.WINDOWS); + } + + call() { + const target = this.targetPath; + const archiveName = `${this.config.meta.filename}_${this.config.meta.version}.zip`; + return gulp.src(`${target}/**/*`) + .pipe(zip(archiveName)) + .pipe(gulp.dest(path.join(target, '..', 'archive'))) + } +} + +WindowsArchivePacker.NAME = 'archive'; + +Packer.register(Platform.WINDOWS, WindowsArchivePacker.NAME, WindowsArchivePacker); + /** * */ @@ -335,7 +358,25 @@ class LinuxRunner extends Runner { } Runner.register(Platform.LINUX, LinuxRunner); -Runner.register(Platform.WINDOWS, LinuxRunner); //ToDo: + +/** + * + */ +class WindowsRunner extends Runner { + + constructor(config, debug) { + super(config, Platform.WINDOWS, debug); + } + + call() { + const target = this.targetPath; + const filename = path.resolve(target, this.config.meta.filename + '.exe'); + const result = gulp.src(filename).pipe(run("<%=file.basename%>", {cwd: target, verbosity: 0})); + return this.log(result); + } +} + +Runner.register(Platform.WINDOWS, WindowsRunner); /** * diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 65d8263..112e854 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "gulp-spawn": "^0.4.0", "gulp-tar": "^3.0.0", "gulp-webserver": "^0.9.1", + "gulp-zip": "^5.0.0", "lodash.defaults": "^4.2.0", "lodash.template": "^4.4.0", "plugin-error": "^1.0.1",