From 841da05905c08da41ac9443eb1aa1179c9af6673 Mon Sep 17 00:00:00 2001 From: Bertrand PRESLES <bertrand.presles@niji.fr> Date: Mon, 28 Oct 2019 16:20:55 +0100 Subject: [PATCH] Bumped version number to 1.4.8. Updated remove_code script to still remove comments and inject ng annotation for OS X and iOS --- config.xml | 2 +- hooks/after_prepare/020_remove_code.js | 114 ++++++++++++++----------- install.sh | 2 +- package.json | 2 +- www/js/config.js | 4 +- www/manifest.json | 2 +- 6 files changed, 72 insertions(+), 54 deletions(-) diff --git a/config.xml b/config.xml index 40efb145c..2b13e4c86 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-versionCode="104007" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.4.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="104008" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.4.8" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>Cesium</name> <description> An simple App for Duniter wallet diff --git a/hooks/after_prepare/020_remove_code.js b/hooks/after_prepare/020_remove_code.js index 4aa2e5a99..081452459 100755 --- a/hooks/after_prepare/020_remove_code.js +++ b/hooks/after_prepare/020_remove_code.js @@ -19,11 +19,6 @@ if (rootdir) { var platform = platforms[x].trim().toLowerCase(); - // Do not remove desktop code for iOS and macOS (support for tablets and desktop macs) - if (platform === 'ios' || platform === 'osx') { - continue; - } - var wwwPath; if(platform == 'android') { wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www'); @@ -42,49 +37,72 @@ if (rootdir) { var htmlminOptions = {removeComments: true, collapseWhitespace: true}; - // Removing unused code for device... - es.concat( - // Remove unused HTML tags - gulp.src(path.join(wwwPath, 'templates', '**', '*.html')) - .pipe(removeCode({device: true})) - .pipe(removeCode(platformRemoveCodeOptions)) - .pipe(removeHtml('.hidden-xs.hidden-sm')) - .pipe(removeHtml('.hidden-device')) - .pipe(removeHtml('[remove-if][remove-if="device"]')) - .pipe(htmlmin(htmlminOptions)) - .pipe(gulp.dest(wwwPath + '/templates')), - - gulp.src(path.join(pluginPath, '**', '*.html')) - .pipe(removeCode({device: true})) - .pipe(removeCode(platformRemoveCodeOptions)) - .pipe(removeHtml('.hidden-xs.hidden-sm')) - .pipe(removeHtml('.hidden-device')) - .pipe(removeHtml('[remove-if][remove-if="device"]')) - .pipe(htmlmin(htmlminOptions)) - .pipe(gulp.dest(pluginPath)), - - gulp.src(path.join(wwwPath, 'index.html')) - .pipe(removeCode({device: true})) - .pipe(removeCode(platformRemoveCodeOptions)) - .pipe(removeHtml('.hidden-xs.hidden-sm')) - .pipe(removeHtml('.hidden-device')) - .pipe(removeHtml('[remove-if][remove-if="device"]')) - .pipe(htmlmin(/*no options, to build comments*/)) - .pipe(gulp.dest(wwwPath)), - - // Remove unused JS code + add ng annotations - gulp.src(path.join(wwwPath, 'js', '**', '*.js')) - .pipe(removeCode({device: true})) - .pipe(removeCode(platformRemoveCodeOptions)) - .pipe(ngAnnotate({single_quotes: true})) - .pipe(gulp.dest(wwwPath + '/dist/dist_js/app')), - - gulp.src([pluginPath + '/js/**/*.js']) - .pipe(removeCode({device: true})) - .pipe(removeCode(platformRemoveCodeOptions)) - .pipe(ngAnnotate({single_quotes: true})) - .pipe(gulp.dest(wwwPath + '/dist/dist_js/plugins')) - ); + // 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( + // Remove unused HTML tags + gulp.src(path.join(wwwPath, 'templates', '**', '*.html')) + .pipe(removeCode({device: true})) + .pipe(removeCode(platformRemoveCodeOptions)) + .pipe(removeHtml('.hidden-xs.hidden-sm')) + .pipe(removeHtml('.hidden-device')) + .pipe(removeHtml('[remove-if][remove-if="device"]')) + .pipe(htmlmin(htmlminOptions)) + .pipe(gulp.dest(wwwPath + '/templates')), + + gulp.src(path.join(pluginPath, '**', '*.html')) + .pipe(removeCode({device: true})) + .pipe(removeCode(platformRemoveCodeOptions)) + .pipe(removeHtml('.hidden-xs.hidden-sm')) + .pipe(removeHtml('.hidden-device')) + .pipe(removeHtml('[remove-if][remove-if="device"]')) + .pipe(htmlmin(htmlminOptions)) + .pipe(gulp.dest(pluginPath)), + + gulp.src(path.join(wwwPath, 'index.html')) + .pipe(removeCode({device: true})) + .pipe(removeCode(platformRemoveCodeOptions)) + .pipe(removeHtml('.hidden-xs.hidden-sm')) + .pipe(removeHtml('.hidden-device')) + .pipe(removeHtml('[remove-if][remove-if="device"]')) + .pipe(htmlmin(/*no options, to build comments*/)) + .pipe(gulp.dest(wwwPath)), + + // Remove unused JS code + add ng annotations + gulp.src(path.join(wwwPath, 'js', '**', '*.js')) + .pipe(removeCode({device: true})) + .pipe(removeCode(platformRemoveCodeOptions)) + .pipe(ngAnnotate({single_quotes: true})) + .pipe(gulp.dest(wwwPath + '/dist/dist_js/app')), + + gulp.src([pluginPath + '/js/**/*.js']) + .pipe(removeCode({device: true})) + .pipe(removeCode(platformRemoveCodeOptions)) + .pipe(ngAnnotate({single_quotes: true})) + .pipe(gulp.dest(wwwPath + '/dist/dist_js/plugins')) + ); + } else { + es.concat( + gulp.src(path.join(wwwPath, 'templates', '**', '*.html')) + .pipe(htmlmin(htmlminOptions)) + .pipe(gulp.dest(wwwPath + '/templates')), + + gulp.src(path.join(pluginPath, '**', '*.html')) + .pipe(htmlmin(htmlminOptions)) + .pipe(gulp.dest(pluginPath)), + + gulp.src(path.join(wwwPath, 'index.html')) + .pipe(gulp.dest(wwwPath)), + + gulp.src(path.join(wwwPath, 'js', '**', '*.js')) + .pipe(ngAnnotate({single_quotes: true})) + .pipe(gulp.dest(wwwPath + '/dist/dist_js/app')), + + gulp.src([pluginPath + '/js/**/*.js']) + .pipe(gulp.dest(wwwPath + '/dist/dist_js/plugins')) + ); + } } } diff --git a/install.sh b/install.sh index cd41899c9..7efea5784 100755 --- a/install.sh +++ b/install.sh @@ -15,7 +15,7 @@ if [ "_$CESIUM_DIR" = "_" ]; then fi latest_version() { - echo "v1.4.7" #lastest + echo "v1.4.8" #lastest } api_release_url() { diff --git a/package.json b/package.json index 57965c197..3e193b14e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cesium", - "version": "1.4.7", + "version": "1.4.8", "description": "Cesium Wallet for G1 libre currency", "repository": { "type": "git", diff --git a/www/js/config.js b/www/js/config.js index 13654ca1e..9a1966564 100644 --- a/www/js/config.js +++ b/www/js/config.js @@ -93,8 +93,8 @@ angular.module("cesium.config", []) "defaultCountry": "France" } }, - "version": "1.4.7", - "build": "2019-10-28T13:25:36.444Z", + "version": "1.4.8", + "build": "2019-10-28T15:15:43.927Z", "newIssueUrl": "https://git.duniter.org/clients/cesium-grp/cesium/issues/new" }) diff --git a/www/manifest.json b/www/manifest.json index 1a44d30e9..31a223f01 100644 --- a/www/manifest.json +++ b/www/manifest.json @@ -2,7 +2,7 @@ "short_name": "Cesium", "name": "Cesium", "manifest_version": 1, - "version": "1.4.7", + "version": "1.4.8", "default_locale": "fr", "description": "Manage your Duniter Wallet on a libre currency, like Äž1", "icons": [ -- GitLab