diff options
author | Sergej Pozdnyakov <afinogen89@gmail.com> | 2017-12-25 23:58:56 +0300 |
---|---|---|
committer | Sergej Pozdnyakov <afinogen89@gmail.com> | 2017-12-25 23:58:56 +0300 |
commit | 14dd00fb7bbe20cfd1911973fc66c27c511092c7 (patch) | |
tree | fcfd1f76eb08295b1afba93d40d574b90792b78a /gulpfile.js | |
parent | 216ff35b385fa1269fbc38093aa98414a2db654b (diff) |
Add Linux build (gulp task) #312
For build only linux, without install Wine, added task `release-only-linux`
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/gulpfile.js b/gulpfile.js index f6aa17c5..727d19cb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -263,10 +263,48 @@ gulp.task('release-macos', function() { return archive.finalize(); }); +gulp.task('release-linux64', function() { + var pkg = require('./package.json'); + var src = path.join(appsDir, pkg.name, 'linux64'); + var output = fs.createWriteStream(path.join(appsDir, get_release_filename('linux64', 'zip'))); + var archive = archiver('zip', { + zlib: { level: 9 } + }); + archive.on('warning', function(err) { throw err; }); + archive.on('error', function(err) { throw err; }); + archive.pipe(output); + archive.directory(src, 'INAV Configurator'); + return archive.finalize(); +}); + +//For build only linux, without install Wine +//run task `apps` get error +//Error building NW apps:Error while updating the Windows icon. Wine (winehq.org) must be installed to add custom icons from Mac and Linux. +gulp.task('release-only-linux', ['dist'], function (done) { + var builder = new NwBuilder({ + files: './dist/**/*', + buildDir: appsDir, + platforms: ['linux64'], + flavor: 'normal', + }); + builder.on('log', console.log); + builder.build().then(function(){ + //Start zip app after complete + runSequence('release-linux64'); + }).catch(function(err){ + if (err) { + console.log("Error building NW apps:" + err); + done(); + return; + } + // Package apps as .zip files + done(); + }); +}); + // Create distributable .zip files in ./apps gulp.task('release', function() { - // TODO: Linux - return runSequence('apps', 'release-macos', 'release-windows'); + return runSequence('apps', 'release-macos', 'release-windows', 'release-linux64'); }); gulp.task('watch', function () { |