Merge branch 'master' into feature-gif-export-panel

This commit is contained in:
Julian Descottes
2013-09-28 23:37:12 +02:00
21 changed files with 103 additions and 25 deletions

View File

@@ -11,7 +11,6 @@
*/
module.exports = function(grunt) {
var piskelScripts = require('./piskel-script-list.js').scripts;
var getGhostConfig = function (delay) {
return {
@@ -83,6 +82,61 @@ module.exports = function(grunt) {
'build/piskel-packaged-min.js' : ['build/piskel-packaged.js']
}
}
},
closureCompiler: {
options: {
// [REQUIRED] Path to closure compiler
compilerFile: 'closure_compiler_20130823.jar',
// [OPTIONAL] set to true if you want to check if files were modified
// before starting compilation (can save some time in large sourcebases)
//checkModified: true,
// [OPTIONAL] Set Closure Compiler Directives here
compilerOpts: {
/**
* Keys will be used as directives for the compiler
* values can be strings or arrays.
* If no value is required use null
*/
//compilation_level: 'ADVANCED_OPTIMIZATIONS',
compilation_level: 'SIMPLE_OPTIMIZATIONS',
externs: ['piskel-closure-externs.js'],
// Inject some constants in JS code, could we use that for appengine wiring ?
//define: ["'goog.DEBUG=false'"],
warning_level: 'verbose',
jscomp_off: ['checkTypes', 'fileoverviewTags'],
summary_detail_level: 1,
language_in: 'ECMASCRIPT3'
//output_wrapper: '"(function(){%output%}).call(this);"'
},
execOpts: { // [OPTIONAL] Set exec method options
maxBuffer: 999999 * 1024
}
},
compile: {
/**
*[OPTIONAL] Here you can add new or override previous option of the Closure Compiler Directives.
* IMPORTANT! The feature is enabled as a temporary solution to [#738](https://github.com/gruntjs/grunt/issues/738).
* As soon as issue will be fixed this feature will be removed.
*/
TEMPcompilerOpts: {
},
src: [
'js/**/*.js',
//'!js/lib/**/*.js',
'!js/lib/bootstrap/**/*.js',
'!js/lib/jsColor_1_4_0/**/*.js',
'!js/lib/gif/**/*.js',
'piskel-boot.js',
'piskel-script-list.js'
],
// This generated JS binary is currently not used and even excluded from source control using .gitignore.
dest: 'closure_compiled_binary.js'
}
}
});
@@ -98,6 +152,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-closure-tools');
grunt.loadNpmTasks('grunt-ghost');
grunt.loadNpmTasks('grunt-leading-indent');
@@ -105,15 +160,17 @@ module.exports = function(grunt) {
grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']);
// Validate & Test
grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect:test', 'ghost:default']);
grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'compile', 'connect:test', 'ghost:default']);
// Validate & Test (faster version) will NOT work on travis !!
grunt.registerTask('precommit', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect:test', 'ghost:local']);
grunt.registerTask('precommit', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'compile', 'connect:test', 'ghost:local']);
// Compile JS code (eg verify JSDoc annotation and types, no actual minified code generated).
grunt.registerTask('compile', ['closureCompiler:compile']);
// Validate & Build
grunt.registerTask('default', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'concat', 'uglify']);
grunt.registerTask('default', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'concat', 'compile', 'uglify']);
// Start webserver
grunt.registerTask('serve', ['connect:serve']);
};