From b5b8dca3a6cd01c5f9f02cdb4e9f01ce3b293d31 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 20 Jul 2021 19:45:24 +0300 Subject: [PATCH] [all mobile] added version info in production js --- build/Gruntfile.js | 69 ++++++++++++------------- build/documenteditor.json | 94 +---------------------------------- build/presentationeditor.json | 94 +---------------------------------- build/spreadsheeteditor.json | 94 +---------------------------------- 4 files changed, 38 insertions(+), 313 deletions(-) diff --git a/build/Gruntfile.js b/build/Gruntfile.js index df942b6329..adff92d5e8 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { packageFile; const copyrightHeader = 'Copyright (c) Ascensio System SIA <%= grunt.template.today("yyyy") %>. All rights reserved' - var copyright = '/*\n' + + var copyright = '/*!\n' + ' * ' + (process.env['APP_COPYRIGHT'] || copyrightHeader) + '\n' + ' *\n' + ' * <%= pkg.homepage %> \n' + @@ -432,11 +432,6 @@ module.exports = function(grunt) { 'template-backup': packageFile.mobile.copy['template-backup'][0].dest }, - requirejs: { - compile: { - options: packageFile['mobile']['js']['requirejs']['options'] - } - }, concat: { options: { @@ -444,8 +439,8 @@ module.exports = function(grunt) { banner: copyright }, dist: { - src: packageFile.mobile.js.requirejs.options.out, - dest: packageFile.mobile.js.requirejs.options.out + src: packageFile.mobile.js.dest, + dest: packageFile.mobile.js.dest } }, @@ -498,29 +493,29 @@ module.exports = function(grunt) { }, }, - replace: { - writeVersion: { - src: ['<%= pkg.mobile.js.requirejs.options.out %>'], - overwrite: true, - replacements: [{ - from: /\{\{PRODUCT_VERSION\}\}/, - to: packageFile.version - }] - }, - fixResourceUrl: { - src: ['<%= pkg.mobile.js.requirejs.options.out %>', - '<%= pkg.mobile.css.ios.dist %>', - '<%= pkg.mobile.css.material.dist %>'], - overwrite: true, - replacements: [{ - from: /(?:\.{2}\/){4}common\/mobile\/resources\/img/g, - to: '../img' - },{ - from: /(?:\.{2}\/){2}common\/mobile/g, - to: '../mobile' - }] - } - }, + // replace: { + // writeVersion: { + // src: ['<%= pkg.mobile.js.requirejs.options.out %>'], + // overwrite: true, + // replacements: [{ + // from: /\{\{PRODUCT_VERSION\}\}/, + // to: packageFile.version + // }] + // }, + // fixResourceUrl: { + // src: ['<%= pkg.mobile.js.requirejs.options.out %>', + // '<%= pkg.mobile.css.ios.dist %>', + // '<%= pkg.mobile.css.material.dist %>'], + // overwrite: true, + // replacements: [{ + // from: /(?:\.{2}\/){4}common\/mobile\/resources\/img/g, + // to: '../img' + // },{ + // from: /(?:\.{2}\/){2}common\/mobile/g, + // to: '../mobile' + // }] + // } + // }, exec: { webpack_app_build: { @@ -542,9 +537,9 @@ module.exports = function(grunt) { } }); - var replace = grunt.config.get('replace'); - replace.writeVersion.replacements.push(...jsreplacements); - grunt.config.set('replace', replace); + // var replace = grunt.config.get('replace'); + // replace.writeVersion.replacements.push(...jsreplacements); + // grunt.config.set('replace', replace); }); grunt.registerTask('embed-app-init', function() { @@ -629,10 +624,10 @@ module.exports = function(grunt) { 'replace:writeVersion', 'replace:prepareHelp', 'clean:postbuild']); grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', /*'cssmin',*/ /*'copy:template-backup',*/ - 'htmlmin', /*'requirejs',*/ 'exec:webpack_install', 'exec:webpack_app_build', /*'concat',*/ /*'copy:template-restore',*/ + 'htmlmin', /*'requirejs',*/ 'exec:webpack_install', 'exec:webpack_app_build', /*'copy:template-restore',*/ /*'clean:template-backup',*/ 'copy:localization', 'copy:index-page', - 'copy:images-app', 'copy:webpack-dist', 'json-minify', - 'replace:writeVersion', 'replace:fixResourceUrl']); + 'copy:images-app', 'copy:webpack-dist', 'concat', 'json-minify'/*,*/ + /*'replace:writeVersion', 'replace:fixResourceUrl'*/]); grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean:prebuild', 'uglify', 'less', 'copy', 'clean:postbuild']); diff --git a/build/documenteditor.json b/build/documenteditor.json index d3880ac263..9f20bf075e 100644 --- a/build/documenteditor.json +++ b/build/documenteditor.json @@ -218,98 +218,8 @@ ] }, "js": { - "requirejs": { - "options": { - "name": "../apps/documenteditor/mobile/app.js", - "out": "../deploy/web-apps/apps/documenteditor/mobile/app.js", - "baseUrl": "../apps/", - "inlineText": true, - "findNestedDependencies": true, - "preserveLicenseComments": false, - "optimizeAllPluginResources": true, - "paths": { - "jquery": "../vendor/jquery/jquery", - "underscore": "../vendor/underscore/underscore", - "backbone": "../vendor/backbone/backbone", - "framework7": "../vendor/framework7/js/framework7", - "text": "../vendor/requirejs-text/text", - "xregexp": "empty:", - "sockjs": "empty:", - "jszip": "empty:", - "jszip-utils": "empty:", - "coapisettings": "empty:", - "allfonts": "empty:", - "sdk": "empty:", - "api": "empty:", - "core": "common/main/lib/core/application", - "extendes": "common/mobile/utils/extendes", - "notification": "common/main/lib/core/NotificationCenter", - "localstorage": "common/main/lib/util/LocalStorage", - "analytics": "common/Analytics", - "gateway": "common/Gateway", - "locale": "common/locale", - "irregularstack": "common/IrregularStack", - "sharedsettings": "common/mobile/utils/SharedSettings" - }, - "shim": { - "framework7": { - "exports": "Framework7" - }, - "underscore": { - "exports": "_" - }, - "backbone": { - "deps": [ - "underscore", - "jquery" - ], - "exports": "Backbone" - }, - "notification": { - "deps": [ - "backbone" - ] - }, - "core": { - "deps": [ - "backbone", - "notification", - "irregularstack", - "sharedsettings" - ] - }, - "extendes": { - "deps": [ - "underscore", - "jquery", - "framework7" - ] - }, - "sdk": { - "deps": [ - "jquery", - "underscore", - "coapisettings", - "allfonts", - "xregexp", - "sockjs", - "jszip", - "jszip-utils" - ] - }, - "gateway": { - "deps": [ - "jquery" - ] - }, - "analytics": { - "deps": [ - "jquery" - ] - } - } - } - } + "src": "../apps/documenteditor/mobile/dist/js/app.js", + "dest": "../deploy/web-apps/apps/documenteditor/mobile/dist/js/app.js" }, "css": { "ios": { diff --git a/build/presentationeditor.json b/build/presentationeditor.json index cececc2de8..9e5961a4aa 100644 --- a/build/presentationeditor.json +++ b/build/presentationeditor.json @@ -222,98 +222,8 @@ ] }, "js": { - "requirejs": { - "options": { - "name": "../apps/presentationeditor/mobile/app.js", - "out": "../deploy/web-apps/apps/presentationeditor/mobile/app.js", - "baseUrl": "../apps/", - "inlineText": true, - "findNestedDependencies": true, - "preserveLicenseComments": false, - "optimizeAllPluginResources": true, - "paths": { - "jquery": "../vendor/jquery/jquery", - "underscore": "../vendor/underscore/underscore", - "backbone": "../vendor/backbone/backbone", - "framework7": "../vendor/framework7/js/framework7", - "text": "../vendor/requirejs-text/text", - "xregexp": "empty:", - "sockjs": "empty:", - "jszip": "empty:", - "jszip-utils": "empty:", - "coapisettings": "empty:", - "allfonts": "empty:", - "sdk": "empty:", - "api": "empty:", - "core": "common/main/lib/core/application", - "extendes": "common/mobile/utils/extendes", - "notification": "common/main/lib/core/NotificationCenter", - "localstorage": "common/main/lib/util/LocalStorage", - "analytics": "common/Analytics", - "gateway": "common/Gateway", - "locale": "common/locale", - "irregularstack": "common/IrregularStack", - "sharedsettings": "common/mobile/utils/SharedSettings" - }, - "shim": { - "framework7": { - "exports": "Framework7" - }, - "underscore": { - "exports": "_" - }, - "backbone": { - "deps": [ - "underscore", - "jquery" - ], - "exports": "Backbone" - }, - "notification": { - "deps": [ - "backbone" - ] - }, - "core": { - "deps": [ - "backbone", - "notification", - "irregularstack", - "sharedsettings" - ] - }, - "extendes": { - "deps": [ - "underscore", - "jquery", - "framework7" - ] - }, - "sdk": { - "deps": [ - "jquery", - "underscore", - "coapisettings", - "allfonts", - "xregexp", - "sockjs", - "jszip", - "jszip-utils" - ] - }, - "gateway": { - "deps": [ - "jquery" - ] - }, - "analytics": { - "deps": [ - "jquery" - ] - } - } - } - } + "src": "../apps/presentationeditor/mobile/dist/js/app.js", + "dest": "../deploy/web-apps/apps/presentationeditor/mobile/dist/js/app.js" }, "css": { "ios": { diff --git a/build/spreadsheeteditor.json b/build/spreadsheeteditor.json index 216e479159..784cea7d40 100644 --- a/build/spreadsheeteditor.json +++ b/build/spreadsheeteditor.json @@ -223,98 +223,8 @@ ] }, "js": { - "requirejs": { - "options": { - "name": "../apps/spreadsheeteditor/mobile/app.js", - "out": "../deploy/web-apps/apps/spreadsheeteditor/mobile/app.js", - "baseUrl": "../apps/", - "inlineText": true, - "findNestedDependencies": true, - "preserveLicenseComments": false, - "optimizeAllPluginResources": true, - "paths": { - "jquery": "../vendor/jquery/jquery", - "underscore": "../vendor/underscore/underscore", - "backbone": "../vendor/backbone/backbone", - "framework7": "../vendor/framework7/js/framework7", - "text": "../vendor/requirejs-text/text", - "xregexp": "empty:", - "sockjs": "empty:", - "jszip": "empty:", - "jszip-utils": "empty:", - "coapisettings": "empty:", - "allfonts": "empty:", - "sdk": "empty:", - "api": "empty:", - "core": "common/main/lib/core/application", - "extendes": "common/mobile/utils/extendes", - "notification": "common/main/lib/core/NotificationCenter", - "localstorage": "common/main/lib/util/LocalStorage", - "analytics": "common/Analytics", - "gateway": "common/Gateway", - "locale": "common/locale", - "irregularstack": "common/IrregularStack", - "sharedsettings": "common/mobile/utils/SharedSettings" - }, - "shim": { - "framework7": { - "exports": "Framework7" - }, - "underscore": { - "exports": "_" - }, - "backbone": { - "deps": [ - "underscore", - "jquery" - ], - "exports": "Backbone" - }, - "notification": { - "deps": [ - "backbone" - ] - }, - "core": { - "deps": [ - "backbone", - "notification", - "irregularstack", - "sharedsettings" - ] - }, - "extendes": { - "deps": [ - "underscore", - "jquery", - "framework7" - ] - }, - "sdk": { - "deps": [ - "jquery", - "underscore", - "coapisettings", - "allfonts", - "xregexp", - "sockjs", - "jszip", - "jszip-utils" - ] - }, - "gateway": { - "deps": [ - "jquery" - ] - }, - "analytics": { - "deps": [ - "jquery" - ] - } - } - } - } + "src": "../apps/spreadsheeteditor/mobile/dist/js/app.js", + "dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/dist/js/app.js" }, "css": { "ios": {