Commit c7352ba0 authored by Alexander.Trofimov's avatar Alexander.Trofimov

Сборку перевел на google-closure-compiler модуль

parent 96440f23
module.exports = function(grunt) { module.exports = function(grunt) {
require('google-closure-compiler').grunt(grunt);
var revision="unknown", defaultConfig, packageFile, toolsConfig, toolsFile; var revision="unknown", defaultConfig, packageFile, toolsConfig, toolsFile;
var path = require('path'); var path = require('path');
...@@ -7,7 +8,6 @@ module.exports = function(grunt) { ...@@ -7,7 +8,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-exec'); grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-closure-tools');
grunt.loadNpmTasks('grunt-replace'); grunt.loadNpmTasks('grunt-replace');
grunt.registerTask('get_svn_info', 'Initialize svn information', function () { grunt.registerTask('get_svn_info', 'Initialize svn information', function () {
...@@ -205,32 +205,27 @@ module.exports = function(grunt) { ...@@ -205,32 +205,27 @@ module.exports = function(grunt) {
packageFile['compile']['defines']['dst'], packageFile['compile']['defines']['dst'],
map_record_file_path ]; map_record_file_path ];
grunt.initConfig({ grunt.initConfig({
closureCompiler: { pkg: grunt.file.readJSON(defaultConfig),
options: { 'closure-compiler': {
compilerFile: compilerFile, build: {
javaFlags: ['-Xms2048m'] files: {
'<%= pkg.compile.sdk.dst %>': packageFile['compile']['sdk']['src']
}, },
sdk: { options: {
TEMPcompilerOpts: {
compilation_level: compilation_level, compilation_level: compilation_level,
externs: packageFile['compile']['sdk']['externs'],
define: packageFile['compile']['sdk']['define'],
warning_level: 'QUIET', warning_level: 'QUIET',
externs: packageFile['compile']['sdk']['externs'],
variable_renaming_report: packageFile['compile']['sdk']['log'] + '/variable.map', variable_renaming_report: packageFile['compile']['sdk']['log'] + '/variable.map',
property_renaming_report: packageFile['compile']['sdk']['log'] + '/property.map'/*, property_renaming_report: packageFile['compile']['sdk']['log'] + '/property.map'/*,
create_source_map: map_file_path, create_source_map: map_file_path,
source_map_format: "V3"*/ source_map_format: "V3"*/
}, },
src: packageFile['compile']['sdk']['src'],
dest: packageFile['compile']['sdk']['dst']
},
defines: { defines: {
TEMPcompilerOpts: { options: {
compilation_level: 'SIMPLE', compilation_level: 'SIMPLE',
warning_level: 'QUIET' warning_level: 'QUIET'
}, }
src: packageFile['compile']['defines']['src'], }
dest: packageFile['compile']['defines']['dst']
} }
}, },
create_map_file: {}, create_map_file: {},
...@@ -239,7 +234,6 @@ module.exports = function(grunt) { ...@@ -239,7 +234,6 @@ module.exports = function(grunt) {
packageFile['compile']['defines']['dst'], packageFile['compile']['defines']['dst'],
map_record_file_path map_record_file_path
], ],
pkg: grunt.file.readJSON(defaultConfig),
replace: { replace: {
version: { version: {
options: { options: {
...@@ -257,11 +251,11 @@ module.exports = function(grunt) { ...@@ -257,11 +251,11 @@ module.exports = function(grunt) {
}); });
}); });
grunt.registerTask('compile_sdk', ['compile_sdk_init:ADVANCED', 'closureCompiler', 'concat', 'replace', 'clean']); grunt.registerTask('compile_sdk', ['compile_sdk_init:ADVANCED', 'closure-compiler', 'concat', 'replace', 'clean']);
grunt.registerTask('compile_sdk_fast', ['compile_sdk_init:WHITESPACE_ONLY', 'closureCompiler', 'concat', 'replace', 'clean']); grunt.registerTask('compile_sdk_fast', ['compile_sdk_init:WHITESPACE_ONLY', 'closure-compiler', 'concat', 'replace', 'clean']);
grunt.registerTask('compile_sdk_native', ['compile_sdk_init:ADVANCED', 'closureCompiler:sdk', 'concat', 'replace', 'clean']); grunt.registerTask('compile_sdk_native', ['compile_sdk_init:ADVANCED', 'closure-compiler:sdk', 'concat', 'replace', 'clean']);
grunt.registerTask('compile_sdk_native_fast', ['compile_sdk_init:WHITESPACE_ONLY', 'closureCompiler:sdk', 'concat', 'replace', 'clean']); grunt.registerTask('compile_sdk_native_fast', ['compile_sdk_init:WHITESPACE_ONLY', 'closure-compiler:sdk', 'concat', 'replace', 'clean']);
grunt.registerTask('deploy_sdk_init', function() { grunt.registerTask('deploy_sdk_init', function() {
grunt.initConfig({ grunt.initConfig({
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
"homepage": "http://www.teamlab.com", "homepage": "http://www.teamlab.com",
"private": true, "private": true,
"dependencies": { "dependencies": {
"google-closure-compiler": "^20160315.0.0",
"grunt": "0.4.2", "grunt": "0.4.2",
"grunt-contrib-clean": "0.5.0", "grunt-contrib-clean": "0.5.0",
"grunt-contrib-concat": "0.3.0", "grunt-contrib-concat": "0.3.0",
"grunt-contrib-copy": "0.5.0", "grunt-contrib-copy": "0.5.0",
"grunt-exec": "0.4.5", "grunt-exec": "0.4.5",
"grunt-replace": "0.7.3", "grunt-replace": "0.7.3"
"grunt-closure-tools": "0.9.9"
} }
} }
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
"dst": "../../word/sdk-all.js", "dst": "../../word/sdk-all.js",
"externs": [ "externs": [
"../../common/Native/jquery_native.js", "../../common/Native/jquery_native.js",
"../../common/3rdparty/XRegExp/xregexp-all-min.js" "../../../web-apps/vendor/xregexp/xregexp-all-min.js"
], ],
"map": "sdk-all.js.map", "map": "sdk-all.js.map",
"log": "../../word/Build/Log" "log": "../../word/Build/Log"
......
...@@ -167,15 +167,15 @@ ...@@ -167,15 +167,15 @@
"dst": "../../cell/sdk-all.js", "dst": "../../cell/sdk-all.js",
"externs": [ "externs": [
"../../common/Build/Externs.js", "../../common/Build/Externs.js",
"../../common/3rdparty/jquery/jquery.min.js", "../../../web-apps/vendor/jquery/jquery.min.js",
"../../common/3rdparty/Underscore/underscore-min.js", "../../../web-apps/vendor/underscore/underscore-min.js",
"../../common/3rdparty/Sockjs/sockjs.min.js", "../../../web-apps/vendor/sockjs/sockjs.min.js",
"../../common/3rdparty/XRegExp/xregexp-all-min.js", "../../../web-apps/vendor/xregexp/xregexp-all-min.js",
"../../common/3rdparty/jszip/jszip.min.js", "../../../web-apps/vendor/jszip/jszip.min.js",
"../../common/3rdparty/jszip-utils/jszip-utils.min.js", "../../../web-apps/vendor/jszip-utils/jszip-utils.min.js",
"../../common/3rdparty/jsrsasign/jsrsasign-latest-all-min.js", "../../../web-apps/vendor/jsrsasign/jsrsasign-latest-all-min.js",
"../../common/3rdparty/perfect-scrollbar/jquery.mousewheel.js", "../../../web-apps/vendor/perfect-scrollbar/src/jquery.mousewheel.js",
"../../common/3rdparty/perfect-scrollbar/perfect-scrollbar.js" "../../../web-apps/vendor/perfect-scrollbar/src/perfect-scrollbar.js"
], ],
"map": "sdk-all.js.map", "map": "sdk-all.js.map",
"log": "../../cell/Build/Log" "log": "../../cell/Build/Log"
......
...@@ -150,13 +150,13 @@ ...@@ -150,13 +150,13 @@
"dst": "../../slide/sdk-all.js", "dst": "../../slide/sdk-all.js",
"externs": [ "externs": [
"../../common/Build/Externs.js", "../../common/Build/Externs.js",
"../../common/3rdparty/jquery/jquery.min.js", "../../../web-apps/vendor/jquery/jquery.min.js",
"../../common/3rdparty/Underscore/underscore-min.js", "../../../web-apps/vendor/underscore/underscore-min.js",
"../../common/3rdparty/Sockjs/sockjs.min.js", "../../../web-apps/vendor/sockjs/sockjs.min.js",
"../../common/3rdparty/XRegExp/xregexp-all-min.js", "../../../web-apps/vendor/xregexp/xregexp-all-min.js",
"../../common/3rdparty/jszip/jszip.min.js", "../../../web-apps/vendor/jszip/jszip.min.js",
"../../common/3rdparty/jszip-utils/jszip-utils.min.js", "../../../web-apps/vendor/jszip-utils/jszip-utils.min.js",
"../../common/3rdparty/jsrsasign/jsrsasign-latest-all-min.js" "../../../web-apps/vendor/jsrsasign/jsrsasign-latest-all-min.js"
], ],
"map": "sdk-all.js.map", "map": "sdk-all.js.map",
"log": "../../slide/Build/Log" "log": "../../slide/Build/Log"
......
...@@ -155,13 +155,13 @@ ...@@ -155,13 +155,13 @@
"dst": "../../word/sdk-all.js", "dst": "../../word/sdk-all.js",
"externs": [ "externs": [
"../../common/Build/Externs.js", "../../common/Build/Externs.js",
"../../common/3rdparty/jquery/jquery.min.js", "../../../web-apps/vendor/jquery/jquery.min.js",
"../../common/3rdparty/Underscore/underscore-min.js", "../../../web-apps/vendor/underscore/underscore-min.js",
"../../common/3rdparty/Sockjs/sockjs.min.js", "../../../web-apps/vendor/sockjs/sockjs.min.js",
"../../common/3rdparty/XRegExp/xregexp-all-min.js", "../../../web-apps/vendor/xregexp/xregexp-all-min.js",
"../../common/3rdparty/jszip/jszip.min.js", "../../../web-apps/vendor/jszip/jszip.min.js",
"../../common/3rdparty/jszip-utils/jszip-utils.min.js", "../../../web-apps/vendor/jszip-utils/jszip-utils.min.js",
"../../common/3rdparty/jsrsasign/jsrsasign-latest-all-min.js" "../../../web-apps/vendor/jsrsasign/jsrsasign-latest-all-min.js"
], ],
"map": "sdk-all.js.map", "map": "sdk-all.js.map",
"log": "../../word/Build/Log" "log": "../../word/Build/Log"
......
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