/*global module:false*/
module.exports = function (grunt) {

  // Project configuration.
  grunt.initConfig({
    server: {
      port: 8000,
      base: '.'
    },
    pkg: grunt.file.readJSON('jquery-liveupdate.json'),
    meta: {
      banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd, h:MMTT Z") %>\n' +
        '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
        '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
        ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
    },
    concat: {
			options: {
				banner: '<%= banner %>',
				stripBanners: true
			},
      dist: {
        src: [
          // jQuery UI
          'libs/jquery/jquery-ui*.js',
          // All AOL plugins
          'libs/aol/**/*.js',
          // Specific jQuery plugins
          'libs/jquery/jquery.ba-throttle-debounce.min.js',
          'libs/jquery/imagesloaded/jquery.imagesloaded.js',
          // All our own JavaScript files
          'src/**/*.js'
        ],
        dest: 'dist/<%= pkg.name %>.js'
      },
      // no jQuery UI
      distNoUi: {
        src: [
          // All AOL plugins
          'libs/aol/**/*.js',
          // Specific jQuery plugins
          'libs/jquery/jquery.ba-throttle-debounce.min.js',
          'libs/jquery/imagesloaded/jquery.imagesloaded.js',
          // All our own JavaScript files
          'src/**/*.js'
        ],
        dest: 'dist/<%= pkg.name %>-noui.js'
      }
    },
    uglify: {
			options: {
				banner: '<%= banner %>'
			},
      bundle: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/<%= pkg.name %>.min.js'
      },
      bundleNoUi: {
        src: '<%= concat.distNoUi.dest %>',
        dest: 'dist/<%= pkg.name %>-noui.min.js'
      },
      api: {
        src: ['src/liveupdateapi.js'],
        dest: 'dist/jquery.liveupdateapi.min.js'
      },
      ui: {
        src: ['src/liveupdateui.js'],
        dest: 'dist/jquery.liveupdateui.min.js'
      }
    },
    compass: {
      dev: {
        options: {
					sassDir: 'assets/scss',
					cssDir: 'assets/dev/css',
					imagesDir: 'assets/resources/images',
					debugInfo: true,
					relativeAssets: true,
					require: 'animation'
				}
      },
      prod: {
        options: {
					sassDir: 'assets/scss',
					cssDir: 'assets/prod/css',
					imagesDir: 'assets/resources/images',
					debugInfo: false,
					relativeAssets: true,
					outputStyle: 'compressed',
					noLineComments: true,
					require: 'animation'
				}
      }
    },
    watch: {
      gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: ['jshint:gruntfile']
			},
			js: {
				files: '<%= jshint.js.src %>',
				tasks: ['jshint:js', 'concat:dist']
			},
			scss: {
				files: ['<%= compass.dev.options.sassDir %>/**/*.scss', 'assets/resources/*.scss'],
				tasks: ['compass:dev']
			}
    },
    jshint: {
      options: {
				jshintrc: '.jshintrc'
			},
			gruntfile: {
				src: 'Gruntfile.js'
			},
			js: {
				src: 'src/**/*.js'
			}
    }
  });

  // These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-nodeunit');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-compass');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-copy');

  // Default task.
  grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'compass:dev', 'compass:prod']);

  grunt.registerTask("watch-serve", "server watch");

};

@@ -218,22 +218,8 @@
 '),%0A
-    meta: %7B%0A  
     
@@ -284,32 +284,27 @@
 on %25%3E - ' +%0A
-        
+%09%09%09
 '%3C%25= grunt.t
@@ -349,24 +349,19 @@
 %25%3E%5Cn' +%0A
-        
+%09%09%09
 '%3C%25= pkg
@@ -396,16 +396,17 @@
 age + %22%5C
+%5C
 n%22 : %22%22 
@@ -411,24 +411,19 @@
 %22 %25%3E' +%0A
-        
+%09%09%09
 '* Copyr
@@ -494,24 +494,19 @@
  %25%3E;' +%0A
-        
+%09%09%09
 ' Licens
@@ -558,24 +558,23 @@
 %22) %25%3E */
-'%0A    %7D,
+%5Cn',%0A%09%09
 %0A    con
@@ -641,19 +641,20 @@
 anners: 
-tru
+fals
 e%0A%09%09%09%7D,%0A

Update Gruntfile to fix banner reference, and not strip banners from sources