| module.exports = function(grunt) { |
| |
| grunt.initConfig({ |
| pkg: grunt.file.readJSON('package.json'), |
| concat: { |
| options: { |
| separator: ';' |
| }, |
| dist: { |
| src: ['src/**/*.js'], |
| dest: 'dist/<%= pkg.name %>.js' |
| } |
| }, |
| uglify: { |
| options: { |
| banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' |
| }, |
| dist: { |
| files: { |
| 'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] |
| } |
| } |
| }, |
| qunit: { |
| files: ['test/**/*.html'] |
| }, |
| jshint: { |
| files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], |
| options: { |
| globals: { |
| jQuery: true, |
| console: true, |
| module: true, |
| document: true |
| } |
| } |
| }, |
| watch: { |
| files: ['<%= jshint.files %>'], |
| tasks: ['jshint', 'qunit'] |
| } |
| }); |
| |
| grunt.loadNpmTasks('grunt-contrib-uglify'); |
| grunt.loadNpmTasks('grunt-contrib-jshint'); |
| grunt.loadNpmTasks('grunt-contrib-qunit'); |
| grunt.loadNpmTasks('grunt-contrib-watch'); |
| grunt.loadNpmTasks('grunt-contrib-concat'); |
| |
| grunt.registerTask('test', ['jshint', 'qunit']); |
| grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']); |
| |
| // Bug 499729 - Grunt plugin doesn't see all tasks |
| grunt.task.registerTask('publish', function(type) { |
| grunt.task.run('setVersion: ' + type); |
| }); |
| |
| grunt.task.registerTask('fetchDependencies', ['jshint', 'qunit']); |
| |
| grunt.task.registerTask('watchCommon', 'Watches directory for changes' , ['jshint', 'qunit']); |
| |
| grunt.task.registerMultiTask('log', 'Log stuff.', function() { |
| grunt.log.writeln(this.target + ': ' + this.data); |
| }); |
| |
| grunt.registerMultiTask('noDescriptionTask', function() { |
| grunt.log.writeln('Task without description'); |
| }); |
| }; |