betaflight-configurator/gulpfile.js

1185 lines
37 KiB
JavaScript
Raw Normal View History

'use strict';
2018-01-10 14:36:12 +00:00
const child_process = require('child_process');
const fs = require('fs');
2018-05-13 19:00:56 +00:00
const fse = require('fs-extra');
const https = require('follow-redirects').https;
2018-01-10 14:36:12 +00:00
const path = require('path');
const zip = require('gulp-zip');
const del = require('del');
const NwBuilder = require('nw-builder');
2020-06-30 13:10:22 +00:00
const innoSetup = require('@quanle94/innosetup');
2018-01-10 14:36:12 +00:00
const deb = require('gulp-debian');
2018-01-29 15:14:24 +00:00
const buildRpm = require('rpm-builder');
const commandExistsSync = require('command-exists').sync;
2018-05-13 19:00:56 +00:00
const targz = require('targz');
2018-01-10 14:36:12 +00:00
const gulp = require('gulp');
const rollup = require('rollup');
2018-01-10 14:36:12 +00:00
const concat = require('gulp-concat');
2019-05-08 13:39:21 +00:00
const yarn = require("gulp-yarn");
2018-01-10 14:36:12 +00:00
const rename = require('gulp-rename');
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
const replace = require('gulp-replace');
const jeditor = require("gulp-json-editor");
const xmlTransformer = require("gulp-xml-transformer");
2018-01-10 14:36:12 +00:00
const os = require('os');
const git = require('simple-git')();
const source = require('vinyl-source-stream');
const stream = require('stream');
const prompt = require('gulp-prompt');
2018-01-10 14:36:12 +00:00
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
const cordova = require("cordova-lib").cordova;
2020-10-26 19:17:30 +00:00
const browserify = require('browserify');
const glob = require('glob');
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
2018-01-10 14:36:12 +00:00
const DIST_DIR = './dist/';
const APPS_DIR = './apps/';
const DEBUG_DIR = './debug/';
const RELEASE_DIR = './release/';
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
const CORDOVA_DIR = './cordova/';
const CORDOVA_DIST_DIR = './dist_cordova/';
const LINUX_INSTALL_DIR = '/opt/betaflight';
const NODE_ENV = process.env.NODE_ENV || 'production';
const NAME_REGEX = /-/g;
2020-10-15 14:28:32 +00:00
const nwBuilderOptions = {
2022-03-14 18:15:39 +00:00
version: os.platform() === 'linux' ? '0.54.1' : '0.60.0', // linux has a bug with moving OSD elements
files: `${DIST_DIR}**/*`,
2018-01-21 16:09:36 +00:00
macIcns: './src/images/bf_icon.icns',
2018-01-09 00:44:13 +00:00
macPlist: { 'CFBundleDisplayName': 'Betaflight Configurator'},
winIco: './src/images/bf_icon.ico',
2020-10-15 14:28:32 +00:00
zip: false,
2018-01-09 00:44:13 +00:00
};
2020-10-15 14:28:32 +00:00
const nwArmVersion = '0.27.6';
2018-05-13 19:00:56 +00:00
let metadata = {};
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
let cordovaDependencies = true;
2018-01-10 14:36:12 +00:00
//-----------------
//Pre tasks operations
//-----------------
2018-01-10 14:36:12 +00:00
const SELECTED_PLATFORMS = getInputPlatforms();
2018-01-10 14:36:12 +00:00
//-----------------
//Tasks
//-----------------
gulp.task('clean', gulp.parallel(clean_dist, clean_apps, clean_debug, clean_release, clean_cordova));
2018-01-10 14:36:12 +00:00
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);
gulp.task('clean-cordova', clean_cordova);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
gulp.task('test-cordova', cordova_browserify);
// Function definitions are processed before function calls.
function process_package_release(done) {
getGitRevision(done, processPackage, true);
}
function process_package_debug(done) {
getGitRevision(done, processPackage, false);
}
2018-08-12 08:19:02 +00:00
// dist_yarn MUST be done after dist_src
const distBuild = gulp.series(process_package_release, dist_src, dist_changelog, dist_yarn, dist_locale, dist_libraries, dist_resources, dist_rollup, gulp.series(cordova_dist()));
const debugDistBuild = gulp.series(process_package_debug, dist_src, dist_changelog, dist_yarn, dist_locale, dist_libraries, dist_resources, dist_rollup, gulp.series(cordova_dist()));
const distRebuild = gulp.series(clean_dist, distBuild);
gulp.task('dist', distRebuild);
2018-01-10 14:36:12 +00:00
const appsBuild = gulp.series(gulp.parallel(clean_apps, distRebuild), apps, gulp.series(cordova_apps(true)), gulp.parallel(listPostBuildTasks(APPS_DIR)));
2018-01-10 14:36:12 +00:00
gulp.task('apps', appsBuild);
const debugAppsBuild = gulp.series(gulp.parallel(clean_debug, gulp.series(clean_dist, debugDistBuild)), debug, gulp.series(cordova_apps(false)), gulp.parallel(listPostBuildTasks(DEBUG_DIR)));
2021-09-16 09:34:16 +00:00
const debugBuildNoStart = gulp.series(debugDistBuild, debug, gulp.parallel(listPostBuildTasks(DEBUG_DIR)));
const debugBuild = gulp.series(debugBuildNoStart, start_debug);
2018-01-10 14:36:12 +00:00
gulp.task('debug', debugBuild);
2021-09-16 09:34:16 +00:00
gulp.task('debug-no-start', debugBuildNoStart);
2018-01-10 14:36:12 +00:00
const releaseBuild = gulp.series(gulp.parallel(clean_release, appsBuild), gulp.parallel(listReleaseTasks(true, APPS_DIR)));
2018-01-10 14:36:12 +00:00
gulp.task('release', releaseBuild);
const debugReleaseBuild = gulp.series(gulp.parallel(clean_release, debugAppsBuild), gulp.parallel(listReleaseTasks(false, DEBUG_DIR)));
gulp.task('debug-release', debugReleaseBuild);
2018-01-10 14:36:12 +00:00
gulp.task('default', debugBuild);
2018-01-09 00:44:13 +00:00
// -----------------
// Helper functions
// -----------------
// Get platform from commandline args
// #
2020-10-01 07:39:17 +00:00
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --linux32, --armv7, --osx64, --win32, --win64, or --android)
2018-05-13 19:00:56 +00:00
// #
2018-01-10 14:36:12 +00:00
function getInputPlatforms() {
2020-10-01 07:39:17 +00:00
const supportedPlatforms = ['linux64', 'linux32', 'armv7', 'osx64', 'win32', 'win64', 'android'];
2020-10-15 14:28:32 +00:00
const platforms = [];
const regEx = /--(\w+)/;
2020-10-15 14:28:32 +00:00
for (let i = 3; i < process.argv.length; i++) {
const arg = process.argv[i].match(regEx)[1];
if (supportedPlatforms.indexOf(arg) > -1) {
platforms.push(arg);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
} else if (arg === 'nowinicon') {
console.log('ignoring winIco');
delete nwBuilderOptions['winIco'];
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
} else if (arg === 'skipdep') {
console.log('ignoring cordova dependencies');
cordovaDependencies = false;
} else {
2020-10-15 14:28:32 +00:00
console.log(`Unknown platform: ${arg}`);
process.exit();
}
2018-05-13 19:00:56 +00:00
}
if (platforms.length === 0) {
2020-10-15 14:28:32 +00:00
const defaultPlatform = getDefaultPlatform();
if (supportedPlatforms.indexOf(defaultPlatform) > -1) {
platforms.push(defaultPlatform);
} else {
2018-01-08 10:37:32 +00:00
console.error(`Your current platform (${os.platform()}) is not a supported build platform. Please specify platform to build for on the command line.`);
process.exit();
}
}
2018-01-08 10:37:32 +00:00
if (platforms.length > 0) {
2020-10-15 14:28:32 +00:00
console.log(`Building for platform(s): ${platforms}.`);
2018-01-08 10:37:32 +00:00
} else {
console.error('No suitables platforms found.');
process.exit();
}
return platforms;
}
// Gets the default platform to be used
function getDefaultPlatform() {
2020-10-15 14:28:32 +00:00
let defaultPlatform;
2017-12-03 20:18:03 +00:00
switch (os.platform()) {
case 'darwin':
defaultPlatform = 'osx64';
2017-12-03 20:18:03 +00:00
break;
case 'linux':
defaultPlatform = 'linux64';
2017-12-03 20:18:03 +00:00
break;
case 'win32':
defaultPlatform = 'win64';
break;
2018-05-13 19:00:56 +00:00
default:
defaultPlatform = '';
2018-05-13 19:00:56 +00:00
break;
}
return defaultPlatform;
}
2018-01-10 14:36:12 +00:00
function getPlatforms() {
return SELECTED_PLATFORMS.slice();
}
2018-01-08 10:37:32 +00:00
function removeItem(platforms, item) {
2020-10-15 14:28:32 +00:00
const index = platforms.indexOf(item);
2018-01-08 10:37:32 +00:00
if (index >= 0) {
platforms.splice(index, 1);
}
}
function getRunDebugAppCommand(arch) {
2020-10-01 07:39:17 +00:00
let command;
switch (arch) {
case 'osx64':
const packageName = `${metadata.name}.app`;
command = `open ${path.join(DEBUG_DIR, metadata.name, arch, packageName)}`;
break;
case 'linux64':
case 'linux32':
2018-05-13 19:00:56 +00:00
case 'armv7':
command = path.join(DEBUG_DIR, metadata.name, arch, metadata.name);
break;
2017-12-03 20:18:03 +00:00
case 'win32':
case 'win64':
command = path.join(DEBUG_DIR, metadata.name, arch, `${metadata.name}.exe`);
2017-12-03 20:18:03 +00:00
break;
default:
2020-10-01 07:39:17 +00:00
command = '';
2017-12-04 10:03:35 +00:00
2017-12-03 20:18:03 +00:00
break;
}
2020-10-01 07:39:17 +00:00
return command;
2017-12-03 20:18:03 +00:00
}
2022-01-04 13:52:22 +00:00
function getReleaseFilename(platform, ext, portable = false) {
return `${metadata.name}_${metadata.version}_${platform}${portable ? "-portable" : ""}.${ext}`;
}
2018-05-13 19:00:56 +00:00
function clean_dist() {
2020-10-15 14:28:32 +00:00
return del([`${DIST_DIR}**`], { force: true });
}
2018-05-13 19:00:56 +00:00
function clean_apps() {
2020-10-15 14:28:32 +00:00
return del([`${APPS_DIR}**`], { force: true });
}
2018-05-13 19:00:56 +00:00
function clean_debug() {
2020-10-15 14:28:32 +00:00
return del([`${DEBUG_DIR}**`], { force: true });
}
2018-05-13 19:00:56 +00:00
function clean_release() {
2020-10-15 14:28:32 +00:00
return del([`${RELEASE_DIR}**`], { force: true });
}
2018-05-13 19:00:56 +00:00
function clean_cache() {
return del(['./cache/**'], { force: true });
}
// Real work for dist task. Done in another task to call it via
// run-sequence.
function processPackage(done, gitRevision, isReleaseBuild) {
const metadataKeys = [ 'name', 'productName', 'description', 'author', 'license', 'version' ];
const pkg = require('./package.json');
// remove gulp-appdmg from the package.json we're going to write
delete pkg.optionalDependencies['gulp-appdmg'];
pkg.gitRevision = gitRevision;
if (!isReleaseBuild) {
pkg.productName = `${pkg.productName} (Debug Build)`;
pkg.description = `${pkg.description} (Debug Build)`;
pkg.version = `${pkg.version}-debug-${gitRevision}`;
metadata.packageId = `${pkg.name}-debug`;
} else {
metadata.packageId = pkg.name;
}
function version_prompt() {
return gulp.src('.')
.pipe(prompt.prompt([{
type: 'input',
name: 'version',
message: `Package version (default: ${pkg.version}):`,
}, {
type: 'input',
name: 'storeVersion',
message: 'Google Play store version (<x.y.z>, default: package version):',
}], function(res) {
if (res.version) {
pkg.version = res.version;
}
if (res.storeVersion) {
metadata.storeVersion = res.storeVersion;
}
}));
}
function write_package_file() {
Object.keys(pkg)
.filter(key => metadataKeys.includes(key))
.forEach((key) => {
metadata[key] = pkg[key];
});
const packageJson = new stream.Readable;
packageJson.push(JSON.stringify(pkg, undefined, 2));
packageJson.push(null);
return packageJson
.pipe(source('package.json'))
.pipe(gulp.dest(DIST_DIR));
}
const platforms = getPlatforms();
if (platforms.indexOf('android') !== -1 && isReleaseBuild) {
gulp.series(version_prompt, write_package_file)(done);
} else {
gulp.series(write_package_file)(done);
}
}
2018-01-24 23:37:07 +00:00
function dist_src() {
2020-10-15 14:28:32 +00:00
const distSources = [
2018-01-29 14:40:04 +00:00
'./src/**/*',
'!./src/css/dropdown-lists/LICENSE',
2020-10-15 14:28:32 +00:00
'!./src/support/**',
];
2018-01-24 23:37:07 +00:00
return gulp.src(distSources, { base: 'src' })
.pipe(gulp.src('yarn.lock'))
.pipe(gulp.dest(DIST_DIR));
}
function dist_changelog() {
return gulp.src('changelog.html')
2020-10-15 14:28:32 +00:00
.pipe(gulp.dest(`${DIST_DIR}tabs/`));
}
// This function relies on files from the dist_src function
function dist_yarn() {
return gulp.src([`${DIST_DIR}package.json`, `${DIST_DIR}yarn.lock`])
.pipe(gulp.dest(DIST_DIR))
2019-05-08 13:39:21 +00:00
.pipe(yarn({
2020-10-15 14:28:32 +00:00
production: true,
2018-01-25 23:52:10 +00:00
}));
}
2018-01-24 23:37:07 +00:00
function dist_locale() {
return gulp.src('./locales/**/*', { base: 'locales'})
2020-10-23 07:01:46 +00:00
.pipe(gulp.dest(`${DIST_DIR}locales`));
2018-01-24 23:37:07 +00:00
}
function dist_libraries() {
return gulp.src('./libraries/**/*', { base: '.'})
2020-10-15 14:28:32 +00:00
.pipe(gulp.dest(`${DIST_DIR}js`));
2018-01-24 23:37:07 +00:00
}
function dist_resources() {
2019-07-01 10:44:36 +00:00
return gulp.src(['./resources/**/*', '!./resources/osd/**/*.png'], { base: '.'})
2018-01-24 23:37:07 +00:00
.pipe(gulp.dest(DIST_DIR));
}
function dist_rollup() {
const commonjs = require('@rollup/plugin-commonjs');
const resolve = require('@rollup/plugin-node-resolve').default;
const alias = require('@rollup/plugin-alias');
const vue = require('rollup-plugin-vue');
const rollupReplace = require('@rollup/plugin-replace');
return rollup
.rollup({
2020-10-24 06:36:36 +00:00
input: {
// For any new file migrated to modules add the output path
// in dist on the left, on the right it's input file path.
// If all the things used by other files are importing
// it with `import/export` file doesn't have to be here.
// I will be picked up by rollup and bundled accordingly.
2020-10-24 06:36:36 +00:00
'components/init': 'src/components/init.js',
'js/main_cordova': 'src/js/main_cordova.js',
2021-01-01 18:26:30 +00:00
'js/utils/common': 'src/js/utils/common.js',
2021-03-01 18:03:37 +00:00
'js/tabs/logging': 'src/js/tabs/logging.js',
'js/main': 'src/js/main.js',
2020-10-24 06:36:36 +00:00
},
plugins: [
alias({
entries: {
vue: require.resolve('vue/dist/vue.esm.js'),
},
}),
rollupReplace({
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
}),
resolve(),
commonjs(),
vue(),
],
})
.then(bundle =>
bundle.write({
format: 'esm',
2020-10-24 06:36:36 +00:00
// rollup is smart about how `name` is treated.
// so `input` you create file like `components/init`
// `[name]` will be replaced with it creating directories
// accordingly inside of `dist`
entryFileNames: '[name].js',
dir: DIST_DIR,
}),
);
}
// Create runable app directories in ./apps
2018-01-10 14:36:12 +00:00
function apps(done) {
2020-10-15 14:28:32 +00:00
const platforms = getPlatforms();
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
removeItem(platforms, 'android');
2018-01-08 10:37:32 +00:00
2018-05-13 19:00:56 +00:00
buildNWAppsWrapper(platforms, 'normal', APPS_DIR, done);
}
2020-10-15 14:28:32 +00:00
function listPostBuildTasks(folder) {
2018-01-05 17:58:27 +00:00
2020-10-15 14:28:32 +00:00
const platforms = getPlatforms();
2018-01-05 17:58:27 +00:00
2020-10-15 14:28:32 +00:00
const postBuildTasks = [];
2018-01-05 17:58:27 +00:00
2020-10-15 14:28:32 +00:00
if (platforms.indexOf('linux32') !== -1) {
postBuildTasks.push(function post_build_linux32(done) {
return post_build('linux32', folder, done);
});
2018-01-05 17:58:27 +00:00
}
2020-10-15 14:28:32 +00:00
if (platforms.indexOf('linux64') !== -1) {
postBuildTasks.push(function post_build_linux64(done) {
return post_build('linux64', folder, done);
});
2018-01-10 14:36:12 +00:00
}
2020-10-15 14:28:32 +00:00
if (platforms.indexOf('armv7') !== -1) {
postBuildTasks.push(function post_build_armv7(done) {
return post_build('armv7', folder, done);
});
2018-05-13 19:00:56 +00:00
}
2018-01-10 14:36:12 +00:00
// We need to return at least one task, if not gulp will throw an error
2020-10-15 14:28:32 +00:00
if (postBuildTasks.length === 0) {
postBuildTasks.push(function post_build_none(done) {
done();
});
2018-01-10 14:36:12 +00:00
}
return postBuildTasks;
}
function post_build(arch, folder, done) {
2018-05-13 19:00:56 +00:00
if ((arch === 'linux32') || (arch === 'linux64')) {
2018-01-05 17:58:27 +00:00
// Copy Ubuntu launcher scripts to destination dir
const launcherDir = path.join(folder, metadata.name, arch);
2020-10-15 14:28:32 +00:00
console.log(`Copy Ubuntu launcher scripts to ${launcherDir}`);
2018-01-10 14:36:12 +00:00
return gulp.src('assets/linux/**')
.pipe(gulp.dest(launcherDir));
2018-01-05 17:58:27 +00:00
}
2018-05-13 19:00:56 +00:00
if (arch === 'armv7') {
console.log('Moving ARMv7 build from "linux32" to "armv7" directory...');
fse.moveSync(path.join(folder, metadata.name, 'linux32'), path.join(folder, metadata.name, 'armv7'));
2018-05-13 19:00:56 +00:00
}
2018-01-10 14:36:12 +00:00
return done();
}
// Create debug app directories in ./debug
2018-01-10 14:36:12 +00:00
function debug(done) {
2020-10-15 14:28:32 +00:00
const platforms = getPlatforms();
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
removeItem(platforms, 'android');
2018-01-10 14:36:12 +00:00
2018-05-13 19:00:56 +00:00
buildNWAppsWrapper(platforms, 'sdk', DEBUG_DIR, done);
2018-01-10 14:36:12 +00:00
}
function injectARMCache(flavor, done) {
2020-10-15 14:28:32 +00:00
const flavorPostfix = `-${flavor}`;
const flavorDownloadPostfix = flavor !== 'normal' ? `-${flavor}` : '';
2018-05-13 19:00:56 +00:00
clean_cache().then(function() {
2018-05-20 00:16:50 +00:00
if (!fs.existsSync('./cache')) {
fs.mkdirSync('./cache');
}
2018-05-13 19:00:56 +00:00
fs.closeSync(fs.openSync('./cache/_ARMv7_IS_CACHED', 'w'));
2020-10-15 14:28:32 +00:00
const versionFolder = `./cache/${nwBuilderOptions.version}${flavorPostfix}`;
2018-05-20 00:16:50 +00:00
if (!fs.existsSync(versionFolder)) {
fs.mkdirSync(versionFolder);
}
2020-10-15 14:28:32 +00:00
const linux32Folder = `${versionFolder}/linux32`;
if (!fs.existsSync(linux32Folder)) {
fs.mkdirSync(linux32Folder);
2018-05-20 00:16:50 +00:00
}
2020-10-15 14:28:32 +00:00
const downloadedArchivePath = `${versionFolder}/nwjs${flavorPostfix}-v${nwArmVersion}-linux-arm.tar.gz`;
const downloadUrl = `https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/v${nwArmVersion}/nwjs${flavorDownloadPostfix}-v${nwArmVersion}-linux-arm.tar.gz`;
2018-05-13 19:00:56 +00:00
if (fs.existsSync(downloadedArchivePath)) {
console.log('Prebuilt ARMv7 binaries found in /tmp');
downloadDone(flavorDownloadPostfix, downloadedArchivePath, versionFolder);
} else {
console.log(`Downloading prebuilt ARMv7 binaries from "${downloadUrl}"...`);
process.stdout.write('> Starting download...\r');
2020-10-15 14:28:32 +00:00
const armBuildBinary = fs.createWriteStream(downloadedArchivePath);
https.get(downloadUrl, function(res) {
const totalBytes = res.headers['content-length'];
let downloadedBytes = 0;
2018-05-13 19:00:56 +00:00
res.pipe(armBuildBinary);
res.on('data', function (chunk) {
downloadedBytes += chunk.length;
process.stdout.write(`> ${parseInt((downloadedBytes * 100) / totalBytes)}% done \r`);
});
armBuildBinary.on('finish', function() {
process.stdout.write('> 100% done \n');
armBuildBinary.close(function() {
downloadDone(flavorDownloadPostfix, downloadedArchivePath, versionFolder);
});
});
});
}
});
2020-10-15 14:28:32 +00:00
function downloadDone(flavorDownload, downloadedArchivePath, versionFolder) {
2018-05-13 19:00:56 +00:00
console.log('Injecting prebuilt ARMv7 binaries into Linux32 cache...');
targz.decompress({
src: downloadedArchivePath,
dest: versionFolder,
2018-05-20 00:16:50 +00:00
}, function(err) {
2018-05-13 19:00:56 +00:00
if (err) {
console.log(err);
clean_debug();
process.exit(1);
} else {
fs.rename(
2020-10-15 14:28:32 +00:00
`${versionFolder}/nwjs${flavorDownload}-v${nwArmVersion}-linux-arm`,
2018-05-13 19:00:56 +00:00
`${versionFolder}/linux32`,
2020-10-15 14:28:32 +00:00
(renameErr) => {
if (renameErr) {
console.log(renameErr);
2018-05-13 19:00:56 +00:00
clean_debug();
process.exit(1);
}
done();
},
2018-05-13 19:00:56 +00:00
);
}
});
}
}
2018-05-13 19:00:56 +00:00
function buildNWAppsWrapper(platforms, flavor, dir, done) {
function buildNWAppsCallback() {
buildNWApps(platforms, flavor, dir, done);
}
if (platforms.indexOf('armv7') !== -1) {
if (platforms.indexOf('linux32') !== -1) {
console.log('Cannot build ARMv7 and Linux32 versions at the same time!');
clean_debug();
process.exit(1);
}
removeItem(platforms, 'armv7');
platforms.push('linux32');
if (!fs.existsSync('./cache/_ARMv7_IS_CACHED', 'w')) {
console.log('Purging cache because it needs to be overwritten...');
clean_cache().then(() => {
injectARMCache(flavor, buildNWAppsCallback);
2020-10-15 14:28:32 +00:00
});
2018-05-13 19:00:56 +00:00
} else {
buildNWAppsCallback();
}
} else {
if (platforms.indexOf('linux32') !== -1 && fs.existsSync('./cache/_ARMv7_IS_CACHED')) {
console.log('Purging cache because it was previously overwritten...');
clean_cache().then(buildNWAppsCallback);
} else {
buildNWAppsCallback();
}
}
}
function buildNWApps(platforms, flavor, dir, done) {
2018-01-08 10:37:32 +00:00
if (platforms.length > 0) {
2020-10-15 14:28:32 +00:00
const builder = new NwBuilder(Object.assign({
2018-01-10 14:36:12 +00:00
buildDir: dir,
2020-10-15 14:28:32 +00:00
platforms,
flavor,
2018-01-09 00:44:13 +00:00
}, nwBuilderOptions));
2018-01-08 10:37:32 +00:00
builder.on('log', console.log);
builder.build(function (err) {
if (err) {
2020-10-15 14:28:32 +00:00
console.log(`Error building NW apps: ${err}`);
2018-01-10 14:36:12 +00:00
clean_debug();
process.exit(1);
2018-01-08 10:37:32 +00:00
}
done();
});
} else {
2020-10-15 14:28:32 +00:00
console.log('No platform suitable for NW Build');
done();
2018-01-08 10:37:32 +00:00
}
2018-01-10 14:36:12 +00:00
}
function getGitRevision(done, callback, isReleaseBuild) {
let gitRevision = 'norevision';
git.diff([ '--shortstat' ], function (err1, diff) {
if (!err1 && !diff) {
git.log([ '-1', '--pretty=format:%h' ], function (err2, rev) {
if (!err2) {
gitRevision = rev.latest.hash;
}
callback(done, gitRevision, isReleaseBuild);
});
} else {
callback(done, gitRevision, isReleaseBuild);
}
2018-08-12 08:19:02 +00:00
});
}
2018-01-10 14:36:12 +00:00
function start_debug(done) {
2020-10-15 14:28:32 +00:00
const platforms = getPlatforms();
2018-01-10 14:36:12 +00:00
if (platforms.length === 1) {
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
if (platforms[0] === 'android') {
cordova_debug();
} else {
2020-10-15 14:28:32 +00:00
const run = getRunDebugAppCommand(platforms[0]);
console.log(`Starting debug app (${run})...`);
2020-11-28 11:14:40 +00:00
child_process.exec(run);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}
2018-01-10 14:36:12 +00:00
} else {
console.log('More than one platform specified, not starting debug app');
}
done();
}
// Create installer package for windows platforms
function release_win(arch, appDirectory, done) {
// Parameters passed to the installer script
2020-06-30 13:10:22 +00:00
const parameters = [];
// Extra parameters to replace inside the iss file
parameters.push(`/Dversion=${metadata.version}`);
2020-06-30 13:10:22 +00:00
parameters.push(`/DarchName=${arch}`);
parameters.push(`/DarchAllowed=${(arch === 'win32') ? 'x86 x64' : 'x64'}`);
parameters.push(`/DarchInstallIn64bit=${(arch === 'win32') ? '' : 'x64'}`);
parameters.push(`/DsourceFolder=${appDirectory}`);
parameters.push(`/DtargetFolder=${RELEASE_DIR}`);
// Show only errors in console
parameters.push(`/Q`);
// Script file to execute
parameters.push("assets/windows/installer.iss");
innoSetup(parameters, {},
function(error) {
if (error != null) {
console.error(`Installer for platform ${arch} finished with error ${error}`);
} else {
console.log(`Installer for platform ${arch} finished`);
}
2020-06-30 13:10:22 +00:00
done();
});
}
// Create distribution package (zip) for windows and linux platforms
function release_zip(arch, appDirectory) {
const src = path.join(appDirectory, metadata.name, arch, '**');
2022-01-04 13:52:22 +00:00
const output = getReleaseFilename(arch, 'zip', true);
const base = path.join(appDirectory, metadata.name, arch);
2018-01-10 14:36:12 +00:00
return compressFiles(src, base, output, 'Betaflight Configurator');
}
// 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);
}))
2018-01-10 14:36:12 +00:00
.pipe(zip(outputFile))
.pipe(gulp.dest(RELEASE_DIR));
2018-01-05 17:58:27 +00:00
}
function release_deb(arch, appDirectory, done) {
2018-01-10 14:36:12 +00:00
2018-01-29 15:14:24 +00:00
// Check if dpkg-deb exists
if (!commandExistsSync('dpkg-deb')) {
2020-10-15 14:28:32 +00:00
console.warn(`dpkg-deb command not found, not generating deb package for ${arch}`);
done();
2018-01-05 17:58:27 +00:00
}
return gulp.src([path.join(appDirectory, metadata.name, arch, '*')])
2018-01-05 17:58:27 +00:00
.pipe(deb({
package: metadata.name,
version: metadata.version,
2020-10-15 14:28:32 +00:00
section: 'base',
priority: 'optional',
architecture: getLinuxPackageArch('deb', arch),
maintainer: metadata.author,
description: metadata.description,
preinst: [`rm -rf ${LINUX_INSTALL_DIR}/${metadata.name}`],
2020-10-15 14:28:32 +00:00
postinst: [
`chown root:root ${LINUX_INSTALL_DIR}`,
`chown -R root:root ${LINUX_INSTALL_DIR}/${metadata.name}`,
`xdg-desktop-menu install ${LINUX_INSTALL_DIR}/${metadata.name}/${metadata.name}.desktop`,
2020-10-15 14:28:32 +00:00
],
prerm: [`xdg-desktop-menu uninstall ${metadata.name}.desktop`],
2020-10-15 14:28:32 +00:00
depends: 'libgconf-2-4',
changelog: [],
_target: `${LINUX_INSTALL_DIR}/${metadata.name}`,
2020-10-15 14:28:32 +00:00
_out: RELEASE_DIR,
_copyright: 'assets/linux/copyright',
_clean: true,
2018-01-05 17:58:27 +00:00
}));
}
function release_rpm(arch, appDirectory, done) {
2018-01-29 15:14:24 +00:00
// Check if dpkg-deb exists
if (!commandExistsSync('rpmbuild')) {
2020-10-15 14:28:32 +00:00
console.warn(`rpmbuild command not found, not generating rpm package for ${arch}`);
done();
2018-01-29 15:14:24 +00:00
}
2018-02-02 19:23:09 +00:00
// The buildRpm does not generate the folder correctly, manually
2018-01-29 15:14:24 +00:00
createDirIfNotExists(RELEASE_DIR);
2020-10-15 14:28:32 +00:00
const options = {
name: metadata.name,
version: metadata.version.replace(NAME_REGEX, '_'), // RPM does not like release candidate versions
2020-10-15 14:28:32 +00:00
buildArch: getLinuxPackageArch('rpm', arch),
vendor: metadata.author,
summary: metadata.description,
2020-10-15 14:28:32 +00:00
license: 'GNU General Public License v3.0',
requires: 'libgconf-2-4',
prefix: '/opt',
files: [{
cwd: path.join(appDirectory, metadata.name, arch),
2020-10-15 14:28:32 +00:00
src: '*',
dest: `${LINUX_INSTALL_DIR}/${metadata.name}`,
2020-10-15 14:28:32 +00:00
}],
postInstallScript: [`xdg-desktop-menu install ${LINUX_INSTALL_DIR}/${metadata.name}/${metadata.name}.desktop`],
preUninstallScript: [`xdg-desktop-menu uninstall ${metadata.name}.desktop`],
2020-10-15 14:28:32 +00:00
tempDir: path.join(RELEASE_DIR, `tmp-rpm-build-${arch}`),
keepTemp: false,
verbose: false,
rpmDest: RELEASE_DIR,
execOpts: { maxBuffer: 1024 * 1024 * 16 },
2018-01-29 15:14:24 +00:00
};
2020-10-15 14:28:32 +00:00
buildRpm(options, function(err) {
2018-01-29 15:14:24 +00:00
if (err) {
2020-10-15 14:28:32 +00:00
console.error(`Error generating rpm package: ${err}`);
2018-01-29 15:14:24 +00:00
}
done();
});
}
function getLinuxPackageArch(type, arch) {
2020-10-15 14:28:32 +00:00
let packArch;
2018-01-29 15:14:24 +00:00
switch (arch) {
case 'linux32':
packArch = 'i386';
break;
case 'linux64':
2020-10-15 14:28:32 +00:00
if (type === 'rpm') {
2018-01-29 15:14:24 +00:00
packArch = 'x86_64';
} else {
packArch = 'amd64';
}
break;
default:
2020-10-15 14:28:32 +00:00
console.error(`Package error, arch: ${arch}`);
2018-01-29 15:14:24 +00:00
process.exit(1);
break;
}
return packArch;
}
// Create distribution package for macOS platform
function release_osx64(appDirectory) {
2021-12-17 17:38:53 +00:00
const appdmg = require('./gulp-appdmg');
2018-01-17 15:38:41 +00:00
// The appdmg does not generate the folder correctly, manually
createDirIfNotExists(RELEASE_DIR);
// The src pipe is not used
return gulp.src(['.'])
.pipe(appdmg({
2018-01-10 14:36:12 +00:00
target: path.join(RELEASE_DIR, getReleaseFilename('macOS', 'dmg')),
basepath: path.join(appDirectory, metadata.name, 'osx64'),
specification: {
title: 'Betaflight Configurator',
contents: [
{ 'x': 448, 'y': 342, 'type': 'link', 'path': '/Applications' },
{ 'x': 192, 'y': 344, 'type': 'file', 'path': `${metadata.name}.app`, 'name': 'Betaflight Configurator.app' },
],
2018-01-21 16:09:36 +00:00
background: path.join(__dirname, 'assets/osx/dmg-background.png'),
format: 'UDZO',
window: {
size: {
width: 638,
2020-10-15 14:28:32 +00:00
height: 479,
},
},
2017-11-25 07:47:32 +00:00
},
}),
);
}
2018-01-17 15:38:41 +00:00
// Create the dir directory, with write permissions
function createDirIfNotExists(dir) {
fs.mkdir(dir, '0775', function(err) {
2020-10-15 14:28:32 +00:00
if (err && err.code !== 'EEXIST') {
throw err;
2018-01-17 15:38:41 +00:00
}
});
}
2018-01-10 14:36:12 +00:00
// Create a list of the gulp tasks to execute for release
function listReleaseTasks(isReleaseBuild, appDirectory) {
2020-10-15 14:28:32 +00:00
const platforms = getPlatforms();
2020-10-15 14:28:32 +00:00
const releaseTasks = [];
2018-01-10 14:36:12 +00:00
if (platforms.indexOf('linux64') !== -1) {
releaseTasks.push(function release_linux64_zip() {
return release_zip('linux64', appDirectory);
});
releaseTasks.push(function release_linux64_deb(done) {
return release_deb('linux64', appDirectory, done);
});
releaseTasks.push(function release_linux64_rpm(done) {
return release_rpm('linux64', appDirectory, done);
});
2017-11-25 03:38:26 +00:00
}
if (platforms.indexOf('linux32') !== -1) {
releaseTasks.push(function release_linux32_zip() {
return release_zip('linux32', appDirectory);
});
releaseTasks.push(function release_linux32_deb(done) {
return release_deb('linux32', appDirectory, done);
});
releaseTasks.push(function release_linux32_rpm(done) {
return release_rpm('linux32', appDirectory, done);
});
}
2018-01-10 14:36:12 +00:00
2018-05-13 19:00:56 +00:00
if (platforms.indexOf('armv7') !== -1) {
releaseTasks.push(function release_armv7_zip() {
return release_zip('armv7', appDirectory);
});
2018-05-13 19:00:56 +00:00
}
2017-11-25 03:38:26 +00:00
if (platforms.indexOf('osx64') !== -1) {
releaseTasks.push(function () {
return release_osx64(appDirectory);
});
2017-11-25 03:38:26 +00:00
}
if (platforms.indexOf('win32') !== -1) {
2022-01-04 13:52:22 +00:00
releaseTasks.push(function release_win32_zip() {
return release_zip('win32', appDirectory);
});
releaseTasks.push(function release_win32(done) {
return release_win('win32', appDirectory, done);
});
}
2018-01-29 15:14:24 +00:00
if (platforms.indexOf('win64') !== -1) {
2022-01-04 13:52:22 +00:00
releaseTasks.push(function release_win64_zip() {
return release_zip('win64', appDirectory);
});
releaseTasks.push(function release_win64(done) {
return release_win('win64', appDirectory, done);
});
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
if (platforms.indexOf('android') !== -1) {
releaseTasks.push(function release_android() {
if (isReleaseBuild) {
return cordova_release();
} else {
return cordova_debug_release();
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
});
}
2018-01-10 14:36:12 +00:00
return releaseTasks;
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
// Cordova
function cordova_dist() {
const distTasks = [];
const platforms = getPlatforms();
if (platforms.indexOf('android') !== -1) {
distTasks.push(clean_cordova);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
distTasks.push(cordova_copy_www);
distTasks.push(cordova_resources);
distTasks.push(cordova_include_www);
distTasks.push(cordova_copy_src);
distTasks.push(cordova_rename_src_config);
distTasks.push(cordova_rename_src_package);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
distTasks.push(cordova_packagejson);
distTasks.push(cordova_manifestjson);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
distTasks.push(cordova_configxml);
distTasks.push(cordova_rename_build_json);
2020-10-26 19:17:30 +00:00
distTasks.push(cordova_browserify);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
distTasks.push(cordova_depedencies);
if (cordovaDependencies) {
distTasks.push(cordova_platforms);
}
} else {
distTasks.push(function cordova_dist_none(done) {
done();
});
}
return distTasks;
}
function cordova_apps(isReleaseBuild) {
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
const appsTasks = [];
const platforms = getPlatforms();
if (platforms.indexOf('android') !== -1) {
if (isReleaseBuild) {
appsTasks.push(cordova_build);
} else {
appsTasks.push(cordova_debug_build);
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
} else {
appsTasks.push(function cordova_dist_none(done) {
done();
});
}
return appsTasks;
}
function clean_cordova() {
const patterns = [];
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
if (cordovaDependencies) {
patterns.push(`${CORDOVA_DIST_DIR}**`);
} else {
patterns.push(`${CORDOVA_DIST_DIR}www/**`);
patterns.push(`${CORDOVA_DIST_DIR}resources/**`);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}
return del(patterns, { force: true });
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_copy_www() {
return gulp.src(`${DIST_DIR}**`, { base: DIST_DIR })
.pipe(gulp.dest(`${CORDOVA_DIST_DIR}www/`));
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_resources() {
return gulp.src('assets/android/**')
.pipe(gulp.dest(`${CORDOVA_DIST_DIR}resources/android/`));
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_include_www() {
return gulp.src(`${CORDOVA_DIST_DIR}www/main.html`)
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
.pipe(replace('<!-- CORDOVA_INCLUDE js/cordova_chromeapi.js -->', '<script type="text/javascript" src="./js/cordova_chromeapi.js"></script>'))
.pipe(replace('<!-- CORDOVA_INCLUDE js/cordova_startup.js -->', '<script type="text/javascript" src="./js/cordova_startup.js"></script>'))
.pipe(replace('<!-- CORDOVA_INCLUDE cordova.js -->', '<script type="text/javascript" src="cordova.js"></script>'))
.pipe(gulp.dest(`${CORDOVA_DIST_DIR}www`));
}
function cordova_copy_src() {
return gulp.src([`${CORDOVA_DIR}**`, `!${CORDOVA_DIR}config_template.xml`, `!${CORDOVA_DIR}package_template.json`, `!${CORDOVA_DIR}build_template.json`])
.pipe(gulp.dest(`${CORDOVA_DIST_DIR}`));
}
function cordova_rename_src_config() {
return gulp.src(`${CORDOVA_DIR}config_template.xml`)
.pipe(rename('config.xml'))
.pipe(gulp.dest(`${CORDOVA_DIST_DIR}`));
}
function cordova_rename_src_package() {
return gulp.src(`${CORDOVA_DIR}package_template.json`)
.pipe(rename('package.json'))
.pipe(gulp.dest(`${CORDOVA_DIST_DIR}`));
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_packagejson() {
return gulp.src(`${CORDOVA_DIST_DIR}package.json`)
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
.pipe(jeditor({
'name': metadata.name,
'description': metadata.description,
'version': metadata.version,
'author': metadata.author,
'license': metadata.license,
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}))
.pipe(gulp.dest(CORDOVA_DIST_DIR))
.pipe(rename('manifest.json'))
.pipe(gulp.dest(CORDOVA_DIST_DIR));
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}
// Required to make getManifest() work in cordova
function cordova_manifestjson() {
return gulp.src(`${DIST_DIR}package.json`)
.pipe(rename('manifest.json'))
.pipe(gulp.dest(CORDOVA_DIST_DIR));
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_configxml() {
const androidName = metadata.packageId.replace(NAME_REGEX, '_');
return gulp.src([`${CORDOVA_DIST_DIR}config.xml`])
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
.pipe(xmlTransformer([
{ path: '//xmlns:name', text: metadata.productName },
{ path: '//xmlns:description', text: metadata.description },
{ path: '//xmlns:author', text: metadata.author },
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
], 'http://www.w3.org/ns/widgets'))
.pipe(xmlTransformer([
{ path: '.', attr: { 'id': `com.betaflight.${androidName}` } },
{ path: '.', attr: { 'version': metadata.storeVersion ? metadata.storeVersion : metadata.version } },
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
]))
.pipe(gulp.dest(CORDOVA_DIST_DIR));
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
}
function cordova_rename_build_json() {
return gulp.src(`${CORDOVA_DIR}build_template.json`)
.pipe(rename('build.json'))
.pipe(gulp.dest(CORDOVA_DIST_DIR));
}
function cordova_browserify(done) {
2020-10-26 19:17:30 +00:00
const readFile = function(file) {
return new Promise(function(resolve) {
if (!file.includes("node_modules")) {
fs.readFile(file, 'utf8', async function (err,data) {
if (data.match('require\\(.*\\)')) {
2020-10-26 19:34:54 +00:00
await cordova_execbrowserify(file);
2020-10-26 19:17:30 +00:00
}
resolve();
});
} else {
resolve();
}
});
2020-10-26 19:34:54 +00:00
};
2020-10-26 19:17:30 +00:00
glob(`${CORDOVA_DIST_DIR}www/**/*.js`, {}, function (err, files) {
2020-10-26 19:34:54 +00:00
const readLoop = function() {
2020-10-26 19:17:30 +00:00
if (files.length === 0) {
done();
2020-10-26 19:17:30 +00:00
} else {
const file = files.pop();
readFile(file).then(function() {
2020-10-26 19:34:54 +00:00
readLoop();
2020-10-26 19:17:30 +00:00
});
}
};
2020-10-26 19:34:54 +00:00
readLoop();
2020-10-26 19:17:30 +00:00
});
}
2020-10-26 19:17:30 +00:00
function cordova_execbrowserify(file) {
const filename = file.split('/').pop();
const destpath = file.replace(filename, '');
console.log(`Include required modules in ${file}`);
return browserify(file, { ignoreMissing: true })
.bundle()
.pipe(source(filename))
.pipe(gulp.dest(destpath));
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_depedencies() {
process.chdir(CORDOVA_DIST_DIR);
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
return gulp.src(['./package.json', './yarn.lock'])
.pipe(gulp.dest('./'))
.pipe(yarn({
production: true,
}));
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_platforms() {
return cordova.platform('add', ['android']);
}
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
function cordova_debug() {
cordova.run();
}
function cordova_debug_build(done) {
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
cordova.build({
'platforms': ['android'],
'options': {
release: false,
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
buildConfig: 'build.json',
},
}).then(function() {
process.chdir('../');
console.log(`APK has been generated at ${CORDOVA_DIST_DIR}platforms/android/app/build/outputs/apk/release/app-release.apk`);
done();
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
});
}
function cordova_build(done) {
let storePassword = '';
return gulp.series(function password_prompt() {
return gulp.src('.')
.pipe(prompt.prompt({
type: 'password',
name: 'storePassword',
message: 'Please enter the keystore password:',
}, function(res) {
storePassword = res.storePassword;
}));
}, function set_password() {
return gulp.src(`build.json`)
.pipe(jeditor({
'android': {
'release' : {
'storePassword': storePassword,
},
},
}))
.pipe(gulp.dest('./'));
}, function build(done2) {
return cordova.build({
'platforms': ['android'],
'options': {
release: true,
buildConfig: 'build.json',
},
}).then(function() {
// Delete the file containing the store password
del(['build.json'], { force: true });
process.chdir('../');
console.log('AAB has been generated at dist_cordova/platforms/android/app/build/outputs/bundle/release/app.aab');
done2();
});
})(done);
}
async function cordova_debug_release() {
const filename = getReleaseFilename('android', 'apk');
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
console.log(`Release APK : release/${filename}`);
return gulp.src(`${CORDOVA_DIST_DIR}platforms/android/app/build/outputs/apk/debug/app-debug.apk`)
.pipe(rename(filename))
.pipe(gulp.dest(RELEASE_DIR));
}
async function cordova_release() {
const filename = getReleaseFilename('android', 'aab');
console.log(`Release AAB : release/${filename}`);
return gulp.src(`${CORDOVA_DIST_DIR}platforms/android/app/build/outputs/bundle/release/app.aab`)
Cordova framework integration, Android support, mobile UI & options tab Cordova integration and android platform : - Added cordova directory with required config - Added cordova applications generation in gulpfile - Added cordova development instructions - Used cordova plugins to simulate missing chrome api plugins (chrome.serial and chrome.fileSystem) - Added cordova clipboard support - Added android operating system and Cordova gui mode - Fixed some css and js files to make them working on Android as well as on computers - Added --skipdep argument to accelerate cordova build (gulp task) - Added a webview helper to help people to update the webview app of their device New options tab : - Added options tab replacing the options dropdown - Added option to switch between phones UI and computers UI Mobile interface and global interface improvements : - Simplified the structure of the header with flex css - Made headerbar and tab container responsive (compact headerbar and side menu) - All tabs are adapted to mobile interface (except firmware flasher) - The servos and adjustments tabs are not fully adapted but are "usable" - Improved header bar animation - Improved log expandation animation - Added swipe gesture to toggle side menu Fixes during the development : - Logo position - Dark mode - Auto connection - Error messages (cordova_chromeapi.js) - Responsive grid - Testing - Disconnection - Width of boxes inside the OSD tab - Fixed cli tab - OSD tab - Motor stop switch - White spaces in boxes - Dialogs size - Connect button state - Prevent tablet with a height larger than 575px to switch to computers ui - Fixed logging tab - Fixed code smell - Fixed yarn cordova plugin install issue - Fixed content_wrapper - Fixed vibrations when scrolling - Fixed scrolling bar alignment - Fixed dialogReportProblem height - Fixed rates logo - Fixed auto connection default value (true) - Fixed D to D max - Fixed dialogs Added required messages in locales/en/messages.json file Requested changes
2020-07-03 14:18:55 +00:00
.pipe(rename(filename))
.pipe(gulp.dest(RELEASE_DIR));
}