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) {
grunt.registerTask('build_webword', ['build_webword_init', 'build_sdk']);
grunt.registerTask('build_nativeword', ['build_nativeword_init', 'build_sdk']);
grunt.registerTask('build_webexcel', ['build_webexcel_init', 'build_sdk']);
grunt.registerTask('build_webpowerpoint', ['build_webpowerpoint_init', 'build_sdk']);
grunt.registerTask('build_webexcel', ['build_webexcel_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('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.file.mkdir( packageFile['compile']['sdk']['log'] );
var map_file_path = packageFile['compile']['sdk']['dst'] + '.map';
......@@ -130,7 +118,7 @@ module.exports = function(grunt) {
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']
srcFiles = srcFiles.filter(function(item) {
return -1 === excludeFiles.indexOf(item);
......@@ -182,9 +170,8 @@ module.exports = function(grunt) {
version: {
options: {
variables: {
Version: packageFile['info']['version'],
Build: packageFile['info']['build'].toString(),
Rev: (packageFile['info']['rev'] || 1).toString()
Version: process.env['PRODUCT_VERSION'],
Build: process.env['BUILD_NUMBER']
}
},
files: {
......
{
"info": {
"version": "3.6.0",
"build": 163
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word"
},
"compile": {
"sdk": {
"src": [
......@@ -184,7 +176,6 @@
},
"tasks": {
"build": [
"increment_build",
"compile_sdk_native"
]
}
......
{
"info": {
"version": "3.8.0",
"build": 148
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word ../cell ../slide"
},
"compile": {
"sdk": {
"common": [
......@@ -199,7 +191,6 @@
},
"tasks": {
"build": [
"add_build_number",
"compile_sdk"
]
}
......
{
"info": {
"version": "3.8.0",
"build": 158
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word ../slide"
},
"compile": {
"sdk": {
"common": [
......@@ -204,7 +196,6 @@
},
"tasks": {
"build": [
"add_build_number",
"compile_sdk"
]
}
......
{
"info": {
"version": "3.8.0",
"build": 167
},
"update_src": {
"revision": "HEAD",
"src": "../common ../word"
},
"compile": {
"sdk": {
"common": [
......@@ -187,7 +179,6 @@
},
"tasks": {
"build": [
"add_build_number",
"compile_sdk"
]
}
......
......@@ -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
*
* 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