mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Migration to Gulp 4.0
This commit is contained in:
parent
815517e48d
commit
11aad4905f
2 changed files with 189 additions and 172 deletions
352
gulpfile.js
352
gulpfile.js
|
@ -1,29 +1,27 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var pkg = require('./package.json');
|
const pkg = require('./package.json');
|
||||||
|
|
||||||
var child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
var fs = require('fs');
|
const fs = require('fs');
|
||||||
var path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
var zip = require('gulp-zip');
|
const zip = require('gulp-zip');
|
||||||
var del = require('del');
|
const del = require('del');
|
||||||
var NwBuilder = require('nw-builder');
|
const NwBuilder = require('nw-builder');
|
||||||
var makensis = require('makensis');
|
const makensis = require('makensis');
|
||||||
var deb = require('gulp-debian');
|
const deb = require('gulp-debian');
|
||||||
|
|
||||||
var gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
var concat = require('gulp-concat');
|
const concat = require('gulp-concat');
|
||||||
var install = require("gulp-install");
|
const install = require("gulp-install");
|
||||||
var rename = require('gulp-rename');
|
const rename = require('gulp-rename');
|
||||||
var runSequence = require('run-sequence');
|
const os = require('os');
|
||||||
var mergeStream = require('merge-stream');
|
|
||||||
var os = require('os');
|
|
||||||
|
|
||||||
var distDir = './dist/';
|
const DIST_DIR = './dist/';
|
||||||
var appsDir = './apps/';
|
const APPS_DIR = './apps/';
|
||||||
var debugDir = './debug/';
|
const DEBUG_DIR = './debug/';
|
||||||
var releaseDir = './release/';
|
const RELEASE_DIR = './release/';
|
||||||
|
|
||||||
var nwBuilderOptions = {
|
var nwBuilderOptions = {
|
||||||
version: '0.27.4',
|
version: '0.27.4',
|
||||||
|
@ -33,6 +31,40 @@ var nwBuilderOptions = {
|
||||||
winIco: './images/bf_icon.ico'
|
winIco: './images/bf_icon.ico'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//-----------------
|
||||||
|
//Pre tasks operations
|
||||||
|
//-----------------
|
||||||
|
const SELECTED_PLATFORMS = getInputPlatforms();
|
||||||
|
|
||||||
|
//-----------------
|
||||||
|
//Tasks
|
||||||
|
//-----------------
|
||||||
|
|
||||||
|
gulp.task('clean', gulp.parallel(clean_dist, clean_apps, clean_debug, clean_release));
|
||||||
|
|
||||||
|
gulp.task('clean-dist', clean_dist);
|
||||||
|
|
||||||
|
gulp.task('clean-apps', clean_apps);
|
||||||
|
|
||||||
|
gulp.task('clean-debug', clean_debug);
|
||||||
|
|
||||||
|
gulp.task('clean-release', clean_release);
|
||||||
|
|
||||||
|
gulp.task('clean-cache', clean_cache);
|
||||||
|
|
||||||
|
var distBuild = gulp.series(clean_dist, dist);
|
||||||
|
gulp.task('dist', distBuild);
|
||||||
|
|
||||||
|
var appsBuild = gulp.series(gulp.parallel(clean_apps, distBuild), apps, gulp.parallel(listPostBuildTasks(APPS_DIR)));
|
||||||
|
gulp.task('apps', appsBuild);
|
||||||
|
|
||||||
|
var debugBuild = gulp.series(gulp.parallel(clean_debug, distBuild), debug, gulp.parallel(listPostBuildTasks(DEBUG_DIR)), start_debug)
|
||||||
|
gulp.task('debug', debugBuild);
|
||||||
|
|
||||||
|
var releaseBuild = gulp.series(gulp.parallel(clean_release, appsBuild), gulp.parallel(listReleaseTasks()));
|
||||||
|
gulp.task('release', releaseBuild);
|
||||||
|
|
||||||
|
gulp.task('default', debugBuild);
|
||||||
|
|
||||||
// -----------------
|
// -----------------
|
||||||
// Helper functions
|
// Helper functions
|
||||||
|
@ -42,7 +74,7 @@ var nwBuilderOptions = {
|
||||||
// #
|
// #
|
||||||
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --linux32, --osx64, --win32, --win64, or --chromeos)
|
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --linux32, --osx64, --win32, --win64, or --chromeos)
|
||||||
// #
|
// #
|
||||||
function getPlatforms() {
|
function getInputPlatforms() {
|
||||||
var supportedPlatforms = ['linux64', 'linux32', 'osx64', 'win32','win64', 'chromeos'];
|
var supportedPlatforms = ['linux64', 'linux32', 'osx64', 'win32','win64', 'chromeos'];
|
||||||
var platforms = [];
|
var platforms = [];
|
||||||
var regEx = /--(\w+)/;
|
var regEx = /--(\w+)/;
|
||||||
|
@ -101,6 +133,11 @@ function getDefaultPlatform() {
|
||||||
return defaultPlatform;
|
return defaultPlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getPlatforms() {
|
||||||
|
return SELECTED_PLATFORMS.slice();
|
||||||
|
}
|
||||||
|
|
||||||
function removeItem(platforms, item) {
|
function removeItem(platforms, item) {
|
||||||
var index = platforms.indexOf(item);
|
var index = platforms.indexOf(item);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
|
@ -111,19 +148,19 @@ function removeItem(platforms, item) {
|
||||||
function getRunDebugAppCommand(arch) {
|
function getRunDebugAppCommand(arch) {
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'osx64':
|
case 'osx64':
|
||||||
return 'open ' + path.join(debugDir, pkg.name, arch, pkg.name + '.app');
|
return 'open ' + path.join(DEBUG_DIR, pkg.name, arch, pkg.name + '.app');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'linux64':
|
case 'linux64':
|
||||||
case 'linux32':
|
case 'linux32':
|
||||||
return path.join(debugDir, pkg.name, arch, pkg.name);
|
return path.join(DEBUG_DIR, pkg.name, arch, pkg.name);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'win32':
|
case 'win32':
|
||||||
case 'win64':
|
case 'win64':
|
||||||
return path.join(debugDir, pkg.name, arch, pkg.name + '.exe');
|
return path.join(DEBUG_DIR, pkg.name, arch, pkg.name + '.exe');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -134,41 +171,33 @@ function getRunDebugAppCommand(arch) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_release_filename(platform, ext) {
|
function getReleaseFilename(platform, ext) {
|
||||||
return 'Betaflight-Configurator_' + platform + '_' + pkg.version + '.' + ext;
|
return 'betaflight-configurator_' + pkg.version + '_' + platform + '.' + ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------
|
function clean_dist() {
|
||||||
// Tasks
|
return del([DIST_DIR + '**'], { force: true });
|
||||||
// -----------------
|
};
|
||||||
|
|
||||||
gulp.task('clean', function () {
|
function clean_apps() {
|
||||||
return runSequence('clean-dist', 'clean-apps', 'clean-debug', 'clean-release');
|
return del([APPS_DIR + '**'], { force: true });
|
||||||
});
|
};
|
||||||
|
|
||||||
gulp.task('clean-dist', function () {
|
function clean_debug() {
|
||||||
return del([distDir + '**'], { force: true });
|
return del([DEBUG_DIR + '**'], { force: true });
|
||||||
});
|
};
|
||||||
|
|
||||||
gulp.task('clean-apps', function () {
|
function clean_release() {
|
||||||
return del([appsDir + '**'], { force: true });
|
return del([RELEASE_DIR + '**'], { force: true });
|
||||||
});
|
};
|
||||||
|
|
||||||
gulp.task('clean-debug', function () {
|
function clean_cache() {
|
||||||
return del([debugDir + '**'], { force: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('clean-release', function () {
|
|
||||||
return del([releaseDir + '**'], { force: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('clean-cache', function () {
|
|
||||||
return del(['./cache/**'], { force: true });
|
return del(['./cache/**'], { force: true });
|
||||||
});
|
};
|
||||||
|
|
||||||
// Real work for dist task. Done in another task to call it via
|
// Real work for dist task. Done in another task to call it via
|
||||||
// run-sequence.
|
// run-sequence.
|
||||||
gulp.task('dist', ['clean-dist'], function () {
|
function dist() {
|
||||||
var distSources = [
|
var distSources = [
|
||||||
// CSS files
|
// CSS files
|
||||||
'./main.css',
|
'./main.css',
|
||||||
|
@ -293,148 +322,162 @@ gulp.task('dist', ['clean-dist'], function () {
|
||||||
'./resources/motor_order/*.svg',
|
'./resources/motor_order/*.svg',
|
||||||
];
|
];
|
||||||
return gulp.src(distSources, { base: '.' })
|
return gulp.src(distSources, { base: '.' })
|
||||||
.pipe(gulp.dest(distDir))
|
.pipe(gulp.dest(DIST_DIR))
|
||||||
.pipe(install({
|
.pipe(install({
|
||||||
npm: '--production --ignore-scripts'
|
npm: '--production --ignore-scripts'
|
||||||
}));;
|
}));;
|
||||||
});
|
};
|
||||||
|
|
||||||
// Create runable app directories in ./apps
|
// Create runable app directories in ./apps
|
||||||
gulp.task('apps', ['dist', 'clean-apps'], function (done) {
|
function apps(done) {
|
||||||
var platforms = getPlatforms();
|
var platforms = getPlatforms();
|
||||||
removeItem(platforms, 'chromeos');
|
removeItem(platforms, 'chromeos');
|
||||||
console.log('Apps build.');
|
|
||||||
|
|
||||||
if (platforms.length > 0) {
|
buildNWApps(platforms, 'normal', APPS_DIR, done);
|
||||||
var builder = new NwBuilder(Object.assign({
|
};
|
||||||
buildDir: appsDir,
|
|
||||||
platforms: platforms,
|
|
||||||
flavor: 'normal'
|
|
||||||
}, nwBuilderOptions));
|
|
||||||
builder.on('log', console.log);
|
|
||||||
builder.build(function (err) {
|
|
||||||
if (err) {
|
|
||||||
console.log('Error building NW apps: ' + err);
|
|
||||||
runSequence('clean-apps', function() {
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
runSequence('post-build', function() {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.log('No platform suitable for the apps task')
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('post-build', function (done) {
|
function listPostBuildTasks(folder, done) {
|
||||||
|
|
||||||
var platforms = getPlatforms();
|
var platforms = getPlatforms();
|
||||||
|
|
||||||
var merged = mergeStream();
|
var postBuildTasks = [];
|
||||||
|
|
||||||
if (platforms.indexOf('linux32') != -1) {
|
if (platforms.indexOf('linux32') != -1) {
|
||||||
// Copy Ubuntu launcher scripts to destination dir
|
postBuildTasks.push(function post_build_linux32(done){ return post_build('linux32', folder, done) });
|
||||||
var launcherDir = path.join(appsDir, pkg.name, 'linux32');
|
|
||||||
console.log('Copy Ubuntu launcher scripts to ' + launcherDir);
|
|
||||||
merged.add(gulp.src('assets/linux/**')
|
|
||||||
.pipe(gulp.dest(launcherDir)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platforms.indexOf('linux64') != -1) {
|
if (platforms.indexOf('linux64') != -1) {
|
||||||
// Copy Ubuntu launcher scripts to destination dir
|
postBuildTasks.push(function post_build_linux64(done){ return post_build('linux64', folder, done) });
|
||||||
var launcherDir = path.join(appsDir, pkg.name, 'linux64');
|
|
||||||
console.log('Copy Ubuntu launcher scripts to ' + launcherDir);
|
|
||||||
merged.add(gulp.src('assets/linux/**')
|
|
||||||
.pipe(gulp.dest(launcherDir)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return merged.isEmpty() ? done() : merged;
|
// We need to return at least one task, if not gulp will throw an error
|
||||||
});
|
if (postBuildTasks.length == 0) {
|
||||||
|
postBuildTasks.push(function post_build_none(done){ done() });
|
||||||
|
}
|
||||||
|
return postBuildTasks;
|
||||||
|
}
|
||||||
|
|
||||||
|
function post_build(arch, folder, done) {
|
||||||
|
|
||||||
|
if ((arch =='linux32') || (arch == 'linux64')) {
|
||||||
|
// Copy Ubuntu launcher scripts to destination dir
|
||||||
|
var launcherDir = path.join(folder, pkg.name, arch);
|
||||||
|
console.log('Copy Ubuntu launcher scripts to ' + launcherDir);
|
||||||
|
return gulp.src('assets/linux/**')
|
||||||
|
.pipe(gulp.dest(launcherDir));
|
||||||
|
}
|
||||||
|
|
||||||
|
return done();
|
||||||
|
}
|
||||||
|
|
||||||
// Create debug app directories in ./debug
|
// Create debug app directories in ./debug
|
||||||
gulp.task('debug', ['dist', 'clean-debug'], function (done) {
|
function debug(done) {
|
||||||
var platforms = getPlatforms();
|
var platforms = getPlatforms();
|
||||||
removeItem(platforms, 'chromeos');
|
removeItem(platforms, 'chromeos');
|
||||||
console.log('Debug build.');
|
|
||||||
|
buildNWApps(platforms, 'sdk', DEBUG_DIR, done);
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildNWApps(platforms, flavor, dir, done) {
|
||||||
|
|
||||||
if (platforms.length > 0) {
|
if (platforms.length > 0) {
|
||||||
var builder = new NwBuilder(Object.assign({
|
var builder = new NwBuilder(Object.assign({
|
||||||
buildDir: debugDir,
|
buildDir: dir,
|
||||||
platforms: platforms,
|
platforms: platforms,
|
||||||
flavor: 'sdk'
|
flavor: flavor
|
||||||
}, nwBuilderOptions));
|
}, nwBuilderOptions));
|
||||||
builder.on('log', console.log);
|
builder.on('log', console.log);
|
||||||
builder.build(function (err) {
|
builder.build(function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Error building NW apps: ' + err);
|
console.log('Error building NW apps: ' + err);
|
||||||
runSequence('clean-debug', function() {
|
clean_debug();
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
var exec = require('child_process').exec;
|
|
||||||
if (platforms.length === 1) {
|
|
||||||
var run = getRunDebugAppCommand(platforms[0]);
|
|
||||||
console.log('Starting debug app (' + run + ')...');
|
|
||||||
exec(run);
|
|
||||||
} else {
|
|
||||||
console.log('More than one platform specified, not starting debug app');
|
|
||||||
}
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.error('No platform suitable for the debug task')
|
console.log('No platform suitable for NW Build')
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function start_debug(done) {
|
||||||
|
|
||||||
|
var platforms = getPlatforms();
|
||||||
|
|
||||||
|
var exec = require('child_process').exec;
|
||||||
|
if (platforms.length === 1) {
|
||||||
|
var run = getRunDebugAppCommand(platforms[0]);
|
||||||
|
console.log('Starting debug app (' + run + ')...');
|
||||||
|
exec(run);
|
||||||
|
} else {
|
||||||
|
console.log('More than one platform specified, not starting debug app');
|
||||||
|
}
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
|
||||||
// Create installer package for windows platforms
|
// Create installer package for windows platforms
|
||||||
function release_win(arch) {
|
function release_win(arch, done) {
|
||||||
|
|
||||||
// Create the output directory, with write permissions
|
// Create the output directory, with write permissions
|
||||||
fs.mkdir(releaseDir, '0775', function(err) {
|
fs.mkdir(RELEASE_DIR, '0775', function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.code !== 'EEXIST') {
|
if (err.code !== 'EEXIST') {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Parameters passed to the installer script
|
// Parameters passed to the installer script
|
||||||
const options = {
|
const options = {
|
||||||
verbose: 2,
|
verbose: 2,
|
||||||
define: {
|
define: {
|
||||||
'VERSION': pkg.version,
|
'VERSION': pkg.version,
|
||||||
'PLATFORM': arch,
|
'PLATFORM': arch,
|
||||||
'DEST_FOLDER': releaseDir
|
'DEST_FOLDER': RELEASE_DIR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var output = makensis.compileSync('./assets/windows/installer.nsi', options);
|
var output = makensis.compileSync('./assets/windows/installer.nsi', options);
|
||||||
|
|
||||||
if (output.status === 0) {
|
if (output.status !== 0) {
|
||||||
console.log('Installer finished for platform: ' + arch);
|
|
||||||
} else {
|
|
||||||
console.error('Installer for platform ' + arch + ' finished with error ' + output.status + ': ' + output.stderr);
|
console.error('Installer for platform ' + arch + ' finished with error ' + output.status + ': ' + output.stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create distribution package (zip) for windows and linux platforms
|
// Create distribution package (zip) for windows and linux platforms
|
||||||
function release(arch) {
|
function release_zip(arch) {
|
||||||
var src = path.join(appsDir, pkg.name, arch, '**');
|
var src = path.join(APPS_DIR, pkg.name, arch, '**');
|
||||||
var output = get_release_filename(arch, 'zip');
|
var output = getReleaseFilename(arch, 'zip');
|
||||||
|
var base = path.join(APPS_DIR, pkg.name, arch);
|
||||||
|
|
||||||
console.log('zip package started: ' + arch);
|
return compressFiles(src, base, output, 'Betaflight Configurator');
|
||||||
return gulp.src(src, {base: path.join(appsDir, pkg.name, arch) })
|
}
|
||||||
.pipe(rename(function(actualPath){ actualPath.dirname = path.join('Betaflight Configurator', actualPath.dirname) }))
|
|
||||||
.pipe(zip(output))
|
// Create distribution package for chromeos platform
|
||||||
.pipe(gulp.dest(releaseDir));
|
function release_chromeos() {
|
||||||
|
var src = path.join(DIST_DIR, '**');
|
||||||
|
var output = getReleaseFilename('chromeos', 'zip');
|
||||||
|
var base = DIST_DIR;
|
||||||
|
|
||||||
|
return compressFiles(src, base, output, '.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compress files from srcPath, using basePath, to outputFile in the RELEASE_DIR
|
||||||
|
function compressFiles(srcPath, basePath, outputFile, zipFolder) {
|
||||||
|
return gulp.src(srcPath, { base: basePath })
|
||||||
|
.pipe(rename(function(actualPath){ actualPath.dirname = path.join(zipFolder, actualPath.dirname) }))
|
||||||
|
.pipe(zip(outputFile))
|
||||||
|
.pipe(gulp.dest(RELEASE_DIR));
|
||||||
}
|
}
|
||||||
|
|
||||||
function release_deb(arch) {
|
function release_deb(arch) {
|
||||||
|
|
||||||
var debArch;
|
var debArch;
|
||||||
|
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'linux32':
|
case 'linux32':
|
||||||
debArch = 'i386';
|
debArch = 'i386';
|
||||||
|
@ -448,9 +491,7 @@ function release_deb(arch) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Debian package started arch: " + arch);
|
return gulp.src([path.join(APPS_DIR, pkg.name, arch, '*')])
|
||||||
|
|
||||||
return gulp.src([path.join(appsDir, pkg.name, arch, '*')])
|
|
||||||
.pipe(deb({
|
.pipe(deb({
|
||||||
package: pkg.name,
|
package: pkg.name,
|
||||||
version: pkg.version,
|
version: pkg.version,
|
||||||
|
@ -464,30 +505,19 @@ function release_deb(arch) {
|
||||||
depends: 'libgconf-2-4',
|
depends: 'libgconf-2-4',
|
||||||
changelog: [],
|
changelog: [],
|
||||||
_target: 'opt/betaflight/betaflight-configurator',
|
_target: 'opt/betaflight/betaflight-configurator',
|
||||||
_out: releaseDir,
|
_out: RELEASE_DIR,
|
||||||
_clean: true
|
_clean: true
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create distribution package for chromeos platform
|
|
||||||
function release_chromeos() {
|
|
||||||
var src = distDir + '/**';
|
|
||||||
var output = get_release_filename('chromeos', 'zip');
|
|
||||||
|
|
||||||
console.log('chromeos package started');
|
|
||||||
return gulp.src(src)
|
|
||||||
.pipe(zip(output))
|
|
||||||
.pipe(gulp.dest(releaseDir));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create distribution package for macOS platform
|
// Create distribution package for macOS platform
|
||||||
function release_osx64() {
|
function release_osx64() {
|
||||||
var appdmg = require('gulp-appdmg');
|
var appdmg = require('gulp-appdmg');
|
||||||
|
|
||||||
return gulp.src([])
|
return gulp.src([])
|
||||||
.pipe(appdmg({
|
.pipe(appdmg({
|
||||||
target: path.join(releaseDir, get_release_filename('macOS', 'dmg')),
|
target: path.join(RELEASE_DIR, getReleaseFilename('macOS', 'dmg')),
|
||||||
basepath: path.join(appsDir, pkg.name, 'osx64'),
|
basepath: path.join(APPS_DIR, pkg.name, 'osx64'),
|
||||||
specification: {
|
specification: {
|
||||||
title: 'Betaflight Configurator',
|
title: 'Betaflight Configurator',
|
||||||
contents: [
|
contents: [
|
||||||
|
@ -507,48 +537,38 @@ function release_osx64() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create distributable .zip files in ./release
|
// Create a list of the gulp tasks to execute for release
|
||||||
gulp.task('release', ['apps', 'clean-release'], function (done) {
|
function listReleaseTasks(done) {
|
||||||
fs.mkdir(releaseDir, '0775', function(err) {
|
|
||||||
if (err) {
|
|
||||||
if (err.code !== 'EEXIST') {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var platforms = getPlatforms();
|
var platforms = getPlatforms();
|
||||||
console.log('Packing release.');
|
|
||||||
|
|
||||||
var merged = mergeStream();
|
var releaseTasks = [];
|
||||||
|
|
||||||
if (platforms.indexOf('chromeos') !== -1) {
|
if (platforms.indexOf('chromeos') !== -1) {
|
||||||
merged.add(release_chromeos());
|
releaseTasks.push(release_chromeos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platforms.indexOf('linux64') !== -1) {
|
if (platforms.indexOf('linux64') !== -1) {
|
||||||
merged.add(release('linux64'));
|
releaseTasks.push(function release_linux64_zip(){ return release_zip('linux64') });
|
||||||
merged.add(release_deb('linux64'));
|
releaseTasks.push(function release_linux64_deb(){ return release_deb('linux64') });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platforms.indexOf('linux32') !== -1) {
|
if (platforms.indexOf('linux32') !== -1) {
|
||||||
merged.add(release('linux32'));
|
releaseTasks.push(function release_linux32_zip(){ return release_zip('linux32') });
|
||||||
merged.add(release_deb('linux32'));
|
releaseTasks.push(function release_linux32_deb(){ return release_deb('linux32') });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platforms.indexOf('osx64') !== -1) {
|
if (platforms.indexOf('osx64') !== -1) {
|
||||||
merged.add(release_osx64());
|
releaseTasks.push(release_osx64);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platforms.indexOf('win32') !== -1) {
|
if (platforms.indexOf('win32') !== -1) {
|
||||||
release_win('win32');
|
releaseTasks.push(function release_win32(done){ return release_win('win32', done) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platforms.indexOf('win64') !== -1) {
|
if (platforms.indexOf('win64') !== -1) {
|
||||||
release_win('win64');
|
releaseTasks.push(function release_win64(done){ return release_win('win64', done) });
|
||||||
}
|
}
|
||||||
|
|
||||||
return merged.isEmpty() ? done() : merged;
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('default', ['debug']);
|
return releaseTasks;
|
||||||
|
}
|
||||||
|
|
|
@ -24,22 +24,19 @@
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"gulp": "~3.9.1",
|
"gulp": "~4.0.0",
|
||||||
"gulp-concat": "~2.6.1",
|
"gulp-concat": "~2.6.1",
|
||||||
"gulp-debian": "~0.1.6",
|
"gulp-debian": "~0.1.7",
|
||||||
"gulp-install": "^1.1.0",
|
"gulp-install": "^1.1.0",
|
||||||
"gulp-rename": "~1.2.2",
|
"gulp-rename": "~1.2.2",
|
||||||
"gulp-zip": "^4.1.0",
|
"gulp-zip": "^4.1.0",
|
||||||
"inflection": "1.12.0",
|
"inflection": "1.12.0",
|
||||||
"jquery-ui-npm": "1.12.0",
|
"jquery-ui-npm": "1.12.0",
|
||||||
"makensis": "^0.9.0",
|
"makensis": "^0.9.0",
|
||||||
"merge-stream": "^1.0.1",
|
|
||||||
"nw-builder": "^3.4.1",
|
"nw-builder": "^3.4.1",
|
||||||
"os": "^0.1.1",
|
"os": "^0.1.1",
|
||||||
"platform-dependent-modules": "0.0.14",
|
"platform-dependent-modules": "0.0.14",
|
||||||
"run-sequence": "^2.2.0",
|
"temp": "^0.8.3"
|
||||||
"temp": "^0.8.3",
|
|
||||||
"title-case": "^2.1.0"
|
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"platformDependentModules": {
|
"platformDependentModules": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue