Merge pull request #54 from ONLYOFFICE/feature/auto-version-numbering

Added automatic version numbering
This commit is contained in:
maxkadushkin 2017-01-26 15:44:02 +03:00 committed by GitHub
commit 35b1e3c4fc
9 changed files with 33 additions and 18 deletions

View file

@ -571,7 +571,7 @@
}; };
DocsAPI.DocEditor.version = function() { DocsAPI.DocEditor.version = function() {
return '4.3.0'; return '{{PRODUCT_VERSION}}';
}; };
MessageDispatcher = function(fn, scope) { MessageDispatcher = function(fn, scope) {

View file

@ -52,7 +52,7 @@ define([
initialize: function(options) { initialize: function(options) {
Common.UI.BaseView.prototype.initialize.call(this,arguments); Common.UI.BaseView.prototype.initialize.call(this,arguments);
this.txtVersionNum = '4.3'; this.txtVersionNum = '{{PRODUCT_VERSION}}';
this.txtAscMail = 'support@onlyoffice.com'; this.txtAscMail = 'support@onlyoffice.com';
this.txtAscTelNum = '+371 660-16425'; this.txtAscTelNum = '+371 660-16425';
this.txtAscUrl = 'www.onlyoffice.com'; this.txtAscUrl = 'www.onlyoffice.com';

View file

@ -421,7 +421,7 @@
</div> </div>
<div class="content-block"> <div class="content-block">
<h3>DOCUMENT EDITOR</h3> <h3>DOCUMENT EDITOR</h3>
<h3><%= scope.textVersion %> 4.3</h3> <h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
</div> </div>
<div class="content-block"> <div class="content-block">
<h3 class="vendor">Ascensio System SIA</h3> <h3 class="vendor">Ascensio System SIA</h3>

View file

@ -223,7 +223,7 @@
</div> </div>
<div class="content-block"> <div class="content-block">
<h3>PRESENTATION EDITOR</h3> <h3>PRESENTATION EDITOR</h3>
<h3><%= scope.textVersion %> 4.3</h3> <h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
</div> </div>
<div class="content-block"> <div class="content-block">
<h3 class="vendor">Ascensio System SIA</h3> <h3 class="vendor">Ascensio System SIA</h3>

View file

@ -273,7 +273,7 @@
</div> </div>
<div class="content-block"> <div class="content-block">
<h3>SPREADSHEET EDITOR</h3> <h3>SPREADSHEET EDITOR</h3>
<h3><%= scope.textVersion %> 4.3</h3> <h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
</div> </div>
<div class="content-block"> <div class="content-block">
<h3 class="vendor">Ascensio System SIA</h3> <h3 class="vendor">Ascensio System SIA</h3>

View file

@ -8,7 +8,7 @@ module.exports = function(grunt) {
' *\n' + ' *\n' +
' * <%= pkg.homepage %> \n' + ' * <%= pkg.homepage %> \n' +
' *\n' + ' *\n' +
' * Version: ' + process.env['PRODUCT_VERSION'] + ' (build:' + process.env['BUILD_NUMBER'] + ')\n' + ' * Version: <%= pkg.version %> (build:<%= pkg.build %>)\n' +
' */\n'; ' */\n';
@ -117,7 +117,7 @@ module.exports = function(grunt) {
doRegisterTask('requirejs', function(defaultConfig, packageFile) { doRegisterTask('requirejs', function(defaultConfig, packageFile) {
return { return {
uglify: { uglify: {
pkg: grunt.file.readJSON(defaultConfig), pkg: packageFile,
options: { options: {
banner: '/** vim: et:ts=4:sw=4:sts=4\n' + 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.registerTask('main-app-init', function() {
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON(defaultConfig), pkg: packageFile,
clean: { clean: {
options: { options: {
@ -169,13 +169,13 @@ module.exports = function(grunt) {
replace: { replace: {
writeVersion: { 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, overwrite: true,
replacements: [{ replacements: [{
from: /(\#{2}BN\#)/, from: /\{\{PRODUCT_VERSION\}\}/,
to: function(matchedWord, index, fullText, regexMatches) { to: function(matchedWord, index, fullText, regexMatches) {
// return content.replace(/(\#{2}BN\#)/, "." + (process.env['BUILD_NUMBER'] || packageFile.build)); return packageFile.version;
return "." + (process.env['BUILD_NUMBER'] || packageFile.build);
} }
}] }]
} }
@ -219,7 +219,7 @@ module.exports = function(grunt) {
grunt.registerTask('mobile-app-init', function() { grunt.registerTask('mobile-app-init', function() {
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON(defaultConfig), pkg: packageFile,
clean: { clean: {
options: { options: {
@ -281,13 +281,26 @@ module.exports = function(grunt) {
'images-app': { 'images-app': {
files: packageFile['mobile']['copy']['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.registerTask('embed-app-init', function() {
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON(defaultConfig), pkg: packageFile,
clean: { clean: {
options: { options: {
@ -334,6 +347,8 @@ module.exports = function(grunt) {
grunt.registerTask('increment-build', function() { grunt.registerTask('increment-build', function() {
var pkg = grunt.file.readJSON(defaultConfig); var pkg = grunt.file.readJSON(defaultConfig);
pkg.build = parseInt(pkg.build) + 1; 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)); 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-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-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']); grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean:prebuild', 'uglify', 'less', 'copy', 'clean:postbuild']);

View file

@ -1,6 +1,6 @@
{ {
"name": "documenteditor", "name": "documenteditor",
"version": "4.7.0", "version": "4.3.0",
"build": 1112, "build": 1112,
"homepage": "http://www.onlyoffice.com", "homepage": "http://www.onlyoffice.com",
"private": true, "private": true,

View file

@ -1,6 +1,6 @@
{ {
"name": "presentationeditor", "name": "presentationeditor",
"version": "4.7.0", "version": "4.3.0",
"build": 774, "build": 774,
"homepage": "http://www.onlyoffice.com", "homepage": "http://www.onlyoffice.com",
"sdk": { "sdk": {

View file

@ -1,6 +1,6 @@
{ {
"name": "spreadsheeteditor", "name": "spreadsheeteditor",
"version": "4.7.0", "version": "4.3.0",
"build": 879, "build": 879,
"homepage": "http://www.onlyoffice.com", "homepage": "http://www.onlyoffice.com",
"private": true, "private": true,