Merge pull request #54 from ONLYOFFICE/feature/auto-version-numbering
Added automatic version numbering
This commit is contained in:
commit
35b1e3c4fc
|
@ -571,7 +571,7 @@
|
|||
};
|
||||
|
||||
DocsAPI.DocEditor.version = function() {
|
||||
return '4.3.0';
|
||||
return '{{PRODUCT_VERSION}}';
|
||||
};
|
||||
|
||||
MessageDispatcher = function(fn, scope) {
|
||||
|
|
|
@ -52,7 +52,7 @@ define([
|
|||
initialize: function(options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this,arguments);
|
||||
|
||||
this.txtVersionNum = '4.3';
|
||||
this.txtVersionNum = '{{PRODUCT_VERSION}}';
|
||||
this.txtAscMail = 'support@onlyoffice.com';
|
||||
this.txtAscTelNum = '+371 660-16425';
|
||||
this.txtAscUrl = 'www.onlyoffice.com';
|
||||
|
|
|
@ -421,7 +421,7 @@
|
|||
</div>
|
||||
<div class="content-block">
|
||||
<h3>DOCUMENT EDITOR</h3>
|
||||
<h3><%= scope.textVersion %> 4.3</h3>
|
||||
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3 class="vendor">Ascensio System SIA</h3>
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
</div>
|
||||
<div class="content-block">
|
||||
<h3>PRESENTATION EDITOR</h3>
|
||||
<h3><%= scope.textVersion %> 4.3</h3>
|
||||
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3 class="vendor">Ascensio System SIA</h3>
|
||||
|
|
|
@ -273,7 +273,7 @@
|
|||
</div>
|
||||
<div class="content-block">
|
||||
<h3>SPREADSHEET EDITOR</h3>
|
||||
<h3><%= scope.textVersion %> 4.3</h3>
|
||||
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3 class="vendor">Ascensio System SIA</h3>
|
||||
|
|
|
@ -8,7 +8,7 @@ module.exports = function(grunt) {
|
|||
' *\n' +
|
||||
' * <%= pkg.homepage %> \n' +
|
||||
' *\n' +
|
||||
' * Version: ' + process.env['PRODUCT_VERSION'] + ' (build:' + process.env['BUILD_NUMBER'] + ')\n' +
|
||||
' * Version: <%= pkg.version %> (build:<%= pkg.build %>)\n' +
|
||||
' */\n';
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ module.exports = function(grunt) {
|
|||
doRegisterTask('requirejs', function(defaultConfig, packageFile) {
|
||||
return {
|
||||
uglify: {
|
||||
pkg: grunt.file.readJSON(defaultConfig),
|
||||
pkg: packageFile,
|
||||
|
||||
options: {
|
||||
banner: '/** vim: et:ts=4:sw=4:sts=4\n' +
|
||||
|
@ -136,7 +136,7 @@ module.exports = function(grunt) {
|
|||
|
||||
grunt.registerTask('main-app-init', function() {
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON(defaultConfig),
|
||||
pkg: packageFile,
|
||||
|
||||
clean: {
|
||||
options: {
|
||||
|
@ -169,13 +169,13 @@ module.exports = function(grunt) {
|
|||
|
||||
replace: {
|
||||
writeVersion: {
|
||||
src: ['<%= pkg.api.copy.script.dest %>' + '/documents/api.js'],
|
||||
src: ['<%= pkg.api.copy.script.dest %>' + '/documents/api.js',
|
||||
'<%= pkg.main.js.requirejs.options.out %>'],
|
||||
overwrite: true,
|
||||
replacements: [{
|
||||
from: /(\#{2}BN\#)/,
|
||||
from: /\{\{PRODUCT_VERSION\}\}/,
|
||||
to: function(matchedWord, index, fullText, regexMatches) {
|
||||
// return content.replace(/(\#{2}BN\#)/, "." + (process.env['BUILD_NUMBER'] || packageFile.build));
|
||||
return "." + (process.env['BUILD_NUMBER'] || packageFile.build);
|
||||
return packageFile.version;
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ module.exports = function(grunt) {
|
|||
|
||||
grunt.registerTask('mobile-app-init', function() {
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON(defaultConfig),
|
||||
pkg: packageFile,
|
||||
|
||||
clean: {
|
||||
options: {
|
||||
|
@ -281,13 +281,26 @@ module.exports = function(grunt) {
|
|||
'images-app': {
|
||||
files: packageFile['mobile']['copy']['images-app']
|
||||
}
|
||||
},
|
||||
|
||||
replace: {
|
||||
writeVersion: {
|
||||
src: ['<%= pkg.mobile.js.requirejs.options.out %>'],
|
||||
overwrite: true,
|
||||
replacements: [{
|
||||
from: /\{\{PRODUCT_VERSION\}\}/,
|
||||
to: function(matchedWord, index, fullText, regexMatches) {
|
||||
return packageFile.version;
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
grunt.registerTask('embed-app-init', function() {
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON(defaultConfig),
|
||||
pkg: packageFile,
|
||||
|
||||
clean: {
|
||||
options: {
|
||||
|
@ -334,6 +347,8 @@ module.exports = function(grunt) {
|
|||
grunt.registerTask('increment-build', function() {
|
||||
var pkg = grunt.file.readJSON(defaultConfig);
|
||||
pkg.build = parseInt(pkg.build) + 1;
|
||||
packageFile.version = (process.env['PRODUCT_VERSION'] || pkg.version);
|
||||
packageFile.build = (process.env['BUILD_NUMBER'] || pkg.build);
|
||||
grunt.file.write(defaultConfig, JSON.stringify(pkg, null, 4));
|
||||
});
|
||||
|
||||
|
@ -353,7 +368,7 @@ module.exports = function(grunt) {
|
|||
grunt.registerTask('deploy-requirejs', ['requirejs-init', 'clean', 'uglify']);
|
||||
|
||||
grunt.registerTask('deploy-app-main', ['main-app-init', 'clean', 'imagemin', 'less', 'requirejs', 'concat', 'copy', 'replace:writeVersion']);
|
||||
grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', 'cssmin:styles', 'copy:template-backup', 'htmlmin', 'requirejs', 'concat', 'copy:template-restore', 'clean:template-backup', 'copy:localization', 'copy:index-page', 'copy:images-app']);
|
||||
grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', 'cssmin:styles', 'copy:template-backup', 'htmlmin', 'requirejs', 'concat', 'copy:template-restore', 'clean:template-backup', 'copy:localization', 'copy:index-page', 'copy:images-app', 'replace:writeVersion']);
|
||||
grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean:prebuild', 'uglify', 'less', 'copy', 'clean:postbuild']);
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "documenteditor",
|
||||
"version": "4.7.0",
|
||||
"version": "4.3.0",
|
||||
"build": 1112,
|
||||
"homepage": "http://www.onlyoffice.com",
|
||||
"private": true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "presentationeditor",
|
||||
"version": "4.7.0",
|
||||
"version": "4.3.0",
|
||||
"build": 774,
|
||||
"homepage": "http://www.onlyoffice.com",
|
||||
"sdk": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "spreadsheeteditor",
|
||||
"version": "4.7.0",
|
||||
"version": "4.3.0",
|
||||
"build": 879,
|
||||
"homepage": "http://www.onlyoffice.com",
|
||||
"private": true,
|
||||
|
|
Loading…
Reference in a new issue