2013-05-27 21:57:39 +00:00
|
|
|
/**
|
|
|
|
* How to run grunt tasks:
|
|
|
|
* - At project root, run 'npm install' - It will install nodedependencies declared in package,json in <root>/.node_modules
|
|
|
|
* - install grunt CLI tools globally, run 'npm install -g grunt-cli'
|
|
|
|
* - run a grunt target defined in Gruntfiles.js, ex: 'grunt lint'
|
|
|
|
*
|
|
|
|
* Note: The 'ghost' grunt task have special deps on CasperJS and phantomjs.
|
2013-08-04 16:27:32 +00:00
|
|
|
* For now, It's configured to run only on TravisCI where these deps are
|
2013-05-27 21:57:39 +00:00
|
|
|
* correctly defined.
|
2013-08-04 16:27:32 +00:00
|
|
|
* If you run this task locally, it may require some env set up first.
|
2013-05-27 21:57:39 +00:00
|
|
|
*/
|
|
|
|
|
2013-08-04 16:27:32 +00:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
jshint : {
|
|
|
|
/*options: {
|
2013-08-04 19:20:25 +00:00
|
|
|
"evil": true,
|
|
|
|
"asi": true,
|
|
|
|
"smarttabs": true,
|
|
|
|
"eqnull": true
|
|
|
|
},*/
|
2013-08-04 16:27:32 +00:00
|
|
|
files : [
|
|
|
|
'Gruntfile.js',
|
|
|
|
'package.json',
|
|
|
|
'js/**/*.js',
|
|
|
|
'!js/lib/**/*.js' // Exclude lib folder (note the leading !)
|
|
|
|
]
|
|
|
|
},
|
|
|
|
connect : {
|
|
|
|
www : {
|
|
|
|
options : {
|
|
|
|
base : '.',
|
|
|
|
port : 4545
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
ghost : {
|
|
|
|
dist : {
|
|
|
|
filesSrc : ['tests/integration/casperjs/*_test.js'],
|
|
|
|
options : {
|
|
|
|
args : {
|
2013-08-04 19:20:25 +00:00
|
|
|
baseUrl : 'http://localhost:' + '<%= connect.www.options.port %>/'
|
2013-08-04 16:27:32 +00:00
|
|
|
},
|
|
|
|
direct : false,
|
2013-08-04 19:20:25 +00:00
|
|
|
logLevel : 'debug',
|
2013-08-04 16:27:32 +00:00
|
|
|
printCommand : false,
|
|
|
|
printFilePaths : true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
concat : {
|
|
|
|
options : {
|
|
|
|
separator : ';',
|
|
|
|
},
|
|
|
|
dist : {
|
|
|
|
src : require('./script-load-list.js').scripts,
|
|
|
|
dest : 'build/piskel-packaged.js',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
uglify : {
|
|
|
|
options : {
|
|
|
|
mangle : true
|
|
|
|
},
|
|
|
|
my_target : {
|
|
|
|
files : {
|
|
|
|
'build/piskel-packaged-min.js' : ['build/piskel-packaged.js']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2013-05-26 21:58:59 +00:00
|
|
|
|
2013-08-04 16:27:32 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-connect');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-ghost');
|
2013-05-26 21:58:59 +00:00
|
|
|
|
2013-08-04 16:27:32 +00:00
|
|
|
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
|
|
|
|
grunt.registerTask('lint', ['jshint']);
|
|
|
|
grunt.registerTask('test', ['jshint', 'connect', 'ghost']);
|
2013-05-26 22:02:48 +00:00
|
|
|
};
|