Commit 6ac13503 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix build sdk on x86 systems

parent 1d9dcf7f
module.exports = function(grunt) { module.exports = function(grunt) {
require('google-closure-compiler').grunt(grunt, ['-Xms2048m']); var defaultConfig, packageFile;
var defaultConfig, packageFile;
var path = grunt.option('src') || './configs'; var path = grunt.option('src') || './configs';
var level = grunt.option('level') || 'ADVANCED'; var level = grunt.option('level') || 'ADVANCED';
var formatting = grunt.option('formatting') || ''; var formatting = grunt.option('formatting') || '';
require('google-closure-compiler').grunt(grunt, ['ADVANCED' === level ? '-Xms2048m' : '-Xms1024m']);
grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-replace'); grunt.loadNpmTasks('grunt-replace');
...@@ -121,22 +122,22 @@ module.exports = function(grunt) { ...@@ -121,22 +122,22 @@ module.exports = function(grunt) {
}); });
}); });
grunt.registerTask('compile_sdk_init', function(compilation_level) { grunt.registerTask('compile_sdk_init', function() {
var sdkTmp = 'sdk-tmp.js' var sdkTmp = 'sdk-tmp.js';
var splitLine = ''; var splitLine = '';
var tmp_sdk_path = 'sdk-js-tmp.js'; var tmp_sdk_path = 'sdk-js-tmp.js';
var sdkDstFolder = packageFile['compile']['sdk']['dst']; var sdkDstFolder = packageFile['compile']['sdk']['dst'];
var sdkAllMinDst = sdkDstFolder + '/sdk-all-min.js'; var sdkAllMinDst = sdkDstFolder + '/sdk-all-min.js';
var sdkAllDst = sdkDstFolder + '/sdk-all.js'; var sdkAllDst = sdkDstFolder + '/sdk-all.js';
var sdkOpt = { var sdkOpt = {
compilation_level: compilation_level, compilation_level: level,
warning_level: 'QUIET', warning_level: 'QUIET',
externs: packageFile['compile']['sdk']['externs'] externs: packageFile['compile']['sdk']['externs']
}; };
if (formatting) { if (formatting) {
sdkOpt['formatting'] = formatting; sdkOpt['formatting'] = formatting;
} }
if ('ADVANCED' === compilation_level) { if ('ADVANCED' === level) {
splitLine = ('PRETTY_PRINT' === formatting) ? 'window.split = "split";' : 'window.split="split";'; splitLine = ('PRETTY_PRINT' === formatting) ? 'window.split = "split";' : 'window.split="split";';
} else { } else {
splitLine = ('PRETTY_PRINT' === formatting) ? 'window["split"] = "split";' : 'window["split"]="split";'; splitLine = ('PRETTY_PRINT' === formatting) ? 'window["split"] = "split";' : 'window["split"]="split";';
...@@ -191,6 +192,6 @@ module.exports = function(grunt) { ...@@ -191,6 +192,6 @@ module.exports = function(grunt) {
}); });
grunt.registerTask('concat_sdk', ['concat_sdk_init', 'concat', 'clean']); grunt.registerTask('concat_sdk', ['concat_sdk_init', 'concat', 'clean']);
grunt.registerTask('compile_sdk', ['concat_sdk', 'compile_sdk_init:' + level, 'closure-compiler', 'splitfile', 'concat', 'replace', 'clean']); grunt.registerTask('compile_sdk', ['concat_sdk', 'compile_sdk_init', 'closure-compiler', 'splitfile', 'concat', 'replace', 'clean']);
grunt.registerTask('default', ['build_all']); grunt.registerTask('default', ['build_all']);
}; };
\ 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