Commit 641e7bcb authored by Alexey.Golubev's avatar Alexey.Golubev

Get the version and the build number from env vars.

parent 32e0f42e
...@@ -87,23 +87,11 @@ module.exports = function(grunt) { ...@@ -87,23 +87,11 @@ module.exports = function(grunt) {
grunt.registerTask('build_webword', ['build_webword_init', 'build_sdk']); grunt.registerTask('build_webword', ['build_webword_init', 'build_sdk']);
grunt.registerTask('build_nativeword', ['build_nativeword_init', 'build_sdk']); grunt.registerTask('build_nativeword', ['build_nativeword_init', 'build_sdk']);
grunt.registerTask('build_webexcel', ['build_webexcel_init', 'build_sdk']); grunt.registerTask('build_webexcel', ['build_webexcel_init', 'build_sdk']);
grunt.registerTask('build_webpowerpoint', ['build_webpowerpoint_init', 'build_sdk']); grunt.registerTask('build_webpowerpoint', ['build_webpowerpoint_init', 'build_sdk']);
grunt.registerTask('build_all', ['build_webword_init', 'build_sdk', 'build_webexcel_init', 'build_sdk', 'build_webpowerpoint_init', 'build_sdk']); grunt.registerTask('build_all', ['build_webword_init', 'build_sdk', 'build_webexcel_init', 'build_sdk', 'build_webpowerpoint_init', 'build_sdk']);
grunt.registerTask('add_build_number', function() {
var pkg = grunt.file.readJSON(defaultConfig);
if(undefined !== process.env['BUILD_NUMBER']) {
grunt.log.ok('Use Jenkins build number as sdk-all build number!'.yellow);
packageFile['info']['build'] = parseInt(process.env['BUILD_NUMBER']);
pkg.info.build = packageFile['info']['build'];
packageFile['info']['rev'] = process.env['GIT_COMMIT'];
grunt.file.write(defaultConfig, JSON.stringify(pkg, null, 4));
}
});
grunt.registerTask('compile_sdk_init', function(compilation_level) { grunt.registerTask('compile_sdk_init', function(compilation_level) {
grunt.file.mkdir( packageFile['compile']['sdk']['log'] ); grunt.file.mkdir( packageFile['compile']['sdk']['log'] );
var map_file_path = packageFile['compile']['sdk']['dst'] + '.map'; var map_file_path = packageFile['compile']['sdk']['dst'] + '.map';
...@@ -130,7 +118,7 @@ module.exports = function(grunt) { ...@@ -130,7 +118,7 @@ module.exports = function(grunt) {
sdkOpt['property_renaming_report'] = packageFile['compile']['sdk']['log'] + '/property.map'; sdkOpt['property_renaming_report'] = packageFile['compile']['sdk']['log'] + '/property.map';
} }
if (grunt.option('mobile')) { if (grunt.option('mobile')) {
var excludeFiles = packageFile['compile']['sdk']['exclude_mobile'] var excludeFiles = packageFile['compile']['sdk']['exclude_mobile']
srcFiles = srcFiles.filter(function(item) { srcFiles = srcFiles.filter(function(item) {
return -1 === excludeFiles.indexOf(item); return -1 === excludeFiles.indexOf(item);
...@@ -182,9 +170,8 @@ module.exports = function(grunt) { ...@@ -182,9 +170,8 @@ module.exports = function(grunt) {
version: { version: {
options: { options: {
variables: { variables: {
Version: packageFile['info']['version'], Version: process.env['PRODUCT_VERSION'],
Build: packageFile['info']['build'].toString(), Build: process.env['BUILD_NUMBER']
Rev: (packageFile['info']['rev'] || 1).toString()
} }
}, },
files: { files: {
......
{ {
"info": {
"version": "3.6.0",
"build": 163
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word"
},
"compile": { "compile": {
"sdk": { "sdk": {
"src": [ "src": [
...@@ -184,7 +176,6 @@ ...@@ -184,7 +176,6 @@
}, },
"tasks": { "tasks": {
"build": [ "build": [
"increment_build",
"compile_sdk_native" "compile_sdk_native"
] ]
} }
......
{ {
"info": {
"version": "3.8.0",
"build": 148
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word ../cell ../slide"
},
"compile": { "compile": {
"sdk": { "sdk": {
"common": [ "common": [
...@@ -199,7 +191,6 @@ ...@@ -199,7 +191,6 @@
}, },
"tasks": { "tasks": {
"build": [ "build": [
"add_build_number",
"compile_sdk" "compile_sdk"
] ]
} }
......
{ {
"info": {
"version": "3.8.0",
"build": 158
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word ../slide"
},
"compile": { "compile": {
"sdk": { "sdk": {
"common": [ "common": [
...@@ -204,7 +196,6 @@ ...@@ -204,7 +196,6 @@
}, },
"tasks": { "tasks": {
"build": [ "build": [
"add_build_number",
"compile_sdk" "compile_sdk"
] ]
} }
......
{ {
"info": {
"version": "3.8.0",
"build": 167
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word"
},
"compile": { "compile": {
"sdk": { "sdk": {
"common": [ "common": [
...@@ -187,7 +179,6 @@ ...@@ -187,7 +179,6 @@
}, },
"tasks": { "tasks": {
"build": [ "build": [
"add_build_number",
"compile_sdk" "compile_sdk"
] ]
} }
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
* *
*/ */
/** /**
* @license Copyright (c) Ascensio System SIA 2012-2015. All rights reserved * @license Copyright (c) Ascensio System SIA 2012-2016. All rights reserved
* *
* http://www.onlyoffice.com * http://www.onlyoffice.com
* *
* Version: @@Version (build:@@Build, rev:@@Rev) * Version: @@Version (build:@@Build)
*/ */
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment