[all mobile] added version info in production js

This commit is contained in:
Maxim Kadushkin 2021-07-20 19:45:24 +03:00
parent e949655e8e
commit b5b8dca3a6
4 changed files with 38 additions and 313 deletions

View file

@ -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']);

View file

@ -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": {

View file

@ -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": {

View file

@ -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": {