module.exports = function(grunt) {

    /**
     * An object which defines the Grunt Project configuration.
     */
    var gruntConfiguration = {

        /**
         * Reads the 'package.json' file and puts its content into a 'pkg' Javascript object.
         */
        pkg : grunt.file.readJSON('package.json'),
        
        /**
         * Clean task.
         */
        clean : ['tmp/**/*'],

        /**
         * Instrument Task.
         */
        instrument : {
            files : [
                'src/**/*.js'
            ], 
            options : {
                lazy : true,
                basePath : 'reports/coverage'
            }
        },
        
        /**
         * JSDoc Task.
         */
        jsdoc : {
            dist : {
                src: [
                    'jsdoc/README.md',
                    'src/**/*.js'
                ], 
                options: {
                    configure : 'jsdoc/jsdoc.conf.json',
                    destination: 'tmp/jsdoc',
                    template : 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template'/*,
                    tutorials : 'tmp/replaced/jsdoc/tutorials'*/
                }
            }
        },
        
        /**
         * JSHint Task.
         */
        jshint : {
            src : {
                src : [
                    'Gruntfile.js',
                    'src/**/*.js'
                ]
            },
            test : {
                src : [
                    'test/**/*.js'
                ]
            }
        },
        
        /**
         * Make Report Task.
         */
        makeReport: {
            src: 'reports/coverage/**/*.json',
            options: {
                type: ['clover', 'cobertura', 'html', 'lcov'],
                dir: 'reports/coverage',
                print: 'detail'
            }
        },
        
        /**
         * Mocha Test Task.
         */
        mochaTest : {
            spec : {
                options : {
                    require : 'test/setup/node.js',
                    reporter : 'dot',
                    clearRequireCache : true,
                    mocha : require('mocha')
                },
                src : [
                    'test/spec/**/*.js'
                ]
            }
        },
        
        /**
         * Plato code analysis Task.
         */
        plato : {
            src : {
                files : {
                    'reports/plato' : ['src/**/*.js']
                }
            }
        },
        
        /**
         * Configures task used to pre process files
         */
        preprocess : {  
            lib : {
                src : 'src/umd-wrapper.js',
                dest : 'dist/backbone.hateoas.js'
            }
        }, 
        
        /**
         * Store coverage Task.
         */
        storeCoverage: {
            options: {
                dir: 'reports/coverage'
            }
        },
        
        /**
         * Task used to minify the library.
         */
        uglify: {   
            lib: {
                src: 'dist/backbone.hateoas.js',
                dest: 'dist/backbone.hateoas.min.js',
                options: {
                    sourceMap: true
                }
            }
        },
        
        /**
         * Watch Task.
         */
        watch: {
            tests: {
                options: {
                    spawn: false
                },
                files: ['src/**/*.js', 'test/spec/**/*.js'],
                tasks: ['test']
            }
        }

    };  /* Grunt project configuration object */

    // This has to be done before calling 'initConfig' (see https://github.com/sindresorhus/time-grunt)
    require('time-grunt')(grunt);
    
    // Initialize the Grunt Configuration
    grunt.initConfig(gruntConfiguration);

    // Load the Grunt Plugins
    require('load-grunt-tasks')(grunt);

    /**
     * Task used to execute the unit tests of the project.
     */
    grunt.registerTask(
        'test', 
        'Test the library',
        function() {

            process.env.srcDir = require('path').resolve(__dirname, 'src');
            
            grunt.task.run(
                [
                    'jshint:src',
                    'jshint:test',
                    'preprocess', 
                    'mochaTest' 
                ]
            );

        }
    );

    /**
     * Task used to generate a coverage report.
     */
    grunt.registerTask(
        'coverage', 
        'Generate coverage report for the library', 
        function() {

            // For coverage our source directory is 'reports/coverage/src'
            process.env.srcDir = require('path').resolve(__dirname, 'reports/coverage/src');

            grunt.task.run(
                [
                    'jshint:src',
                    'jshint:test',
                    'instrument',
                    'mochaTest',
                    'storeCoverage',
                    'makeReport'
                ]
            );

        }
    );

    /**
     * Task used to build the library.
     */
    grunt.registerTask(
        'build', 
        'Build the library',
        [
            'test',
            'uglify'
        ]
    );

    /**
     * Default task.
     */
    grunt.registerTask(
        'default',
        [
            'clean',
            'coverage',
            'plato',
            'build'
        ]
    );

};

@@ -310,25 +310,17 @@
 json'),%0A
-        
 %0A
+
         
@@ -522,33 +522,32 @@
 '%0A            %5D,
- 
 %0A            opt
@@ -651,33 +651,25 @@
 %0A        %7D,%0A
-        
 %0A
+
         /**%0A
@@ -856,17 +856,16 @@
       %5D,
- 
 %0A       
@@ -1187,33 +1187,25 @@
 %0A        %7D,%0A
-        
 %0A
+
         /**%0A
@@ -1525,33 +1525,25 @@
 %0A        %7D,%0A
-        
 %0A
+
         /**%0A
@@ -1832,33 +1832,25 @@
 %0A        %7D,%0A
-        
 %0A
+
         /**%0A
@@ -2263,33 +2263,25 @@
 %0A        %7D,%0A
-        
 %0A
+
         /**%0A
@@ -2486,33 +2486,25 @@
 %0A        %7D,%0A
-        
 %0A
+
         /**%0A
@@ -2590,18 +2590,16 @@
 cess : %7B
-  
 %0A       
@@ -2729,26 +2729,17 @@
       %7D,
- %0A        
+%0A
 %0A       
@@ -2896,33 +2896,25 @@
 %0A        %7D,%0A
-        
 %0A
+
         /**%0A
@@ -2986,19 +2986,16 @@
 glify: %7B
-   
 %0A       
@@ -3215,25 +3215,17 @@
      %7D,%0A
-        
 %0A
+
         
@@ -3686,21 +3686,17 @@
 grunt);%0A
-    
 %0A
+
     // I
@@ -3957,17 +3957,16 @@
  'test',
- 
 %0A       
@@ -4088,21 +4088,9 @@
 ');%0A
-            
 %0A
+
     
@@ -4233,17 +4233,16 @@
 rocess',
- 
 %0A       
@@ -4265,17 +4265,16 @@
 chaTest'
- 
 %0A       
@@ -4425,17 +4425,16 @@
 verage',
- 
 %0A       
@@ -4477,17 +4477,16 @@
 ibrary',
- 
 %0A       
@@ -5068,17 +5068,16 @@
 'build',
- 
 %0A       
@@ -5249,32 +5249,32 @@
 ult',%0A        %5B%0A
+
             'cle
@@ -5282,53 +5282,8 @@
 n',%0A
-            'coverage',%0A            'plato',%0A
     

Update Gruntfile.js to prepare code coverage publication to Coveralls.