'use strict';

// jshint node:true

module.exports = function(grunt) {
    var files = [
        'src/shim.js',
        'src/module.js',
        'src/roundProgressConfig.js',
        'src/roundProgressService.js',
        'src/roundProgress.js',
    ];

    require('load-grunt-tasks')(grunt);

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        uglify: {
            options: {
                banner: '/* <%= pkg.name %>@<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
            },
            build: {
                src: files,
                dest: 'build/roundProgress.min.js'
            }
        },
        concat: {
            options: {
                separator: '\n',
            },
            build: {
                src: files,
                dest: 'build/roundProgress.js',
            }
        },
        'gh-pages': {
            options: {
                base: 'build'
            },
            deploy: {
                src: ['index.html','roundProgress.js', 'roundProgress.min.js']
            }
        },
        jshint: {
            options: {
                jshintrc: true,
                reporter: require('jshint-stylish')
            },
            src: {
                files: {
                    src: files
                }
            }
        },
        watch: {
            options: {
                debounceDelay: 250,
                livereload: true
            },
            main: {
                // not the most efficient but it doesn't require
                // modification of the index.html
                files: ['src/**/*.js'],
                tasks: ['concat:build']
            },
            html: {
                files: ['build/index.html']
            }
        },
        connect: {
            server: {
                options: {
                    port: 1337,
                    livereload: true,
                    base: 'build',
                    open: true
                }
            }
        },
        bump: {
            options: {
                files: ['package.json', 'bower.json'],
                commit: true,
                commitMessage: 'Release %VERSION%',
                commitFiles: ['package.json', 'bower.json'],
                createTag: true,
                tagName: '%VERSION%',
                tagMessage: '%VERSION%',
                push: true,
                pushTo: 'origin'
            }
        }
    });

    grunt.registerTask('default', ['concat:build', 'connect', 'watch']);
    grunt.registerTask('build', ['jshint:src', 'concat:build', 'uglify:build']);
    grunt.registerTask('deploy', ['build', 'gh-pages:deploy']);
    grunt.registerTask('release', ['deploy', 'bump']);
};

@@ -247,16 +247,122 @@
     %5D;%0A%0A
+    var banner = '/* %3C%25= pkg.name %25%3E@%3C%25= pkg.version %25%3E %3C%25= grunt.template.today(%22yyyy-mm-dd%22) %25%3E */%5Cn';%0A%0A
     requ
@@ -393,16 +393,16 @@
 grunt);%0A
-
 %0A    gru
@@ -536,94 +536,14 @@
 er: 
-'/* %3C%25= pkg.name %25%3E@%3C%25= pkg.version %25%3E %3C%25= grunt.template.today(%22yyyy-mm-dd%22) %25%3E */%5Cn'
+banner
 %0A   
@@ -712,32 +712,32 @@
      options: %7B%0A
-
                 
@@ -753,16 +753,47 @@
 : '%5Cn',%0A
+                banner: banner%0A
         

add the version banner to the non-minified built file