[project] archives packers update

This commit is contained in:
2019-09-02 17:06:13 +03:00
parent b71919ee4a
commit 524695b155
3 changed files with 12 additions and 6 deletions

View File

@@ -71,10 +71,12 @@ class Haxe extends Sdk {
} }
haxe(args) { haxe(args) {
this.activate();
return exec('.', [this.haxeBin].concat(args).join(' ')); return exec('.', [this.haxeBin].concat(args).join(' '));
} }
haxelib(args) { haxelib(args) {
this.activate();
return exec('.', [this.haxelibBin].concat(args).join(' ')); return exec('.', [this.haxelibBin].concat(args).join(' '));
} }

View File

@@ -49,8 +49,12 @@ class Target {
throw 'Not Implemented'; throw 'Not Implemented';
} }
resolveTargetPath(platform = this.platform) {
return path.resolve(this.target, this.config.name, platform)
}
get targetPath() { get targetPath() {
return path.resolve(this.target, this.config.name, this.platform); return this.resolveTargetPath();
} }
} }
@@ -232,11 +236,11 @@ class LinuxArchivePacker extends Packer {
call() { call() {
const target = this.targetPath; const target = this.targetPath;
const archiveName = `${this.config.meta.filename}_${this.config.meta.version}.tar`; const archiveName = `${this.config.meta.filename}_${this.config.meta.version}_linux.tar`;
return gulp.src(`${target}/**/*`) return gulp.src(`${target}/**/*`)
.pipe(tar(archiveName)) .pipe(tar(archiveName))
.pipe(gzip()) .pipe(gzip())
.pipe(gulp.dest(path.join(target, '..', 'archive'))) .pipe(gulp.dest(this.resolveTargetPath('archive')))
} }
} }
@@ -255,10 +259,10 @@ class WindowsArchivePacker extends Packer {
call() { call() {
const target = this.targetPath; const target = this.targetPath;
const archiveName = `${this.config.meta.filename}_${this.config.meta.version}.zip`; const archiveName = `${this.config.meta.filename}_${this.config.meta.version}_win.zip`;
return gulp.src(`${target}/**/*`) return gulp.src(`${target}/**/*`)
.pipe(zip(archiveName)) .pipe(zip(archiveName))
.pipe(gulp.dest(path.join(target, '..', 'archive'))) .pipe(gulp.dest(this.resolveTargetPath('archive')))
} }
} }

View File

@@ -23,7 +23,7 @@
"plugin-error": "^1.0.1", "plugin-error": "^1.0.1",
"promise-streams": "^2.1.1", "promise-streams": "^2.1.1",
"tail": "^1.2.3", "tail": "^1.2.3",
"tar": "^4.4.1", "tar": "^4.4.10",
"through2": "^2.0.3", "through2": "^2.0.3",
"tmp-file": "^2.0.1", "tmp-file": "^2.0.1",
"unzip-stream": "^0.3.0", "unzip-stream": "^0.3.0",