Commit 68ec99dd authored by Alexander.Trofimov's avatar Alexander.Trofimov

revert some changes.

ToDo delete defines and externs.
parent 70644ee9
......@@ -6,6 +6,7 @@ module.exports = function(grunt) {
var formatting = grunt.option('formatting') || '';
var nomap = grunt.option('nomap') || '';
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-replace');
......@@ -110,14 +111,24 @@ module.exports = function(grunt) {
grunt.registerTask('compile_sdk_init', function(compilation_level) {
grunt.file.mkdir( packageFile['compile']['sdk']['log'] );
var map_file_path = packageFile['compile']['sdk']['dst'] + '.map';
var map_record_file_path = map_file_path + '.tmp';
var concat_src = [
packageFile['compile']['sdk']['dst'],
packageFile['compile']['defines']['dst'],
map_record_file_path ];
var srcFiles = packageFile['compile']['sdk']['common'];
var sdkOpt = {
compilation_level: compilation_level,
warning_level: 'QUIET',
externs: packageFile['compile']['sdk']['externs']
};
var definesOpt = {
compilation_level: 'ADVANCED' === compilation_level ? 'SIMPLE' : compilation_level,
warning_level: 'QUIET'
};
if (formatting) {
sdkOpt['formatting'] = formatting;
definesOpt['formatting'] = sdkOpt['formatting'] = formatting;
}
if (!nomap) {
sdkOpt['variable_renaming_report'] = packageFile['compile']['sdk']['log'] + '/variable.map';
......@@ -150,6 +161,12 @@ module.exports = function(grunt) {
'<%= pkg.compile.sdk.dst %>': srcFiles
},
options: sdkOpt
},
defines: {
files: {
'<%= pkg.compile.defines.dst %>': packageFile['compile']['defines']['src']
},
options: definesOpt
}
},
concat: {
......@@ -158,10 +175,14 @@ module.exports = function(grunt) {
footer: '})(window);'
},
dist: {
src: ['<%= pkg.compile.sdk.dst %>'],
src: concat_src,
dest: '<%= pkg.compile.sdk.dst %>'
}
},
clean: [
packageFile['compile']['defines']['dst'],
map_record_file_path
],
replace: {
version: {
options: {
......@@ -179,8 +200,8 @@ module.exports = function(grunt) {
});
});
grunt.registerTask('compile_sdk', ['compile_sdk_init:' + level, 'closure-compiler', 'concat', 'replace']);
grunt.registerTask('compile_sdk_native', ['compile_sdk_init:' + level, 'closure-compiler:sdk', 'concat', 'replace']);
grunt.registerTask('compile_sdk', ['compile_sdk_init:' + level, 'closure-compiler', 'concat', 'replace', 'clean']);
grunt.registerTask('compile_sdk_native', ['compile_sdk_init:' + level, 'closure-compiler:sdk', 'concat', 'replace', 'clean']);
grunt.registerTask('default', ['build_all']);
};
\ No newline at end of file
......@@ -56,7 +56,6 @@
"../cell/model/FormulaObjects/informationFunctions.js",
"../cell/model/FormulaObjects/logicalFunctions.js",
"../cell/model/Serialize.js",
"../common/Shapes/EditorSettings.js",
"../cell/model/WorkbookElems.js",
"../cell/model/Workbook.js",
"../cell/model/CellInfo.js",
......@@ -185,6 +184,14 @@
],
"map": "sdk-all.js.map",
"log": "../cell/Build/Log"
},
"defines": {
"src": [
"../common/Shapes/EditorSettings.js",
"../common/commonDefines.js",
"../cell/apiDefines.js"
],
"dst": "apiDefines.min.js"
},
"source_map": {
"url": "http://localhost:8080/sdkjs/cell"
......
......@@ -26,7 +26,6 @@
"../common/wordcopypaste.js",
"../common/editorscommon.js",
"../slide/Drawing/ThemeLoader.js",
"../common/Shapes/EditorSettings.js",
"../common/Charts/DrawingObjects.js",
"../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js",
......@@ -73,7 +72,6 @@
"../slide/Drawing/HtmlPage.js",
"../slide/apiDefines.js",
"../common/Drawings/Format/Constants.js",
"../slide/themes/Themes.js",
"../common/Shapes/Serialize.js",
"../common/Shapes/SerializeWriter.js",
"../word/Editor/SerializeCommon.js",
......@@ -191,6 +189,15 @@
"map": "sdk-all.js.map",
"log": "../slide/Build/Log"
},
"defines": {
"src": [
"../common/Shapes/EditorSettings.js",
"../slide/themes/Themes.js",
"../slide/apiDefines.js",
"../common/commonDefines.js"
],
"dst": "apiDefines.min.js"
},
"source_map": {
"url": "http://localhost:8080/sdkjs/slide"
}
......
......@@ -23,7 +23,6 @@
"../common/commonDefines.js",
"../common/editorscommon.js",
"../common/Shapes/Serialize.js",
"../common/Shapes/EditorSettings.js",
"../common/Shapes/SerializeWriter.js",
"../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js",
......@@ -174,6 +173,14 @@
"map": "sdk-all.js.map",
"log": "../word/Build/Log"
},
"defines": {
"src": [
"../common/Shapes/EditorSettings.js",
"../common/commonDefines.js",
"../word/apiDefines.js"
],
"dst": "apiDefines.min.js"
},
"source_map": {
"url": "http://localhost:8080/sdkjs/word"
}
......
......@@ -6,6 +6,7 @@
"dependencies": {
"google-closure-compiler": "20160315.2.0",
"grunt": "0.4.5",
"grunt-contrib-clean": "0.5.0",
"grunt-contrib-concat": "0.3.0",
"grunt-exec": "0.4.5",
"grunt-replace": "0.7.3"
......
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