Skip to content
Snippets Groups Projects
Commit 5eb7ef3c authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Upgrade to recent ionic-cli, to be able to compile using nodejs v10

parent 03736678
No related branches found
No related tags found
No related merge requests found
Pipeline #7515 failed
Showing
with 1430 additions and 5147 deletions
......@@ -38,6 +38,7 @@
/www/css/leaflet.app.min.css
/www/img/layers*.png
/www/img/marker*.png
/www/img/search-icon.png
/npm-debug.log
/package-lock.json
......
This diff is collapsed.
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var gutil = require('gulp-util');
var path = require("path");
var cmd = process.env.CORDOVA_CMDLINE;
var rootdir = process.argv[2];
var argv = require('yargs').argv;
var skip = true;
if (/*cmd.indexOf("--release") > -1 || */cmd.indexOf("--playstore") > -1) {
skip = false;
}
if (rootdir && !skip) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
var platformRoot = path.join(rootdir, 'platforms', platform);
// Deploy for Android
if(platform == 'android') {
var apkFileLocation = path.join(platformRoot, 'build/outputs/apk/android-release.apk');
console.log('Publishing APK file [' + apkFileLocation + '] to playstore...');
var config = require('../playstore-config.json');
if(!config) {
gutil.log(gutil.colors.red("ERROR => Could not load `hooks/playstore-config.json` file!"));
return;
}
if(!config.client_email || !config.private_key) {
gutil.log(gutil.colors.red("ERROR => Could not found 'client_email' or 'private_key' in 'hooks/playstore-config.json' file."));
return;
}
var publisher = require('playup')(config);
publisher.upload(apkFileLocation,
{
track: 'production',
recentChanges: {
'fr-FR': 'New stable release'
}
})
.then(function (data) {
console.log(' > APK file successfully deployed to Playstore !');
})
.catch(function(err) {
console.log('ERROR while publsihing to playtore: \n' + err);
})
}
else {
// TODO : deploy other for platforms
}
}
}
......@@ -8,20 +8,20 @@
// rendering the correct layout/style for the specific platform
// instead of waiting for the JS to figure out the correct classes.
var fs = require('fs');
var path = require('path');
const fs = require('fs');
const path = require('path');
var rootdir = process.argv[2];
const rootdir = process.argv[2];
function addPlatformBodyTag(indexPath, platform) {
// add the platform class to the body tag
try {
var platformClass = 'platform-' + platform;
var cordovaClass = 'platform-cordova platform-webview';
const platformClass = 'platform-' + platform;
const cordovaClass = 'platform-cordova platform-webview';
var html = fs.readFileSync(indexPath, 'utf8');
let html = fs.readFileSync(indexPath, 'utf8');
var bodyTag = findBodyTag(html);
const bodyTag = findBodyTag(html);
if(!bodyTag) return; // no opening body tag, something's wrong
if(bodyTag.indexOf(platformClass) > -1) return; // already added
......
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var removeCode = require('gulp-remove-code');
var removeHtml = require('gulp-html-remove');
var es = require('event-stream');
var ngAnnotate = require('gulp-ng-annotate');
var htmlmin = require('gulp-htmlmin');
const gulp = require('gulp');
const path = require("path");
const removeCode = require('gulp-remove-code');
const removeHtml = require('gulp-html-remove');
const es = require('event-stream');
const ngAnnotate = require('gulp-ng-annotate');
const htmlmin = require('gulp-htmlmin');
const merge = require('merge2');
var rootdir = process.argv[2];
const rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
const platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
for(let x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
let platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
let wwwPath;
if(platform === 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
......@@ -32,15 +33,15 @@ if (rootdir) {
//console.log('['+process.mainModule.filename+'] Removing code for platform '+platform+'\n');
// Compute options {device-<platform>: true}
var platformRemoveCodeOptions = {};
let platformRemoveCodeOptions = {};
platformRemoveCodeOptions[platform] = true; // = {<platform>: true}
var htmlminOptions = {removeComments: true, collapseWhitespace: true};
let htmlminOptions = {removeComments: true, collapseWhitespace: true};
// Do not remove desktop code for iOS and macOS (support for tablets and desktop macs)
if (platform !== 'ios' && platform !== 'osx') {
// Removing unused code for device...
es.concat(
merge(
// Remove unused HTML tags
gulp.src(path.join(wwwPath, 'templates', '**', '*.html'))
.pipe(removeCode({device: true}))
......@@ -83,7 +84,7 @@ if (rootdir) {
.pipe(gulp.dest(wwwPath + '/dist/dist_js/plugins'))
);
} else {
es.concat(
merge(
gulp.src(path.join(wwwPath, 'templates', '**', '*.html'))
.pipe(htmlmin(htmlminOptions))
.pipe(gulp.dest(wwwPath + '/templates')),
......
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var templateCache = require('gulp-angular-templatecache');
var es = require('event-stream');
var rootdir = process.argv[2];
const gulp = require('gulp');
const path = require("path");
const templateCache = require('gulp-angular-templatecache');
const merge = require('merge2');
const rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
const platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
for(let x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
let platform = platforms[x].trim().toLowerCase();
var wwwPath;
let wwwPath;
if(platform == 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
var distJsPath = path.join(wwwPath, 'dist', 'dist_js', 'app');
var pluginDistJsPath = path.join(wwwPath, 'dist', 'dist_js', 'plugins');
let distJsPath = path.join(wwwPath, 'dist', 'dist_js', 'app');
let pluginDistJsPath = path.join(wwwPath, 'dist', 'dist_js', 'plugins');
// Concat templates into a JS
es.concat(
merge(
gulp.src(path.join(wwwPath, 'templates', '**', '*.html'))
.pipe(templateCache({
standalone:true,
......
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var es = require('event-stream');
var rootdir = process.argv[2];
var ngTranslate = require('gulp-angular-translate');
const gulp = require('gulp');
const path = require("path");
const merge = require('merge2');
const rootdir = process.argv[2];
const ngTranslate = require('gulp-angular-translate');
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
const platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
for(let x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
let platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
let wwwPath;
if(platform === 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
var distJsPath = path.join(wwwPath, 'dist', 'dist_js', 'app');
var pluginDistJsPath = path.join(wwwPath, 'dist', 'dist_js', 'plugins');
let distJsPath = path.join(wwwPath, 'dist', 'dist_js', 'app');
let pluginDistJsPath = path.join(wwwPath, 'dist', 'dist_js', 'plugins');
// Concat templates into a JS
es.concat(
merge(
gulp.src(wwwPath + '/i18n/locale-*.json')
.pipe(ngTranslate({standalone:true, module: 'cesium.translations'}))
.pipe(gulp.dest(distJsPath)),
......
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var es = require('event-stream');
var useref = require('gulp-useref');
var filter = require('gulp-filter');
var uglify = require('gulp-uglify');
var csso = require('gulp-csso');
var rev = require('gulp-rev');
var revReplace = require('gulp-rev-replace');
var cmd = process.env.CORDOVA_CMDLINE;
var rootdir = process.argv[2];
var skip = true;
const gulp = require('gulp');
const path = require("path");
const es = require('event-stream');
const useref = require('gulp-useref');
const filter = require('gulp-filter');
const uglify = require('gulp-uglify');
const csso = require('gulp-csso');
const rev = require('gulp-rev');
const revReplace = require('gulp-rev-replace');
const cmd = process.env.CORDOVA_CMDLINE;
const rootdir = process.argv[2];
let skip = true;
if (cmd.indexOf("--release") > -1 || cmd.indexOf("--useref") > -1) {
skip = false;
}
......@@ -21,32 +21,45 @@ if (cmd.indexOf("--release") > -1 || cmd.indexOf("--useref") > -1) {
if (rootdir && !skip) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
const platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
for(let x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
let platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
let wwwPath;
if(platform === 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
var indexPath = path.join(wwwPath, 'index.html');
let indexPath = path.join(wwwPath, 'index.html');
var jsFilter = filter(["**/*.js", "!**/vendor/*", '!**/config.js'], { restore: true });
var cssFilter = filter("**/*.css", { restore: true });
var revFilesFilter = filter(['**/*', '!**/index.html', '!**/config.js'], { restore: true });
var uglifyOptions = {beautify: false};
const jsFilter = filter(["**/*.js", "!**/vendor/*", '!**/config.js'], { restore: true });
const cssFilter = filter("**/*.css", { restore: true });
const revFilesFilter = filter(['**/*', '!**/index.html', '!**/config.js'], { restore: true });
const uglifyOptions = {
toplevel: true,
compress: {
global_defs: {
"@console.log": "alert"
},
passes: 2
},
output: {
beautify: false,
preamble: "/* uglified */",
max_line_len: 120000
}
};
// Removing unused code for device...
es.concat(
gulp.src(indexPath)
.pipe(useref()) // Concatenate with gulp-useref
.pipe(jsFilter)
.pipe(uglify(uglifyOptions)) // Minify any javascript sources
.pipe(uglify(uglifyOptions.output)) // Minify any javascript sources
.pipe(jsFilter.restore)
.pipe(cssFilter)
.pipe(csso()) // Minify any CSS sources
......
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var del = require('del');
const gulp = require('gulp');
const path = require("path");
const del = require('del');
var cmd = process.env.CORDOVA_CMDLINE;
var rootdir = process.argv[2];
const cmd = process.env.CORDOVA_CMDLINE;
const rootdir = process.argv[2];
var skip = true;
let skip = true;
if (cmd.indexOf("--release") > -1 || cmd.indexOf("--useref") > -1) {
skip = false;
}
......@@ -15,13 +15,13 @@ if (cmd.indexOf("--release") > -1 || cmd.indexOf("--useref") > -1) {
if (rootdir && !skip) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
const platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
for(let x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
let platform = platforms[x].trim().toLowerCase();
var wwwPath;
let wwwPath;
if(platform === 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
......@@ -29,7 +29,7 @@ if (rootdir && !skip) {
}
// Log
//console.log('['+process.mainModule.filename+'] Cleaning unused directories');
console.log('['+process.mainModule.filename+'] Cleaning unused directories');
// Clean unused directories
del.sync([
......
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var replace = require('gulp-replace');
const gulp = require('gulp');
const path = require("path");
const replace = require('gulp-replace');
var rootdir = process.argv[2];
const rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
const platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
for(let x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
let platform = platforms[x].trim().toLowerCase();
if(platform == 'android') {
var platformPath = path.join(rootdir, 'platforms', platform);
var androidManifestFile = path.join(platformPath, 'AndroidManifest.xml');
let platformPath = path.join(rootdir, 'platforms', platform);
let androidManifestFile = path.join(platformPath, 'AndroidManifest.xml');
// Clean unused directories
console.log('-----------------------------------------');
......
......@@ -21,7 +21,7 @@ foldersToProcess.forEach(function(folder) {
});
function processFiles(dir, callback) {
var errorCount = 0;
let errorCount = 0;
fs.readdir(dir, function(err, list) {
if (err) {
console.log('processFiles err: ' + err);
......
{
"name": "Cesium",
"watchPatterns": [
"www/dist/**/*",
"www/css/*.css"
],
"defaultBrowser": "chrome",
"browsers": [
{
"platform": "android",
"browser": "crosswalk",
"version": "12.41.296.5"
}
],
"integrations": {
"cordova": {}
}
}
......@@ -81,37 +81,38 @@
"cordova-clipboard": "^1.3.0",
"cordova-ios": "git+https://github.com/bpresles/cordova-ios.git#5.1.0",
"cordova-osx": "^5.0.0",
"cordova-plugin-camera": "^2.4.1",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-crosswalk-webview": "^2.3.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-dialogs": "^1.3.4",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.2",
"cordova-plugin-minisodium": "git+https://github.com/E-IS/cordova-plugin-minisodium.git",
"cordova-plugin-secure-storage": "^2.6.8",
"cordova-plugin-splashscreen": "^3.2.2",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-minisodium": "^1.0.0",
"cordova-plugin-secure-storage": "^3.0.2",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-vibration": "^2.1.6",
"cordova-plugin-vibration": "^3.1.1",
"cordova-plugin-websocket": "^0.12.2",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-toast": "^2.7.2",
"ionic-plugin-keyboard": "^2.2.1",
"phonegap-plugin-barcodescanner": "8.1.0"
"phonegap-plugin-barcodescanner": "^8.1.0"
},
"devDependencies": {
"@ionic/v1-toolkit": "2.0.18",
"bower": "^1.8.8",
"cordova-uglify": "^0.2.9",
"cordova-uglify": "^0.3.4",
"del": "^3.0.0",
"delete-empty": "^0.1.3",
"event-stream": "3.3.4",
"glob": "^5.0.15",
"graceful-fs": "^4.2.3",
"gulp": "^3.9.1",
"gulp-angular-templatecache": "^1.8.0",
"gulp-angular-templatecache": "^2.2.7",
"gulp-angular-translate": "^0.1.4",
"gulp-base64": "^0.1.3",
"gulp-base64-v2": "^1.0.4",
"gulp-bump": "^2.1.0",
"gulp-clean": "^0.3.2",
"gulp-clean-css": "^3.7.0",
......@@ -131,19 +132,22 @@
"gulp-replace": "^0.5.4",
"gulp-rev": "^7.0.0",
"gulp-rev-replace": "^0.4.3",
"gulp-sass": "^3.1.0",
"gulp-sass": "^4.0.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^2.0.0",
"gulp-uglify": "^2.1.0",
"gulp-useref": "^3.1.0",
"gulp-wait": "^0.0.2",
"gulp-zip": "^3.2.0",
"ionic": "^1.7.16",
"ionic-minify": "^2.0.10",
"jshint": "^2.9.2",
"ionic": "^5.4.13",
"jshint": "^2.10.3",
"merge2": "^1.3.0",
"mv": "^2.1.1",
"node-sass": "^3.13.1",
"playup": "^1.0.2",
"yargs": "^4.8.1"
"node-sass": "^4.13.0",
"playup": "^1.1.0",
"vinyl-fs": "^3.0.3",
"yargs": "^5.0.0"
},
"peerDependencies": {
"nopt": "4.0.1"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
......@@ -159,10 +163,7 @@
"cordova-plugin-secure-storage",
"cordova-plugin-x-toast",
"cordova-clipboard",
{
"id": "cordova-plugin-minisodium",
"locator": "https://github.com/E-IS/cordova-plugin-minisodium.git"
},
"cordova-plugin-minisodium",
"phonegap-plugin-barcodescanner",
"cordova-plugin-ionic-keyboard",
"cordova-plugin-ionic-webview@4.1.2"
......
This diff is collapsed.
......@@ -94,7 +94,7 @@ angular.module("cesium.config", [])
}
},
"version": "1.4.14",
"build": "2019-12-26T15:40:25.051Z",
"build": "2019-12-27T17:16:01.678Z",
"newIssueUrl": "https://git.duniter.org/clients/cesium-grp/cesium/issues/new"
})
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment