<commit_before>module.exports = function(grunt) {
	grunt.initConfig({
		meta: {
			package: grunt.file.readJSON('package.json'),
			src: {
        css_dir: 'app/soc/content/css',
        css_soc_dir: '<%= meta.src.css_dir %>/soc',
        css_gsoc_dir: '<%= meta.src.css_dir %>/gsoc',
        css_gci_dir: '<%= meta.src.css_dir %>/gci',
        less_dir: 'app/soc/content/less',
        less_soc_dir: '<%= meta.src.less_dir %>/soc',
        less_gsoc_dir: '<%= meta.src.less_dir %>/gsoc',
        less_gci_dir: '<%= meta.src.less_dir %>/gci',
				js_dir: './app/soc/content/js',
        tests_dir: './tests',
				js_files: '<%= meta.src.js_dir %>/**/*.js',
				test_specs: '<%= meta.src.tests_dir %>/**/*_spec.js',
        test_all: '<%= meta.src.tests_dir %>/**/*.js'
			},
			reports: {
        reports_dir: 'js_reports',
        documentation: '<%= meta.reports.reports_dir %>/documentation',
				coverage: '<%= meta.reports.reports_dir %>/coverage',
				plato_source: '<%= meta.reports.reports_dir %>/plato',
				plato_tests: '<%= meta.reports.reports_dir %>/plato_tests',
        yuidoc: '<%= meta.reports.documentation %>/yuidoc'
			},
      build: {
        build_dir: './build',
        css_dir: '<%= meta.build.build_dir %>/soc/content/css',
        css_gsoc_dir: '<%= meta.build.css_dir %>/gsoc',
        css_soc_dir: '<%= meta.build.css_dir %>/soc',
        css_gci_dir: '<%= meta.build.css_dir %>/gci'
      }
		},
		jasmine: {
			coverage: {
				src: [
          '<%= meta.src.js_dir %>/melange.js',
          '<%= meta.src.js_dir %>/melange.list.js'
        ],
				options: {
					specs: '<%= meta.src.test_all %>',
					template: require('grunt-template-jasmine-istanbul'),
					templateOptions: {
						coverage: '<%= meta.reports.coverage %>/coverage.json',
						report: [
							{
								type: 'html',
								options: {
									dir: '<%= meta.reports.coverage %>/html'
								}
							}
						]
					},
          helpers: [
            './app/soc/content/js/thirdparty/jquery/jquery-1.6.4.js',
            './app/soc/content/js/thirdparty/jlinq/jLinq-2.2.1.js'
          ]
				}
			}
		},
    less: {
      development: {
        options: {
          paths: ['<%= meta.src.less_dir %>']
        },
        files: {
          /* Development common SOC files */
          '<%= meta.src.css_soc_dir %>/search_page.css': '<%= meta.src.less_soc_dir %>/search_page.less',
          '<%= meta.src.css_soc_dir %>/server-error-style.css': '<%= meta.src.less_soc_dir %>/server-error-style.less',
          '<%= meta.src.css_soc_dir %>/user-error-style.css': '<%= meta.src.less_soc_dir %>/user-error-style.less',
          /* Development GSOC files */
          '<%= meta.src.css_gsoc_dir %>/buttons.css': '<%= meta.src.less_gsoc_dir %>/buttons.less',
          '<%= meta.src.css_gsoc_dir %>/dashboard.css': '<%= meta.src.less_gsoc_dir %>/dashboard.less',
          '<%= meta.src.css_gsoc_dir %>/forms.css': '<%= meta.src.less_gsoc_dir %>/forms.less',
          '<%= meta.src.css_gsoc_dir %>/global.css': '<%= meta.src.less_gsoc_dir %>/global.less',
          '<%= meta.src.css_gsoc_dir %>/menu.css': '<%= meta.src.less_gsoc_dir %>/menu.less',
          '<%= meta.src.css_gsoc_dir %>/others.css': '<%= meta.src.less_gsoc_dir %>/others.less',
          '<%= meta.src.css_gsoc_dir %>/readonly.css': '<%= meta.src.less_gsoc_dir %>/readonly.less',
          '<%= meta.src.css_gsoc_dir %>/structure.css': '<%= meta.src.less_gsoc_dir %>/structure.less',
          '<%= meta.src.css_gsoc_dir %>/surveys.css': '<%= meta.src.less_gsoc_dir %>/surveys.less',
          '<%= meta.src.css_gsoc_dir %>/tables.css': '<%= meta.src.less_gsoc_dir %>/tables.less',
          '<%= meta.src.css_gsoc_dir %>/typography.css': '<%= meta.src.less_gsoc_dir %>/typography.less',
          '<%= meta.src.css_gsoc_dir %>/user-messages.css': '<%= meta.src.less_gsoc_dir %>/user-messages.less',
          /* Development GCI files */
          '<%= meta.src.css_gci_dir %>/account_deletion.css': '<%= meta.src.less_gci_dir %>/account_deletion.less',
          '<%= meta.src.css_gci_dir %>/buttons.css': '<%= meta.src.less_gci_dir %>/buttons.less',
          '<%= meta.src.css_gci_dir %>/dashboard.css': '<%= meta.src.less_gci_dir %>/dashboard.less',
          '<%= meta.src.css_gci_dir %>/document.css': '<%= meta.src.less_gci_dir %>/document.less',
          '<%= meta.src.css_gci_dir %>/forms.css': '<%= meta.src.less_gci_dir %>/forms.less',
          '<%= meta.src.css_gci_dir %>/ie.css': '<%= meta.src.less_gci_dir %>/ie.less',
          '<%= meta.src.css_gci_dir %>/others.css': '<%= meta.src.less_gci_dir %>/others.less',
          '<%= meta.src.css_gci_dir %>/readonly.css': '<%= meta.src.less_gci_dir %>/readonly.less',
          '<%= meta.src.css_gci_dir %>/style.css': '<%= meta.src.less_gci_dir %>/style.less'
        }
      },
      production: {
        options: {
          paths: ['<%= meta.src.css_dir %>']
        },
        files: {
          /* Build common SOC files */
          '<%= meta.build.css_soc_dir %>/search_page.css': '<%= meta.src.less_soc_dir %>/search_page.less',
          '<%= meta.build.css_soc_dir %>/server-error-style.css': '<%= meta.src.less_soc_dir %>/server-error-style.less',
          '<%= meta.build.css_soc_dir %>/user-error-style.css': '<%= meta.src.less_soc_dir %>/user-error-style.less',
          /* Build GSOC files */
          '<%= meta.build.css_gsoc_dir %>/buttons.css': '<%= meta.src.less_gsoc_dir %>/buttons.less',
          '<%= meta.build.css_gsoc_dir %>/dashboard.css': '<%= meta.src.less_gsoc_dir %>/dashboard.less',
          '<%= meta.build.css_gsoc_dir %>/forms.css': '<%= meta.src.less_gsoc_dir %>/forms.less',
          '<%= meta.build.css_gsoc_dir %>/global.css': '<%= meta.src.less_gsoc_dir %>/global.less',
          '<%= meta.build.css_gsoc_dir %>/menu.css': '<%= meta.src.less_gsoc_dir %>/menu.less',
          '<%= meta.build.css_gsoc_dir %>/others.css': '<%= meta.src.less_gsoc_dir %>/others.less',
          '<%= meta.build.css_gsoc_dir %>/readonly.css': '<%= meta.src.less_gsoc_dir %>/readonly.less',
          '<%= meta.build.css_gsoc_dir %>/structure.css': '<%= meta.src.less_gsoc_dir %>/structure.less',
          '<%= meta.build.css_gsoc_dir %>/surveys.css': '<%= meta.src.less_gsoc_dir %>/surveys.less',
          '<%= meta.build.css_gsoc_dir %>/tables.css': '<%= meta.src.less_gsoc_dir %>/tables.less',
          '<%= meta.build.css_gsoc_dir %>/typography.css': '<%= meta.src.less_gsoc_dir %>/typography.less',
          '<%= meta.build.css_gsoc_dir %>/user-messages.css': '<%= meta.src.less_gsoc_dir %>/user-messages.less',
          /* Development GCI files */
          '<%= meta.build.css_gci_dir %>/account_deletion.css': '<%= meta.src.less_gci_dir %>/account_deletion.less',
          '<%= meta.build.css_gci_dir %>/buttons.css': '<%= meta.src.less_gci_dir %>/buttons.less',
          '<%= meta.build.css_gci_dir %>/dashboard.css': '<%= meta.src.less_gci_dir %>/dashboard.less',
          '<%= meta.build.css_gci_dir %>/document.css': '<%= meta.src.less_gci_dir %>/document.less',
          '<%= meta.build.css_gci_dir %>/forms.css': '<%= meta.src.less_gci_dir %>/forms.less',
          '<%= meta.build.css_gci_dir %>/ie.css': '<%= meta.src.less_gci_dir %>/ie.less',
          '<%= meta.build.css_gci_dir %>/others.css': '<%= meta.src.less_gci_dir %>/others.less',
          '<%= meta.build.css_gci_dir %>/readonly.css': '<%= meta.src.less_gci_dir %>/readonly.less',
          '<%= meta.build.css_gci_dir %>/style.css': '<%= meta.src.less_gci_dir %>/style.less'
        }
      }
    },
    plato: {
      source_files: {
        options : {
          complexity : {
            logicalor : false,
            forin : true,
            newmi: true,
            switchcase : false,
            trycatch : true
          }
        },
        files: {
          '<%= meta.reports.plato_source %>': ['<%= meta.src.js_files %>']
        }
      },
      test_files: {
        options : {
          complexity : {
            logicalor : false,
            forin : true,
            newmi: true,
            switchcase : false,
            trycatch : true
          }
        },
        files: {
          '<%= meta.reports.plato_tests %>': ['<%= meta.src.test_specs %>']
        }
      }
    },
    yuidoc: {
      compile: {
        name: '<%= meta.package.name %>',
        description: '<%= meta.package.description %>',
        options: {
          paths: '<%= meta.src.js_dir %>',
          outdir: '<%= meta.reports.yuidoc %>'
        }
      }
    }
	});

  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-yuidoc');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-plato');

  grunt.registerTask('coverage', ['jasmine:coverage']);
  grunt.registerTask('documentation', ['yuidoc']);
  grunt.registerTask('plato_source', ['plato:source_files']);
  grunt.registerTask('plato_tests', ['plato:test_files']);
  grunt.registerTask('build', ['less:production']);
};<commit_msg>Use correct dir for LESS files includes when compiling for production.<commit_after>module.exports = function(grunt) {
	grunt.initConfig({
		meta: {
			package: grunt.file.readJSON('package.json'),
			src: {
        css_dir: 'app/soc/content/css',
        css_soc_dir: '<%= meta.src.css_dir %>/soc',
        css_gsoc_dir: '<%= meta.src.css_dir %>/gsoc',
        css_gci_dir: '<%= meta.src.css_dir %>/gci',
        less_dir: 'app/soc/content/less',
        less_soc_dir: '<%= meta.src.less_dir %>/soc',
        less_gsoc_dir: '<%= meta.src.less_dir %>/gsoc',
        less_gci_dir: '<%= meta.src.less_dir %>/gci',
				js_dir: './app/soc/content/js',
        tests_dir: './tests',
				js_files: '<%= meta.src.js_dir %>/**/*.js',
				test_specs: '<%= meta.src.tests_dir %>/**/*_spec.js',
        test_all: '<%= meta.src.tests_dir %>/**/*.js'
			},
			reports: {
        reports_dir: 'js_reports',
        documentation: '<%= meta.reports.reports_dir %>/documentation',
				coverage: '<%= meta.reports.reports_dir %>/coverage',
				plato_source: '<%= meta.reports.reports_dir %>/plato',
				plato_tests: '<%= meta.reports.reports_dir %>/plato_tests',
        yuidoc: '<%= meta.reports.documentation %>/yuidoc'
			},
      build: {
        build_dir: './build',
        css_dir: '<%= meta.build.build_dir %>/soc/content/css',
        css_gsoc_dir: '<%= meta.build.css_dir %>/gsoc',
        css_soc_dir: '<%= meta.build.css_dir %>/soc',
        css_gci_dir: '<%= meta.build.css_dir %>/gci'
      }
		},
		jasmine: {
			coverage: {
				src: [
          '<%= meta.src.js_dir %>/melange.js',
          '<%= meta.src.js_dir %>/melange.list.js'
        ],
				options: {
					specs: '<%= meta.src.test_all %>',
					template: require('grunt-template-jasmine-istanbul'),
					templateOptions: {
						coverage: '<%= meta.reports.coverage %>/coverage.json',
						report: [
							{
								type: 'html',
								options: {
									dir: '<%= meta.reports.coverage %>/html'
								}
							}
						]
					},
          helpers: [
            './app/soc/content/js/thirdparty/jquery/jquery-1.6.4.js',
            './app/soc/content/js/thirdparty/jlinq/jLinq-2.2.1.js'
          ]
				}
			}
		},
    less: {
      development: {
        options: {
          paths: ['<%= meta.src.less_dir %>']
        },
        files: {
          /* Development common SOC files */
          '<%= meta.src.css_soc_dir %>/search_page.css': '<%= meta.src.less_soc_dir %>/search_page.less',
          '<%= meta.src.css_soc_dir %>/server-error-style.css': '<%= meta.src.less_soc_dir %>/server-error-style.less',
          '<%= meta.src.css_soc_dir %>/user-error-style.css': '<%= meta.src.less_soc_dir %>/user-error-style.less',
          /* Development GSOC files */
          '<%= meta.src.css_gsoc_dir %>/buttons.css': '<%= meta.src.less_gsoc_dir %>/buttons.less',
          '<%= meta.src.css_gsoc_dir %>/dashboard.css': '<%= meta.src.less_gsoc_dir %>/dashboard.less',
          '<%= meta.src.css_gsoc_dir %>/forms.css': '<%= meta.src.less_gsoc_dir %>/forms.less',
          '<%= meta.src.css_gsoc_dir %>/global.css': '<%= meta.src.less_gsoc_dir %>/global.less',
          '<%= meta.src.css_gsoc_dir %>/menu.css': '<%= meta.src.less_gsoc_dir %>/menu.less',
          '<%= meta.src.css_gsoc_dir %>/others.css': '<%= meta.src.less_gsoc_dir %>/others.less',
          '<%= meta.src.css_gsoc_dir %>/readonly.css': '<%= meta.src.less_gsoc_dir %>/readonly.less',
          '<%= meta.src.css_gsoc_dir %>/structure.css': '<%= meta.src.less_gsoc_dir %>/structure.less',
          '<%= meta.src.css_gsoc_dir %>/surveys.css': '<%= meta.src.less_gsoc_dir %>/surveys.less',
          '<%= meta.src.css_gsoc_dir %>/tables.css': '<%= meta.src.less_gsoc_dir %>/tables.less',
          '<%= meta.src.css_gsoc_dir %>/typography.css': '<%= meta.src.less_gsoc_dir %>/typography.less',
          '<%= meta.src.css_gsoc_dir %>/user-messages.css': '<%= meta.src.less_gsoc_dir %>/user-messages.less',
          /* Development GCI files */
          '<%= meta.src.css_gci_dir %>/account_deletion.css': '<%= meta.src.less_gci_dir %>/account_deletion.less',
          '<%= meta.src.css_gci_dir %>/buttons.css': '<%= meta.src.less_gci_dir %>/buttons.less',
          '<%= meta.src.css_gci_dir %>/dashboard.css': '<%= meta.src.less_gci_dir %>/dashboard.less',
          '<%= meta.src.css_gci_dir %>/document.css': '<%= meta.src.less_gci_dir %>/document.less',
          '<%= meta.src.css_gci_dir %>/forms.css': '<%= meta.src.less_gci_dir %>/forms.less',
          '<%= meta.src.css_gci_dir %>/ie.css': '<%= meta.src.less_gci_dir %>/ie.less',
          '<%= meta.src.css_gci_dir %>/others.css': '<%= meta.src.less_gci_dir %>/others.less',
          '<%= meta.src.css_gci_dir %>/readonly.css': '<%= meta.src.less_gci_dir %>/readonly.less',
          '<%= meta.src.css_gci_dir %>/style.css': '<%= meta.src.less_gci_dir %>/style.less'
        }
      },
      production: {
        options: {
          paths: ['<%= meta.src.less_dir %>']
        },
        files: {
          /* Build common SOC files */
          '<%= meta.build.css_soc_dir %>/search_page.css': '<%= meta.src.less_soc_dir %>/search_page.less',
          '<%= meta.build.css_soc_dir %>/server-error-style.css': '<%= meta.src.less_soc_dir %>/server-error-style.less',
          '<%= meta.build.css_soc_dir %>/user-error-style.css': '<%= meta.src.less_soc_dir %>/user-error-style.less',
          /* Build GSOC files */
          '<%= meta.build.css_gsoc_dir %>/buttons.css': '<%= meta.src.less_gsoc_dir %>/buttons.less',
          '<%= meta.build.css_gsoc_dir %>/dashboard.css': '<%= meta.src.less_gsoc_dir %>/dashboard.less',
          '<%= meta.build.css_gsoc_dir %>/forms.css': '<%= meta.src.less_gsoc_dir %>/forms.less',
          '<%= meta.build.css_gsoc_dir %>/global.css': '<%= meta.src.less_gsoc_dir %>/global.less',
          '<%= meta.build.css_gsoc_dir %>/menu.css': '<%= meta.src.less_gsoc_dir %>/menu.less',
          '<%= meta.build.css_gsoc_dir %>/others.css': '<%= meta.src.less_gsoc_dir %>/others.less',
          '<%= meta.build.css_gsoc_dir %>/readonly.css': '<%= meta.src.less_gsoc_dir %>/readonly.less',
          '<%= meta.build.css_gsoc_dir %>/structure.css': '<%= meta.src.less_gsoc_dir %>/structure.less',
          '<%= meta.build.css_gsoc_dir %>/surveys.css': '<%= meta.src.less_gsoc_dir %>/surveys.less',
          '<%= meta.build.css_gsoc_dir %>/tables.css': '<%= meta.src.less_gsoc_dir %>/tables.less',
          '<%= meta.build.css_gsoc_dir %>/typography.css': '<%= meta.src.less_gsoc_dir %>/typography.less',
          '<%= meta.build.css_gsoc_dir %>/user-messages.css': '<%= meta.src.less_gsoc_dir %>/user-messages.less',
          /* Development GCI files */
          '<%= meta.build.css_gci_dir %>/account_deletion.css': '<%= meta.src.less_gci_dir %>/account_deletion.less',
          '<%= meta.build.css_gci_dir %>/buttons.css': '<%= meta.src.less_gci_dir %>/buttons.less',
          '<%= meta.build.css_gci_dir %>/dashboard.css': '<%= meta.src.less_gci_dir %>/dashboard.less',
          '<%= meta.build.css_gci_dir %>/document.css': '<%= meta.src.less_gci_dir %>/document.less',
          '<%= meta.build.css_gci_dir %>/forms.css': '<%= meta.src.less_gci_dir %>/forms.less',
          '<%= meta.build.css_gci_dir %>/ie.css': '<%= meta.src.less_gci_dir %>/ie.less',
          '<%= meta.build.css_gci_dir %>/others.css': '<%= meta.src.less_gci_dir %>/others.less',
          '<%= meta.build.css_gci_dir %>/readonly.css': '<%= meta.src.less_gci_dir %>/readonly.less',
          '<%= meta.build.css_gci_dir %>/style.css': '<%= meta.src.less_gci_dir %>/style.less'
        }
      }
    },
    plato: {
      source_files: {
        options : {
          complexity : {
            logicalor : false,
            forin : true,
            newmi: true,
            switchcase : false,
            trycatch : true
          }
        },
        files: {
          '<%= meta.reports.plato_source %>': ['<%= meta.src.js_files %>']
        }
      },
      test_files: {
        options : {
          complexity : {
            logicalor : false,
            forin : true,
            newmi: true,
            switchcase : false,
            trycatch : true
          }
        },
        files: {
          '<%= meta.reports.plato_tests %>': ['<%= meta.src.test_specs %>']
        }
      }
    },
    yuidoc: {
      compile: {
        name: '<%= meta.package.name %>',
        description: '<%= meta.package.description %>',
        options: {
          paths: '<%= meta.src.js_dir %>',
          outdir: '<%= meta.reports.yuidoc %>'
        }
      }
    }
	});

  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-yuidoc');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-plato');

  grunt.registerTask('coverage', ['jasmine:coverage']);
  grunt.registerTask('documentation', ['yuidoc']);
  grunt.registerTask('plato_source', ['plato:source_files']);
  grunt.registerTask('plato_tests', ['plato:test_files']);
  grunt.registerTask('build', ['less:production']);
};<|endoftext|>


<commit_before>// Generated on 2015-04-15 using generator-angular-fullstack 2.0.13
'use strict';

module.exports = function (grunt) {
  var localConfig;
  try {
    localConfig = require('./server/config/local.env');
  } catch(e) {
    localConfig = {};
  }

  // Load grunt tasks automatically, when needed
  require('jit-grunt')(grunt, {
    express: 'grunt-express-server',
    useminPrepare: 'grunt-usemin',
    ngtemplates: 'grunt-angular-templates',
    cdnify: 'grunt-google-cdn',
    protractor: 'grunt-protractor-runner',
    injector: 'grunt-asset-injector',
    buildcontrol: 'grunt-build-control'
  });

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    pkg: grunt.file.readJSON('package.json'),
    yeoman: {
      // configurable paths
      client: require('./bower.json').appPath || 'client',
      dist: 'dist'
    },
    express: {
      options: {
        port: process.env.PORT || 9000
      },
      dev: {
        options: {
          script: 'server/app.js',
          debug: true
        }
      },
      prod: {
        options: {
          script: 'dist/server/app.js'
        }
      }
    },
    open: {
      server: {
        url: 'http://localhost:<%= express.options.port %>'
      }
    },
    watch: {
      injectJS: {
        files: [
          '<%= yeoman.client %>/{app,components}/**/*.js',
          '!<%= yeoman.client %>/{app,components}/**/*.spec.js',
          '!<%= yeoman.client %>/{app,components}/**/*.mock.js',
          '!<%= yeoman.client %>/app/app.js'],
        tasks: ['injector:scripts']
      },
      injectCss: {
        files: [
          '<%= yeoman.client %>/{app,components}/**/*.css'
        ],
        tasks: ['injector:css']
      },
      mochaTest: {
        files: ['server/**/*.spec.js'],
        tasks: ['env:test', 'mochaTest']
      },
      jsTest: {
        files: [
          '<%= yeoman.client %>/{app,components}/**/*.spec.js',
          '<%= yeoman.client %>/{app,components}/**/*.mock.js'
        ],
        tasks: ['newer:jshint:all', 'karma']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        files: [
          '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.css',
          '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.html',
          '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js',
          '!{.tmp,<%= yeoman.client %>}{app,components}/**/*.spec.js',
          '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js',
          '<%= yeoman.client %>/assets/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}'
        ],
        options: {
          livereload: true
        }
      },
      express: {
        files: [
          'server/**/*.{js,json}'
        ],
        tasks: ['express:dev', 'wait'],
        options: {
          livereload: true,
          nospawn: true //Without this option specified express won't be reloaded
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '<%= yeoman.client %>/.jshintrc',
        reporter: require('jshint-stylish')
      },
      server: {
        options: {
          jshintrc: 'server/.jshintrc'
        },
        src: [
          'server/**/*.js',
          '!server/**/*.spec.js'
        ]
      },
      serverTest: {
        options: {
          jshintrc: 'server/.jshintrc-spec'
        },
        src: ['server/**/*.spec.js']
      },
      all: [
        '<%= yeoman.client %>/{app,components}/**/*.js',
        '!<%= yeoman.client %>/{app,components}/**/*.spec.js',
        '!<%= yeoman.client %>/{app,components}/**/*.mock.js'
      ],
      test: {
        src: [
          '<%= yeoman.client %>/{app,components}/**/*.spec.js',
          '<%= yeoman.client %>/{app,components}/**/*.mock.js'
        ]
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/*',
            '!<%= yeoman.dist %>/.git*',
            '!<%= yeoman.dist %>/.openshift',
            '!<%= yeoman.dist %>/Procfile'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/',
          src: '{,*/}*.css',
          dest: '.tmp/'
        }]
      }
    },

    // Debugging with node inspector
    'node-inspector': {
      custom: {
        options: {
          'web-host': 'localhost'
        }
      }
    },

    // Use nodemon to run server in debug mode with an initial breakpoint
    nodemon: {
      debug: {
        script: 'server/app.js',
        options: {
          nodeArgs: ['--debug-brk'],
          env: {
            PORT: process.env.PORT || 9000
          },
          callback: function (nodemon) {
            nodemon.on('log', function (event) {
              console.log(event.colour);
            });

            // opens browser on initial server start
            nodemon.on('config:update', function () {
              setTimeout(function () {
                require('open')('http://localhost:8080/debug?port=5858');
              }, 500);
            });
          }
        }
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      target: {
        src: '<%= yeoman.client %>/index.html',
        ignorePath: '<%= yeoman.client %>/',
        exclude: [/bootstrap-sass-official/, /bootstrap.js/, '/json3/', '/es5-shim/']
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= yeoman.dist %>/public/{,*/}*.js',
            '<%= yeoman.dist %>/public/{,*/}*.css',
            '<%= yeoman.dist %>/public/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= yeoman.dist %>/public/assets/fonts/*',
            '!<%= yeoman.dist %>/public/bower_components/Chart.js',
            '!<%= yeoman.dist %>/public/bower_components/angular-chart.js',
            '!<%= yeoman.dist %>/public/bower_components/animate.css'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: ['<%= yeoman.client %>/index.html'],
      options: {
        dest: '<%= yeoman.dist %>/public'
      }
    },

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/public/{,*/}*.html'],
      css: [
        '<%= yeoman.dist %>/public/{,*/}*.css',
        '!<%= yeoman.dist %>/public/bower_components/animate.css'
      ],
      js: [
        '<%= yeoman.dist %>/public/{,*/}*.js',
        '!<%= yeoman.dist %>/public/bower_components/Chart.js',
        '!<%= yeoman.dist %>/public/bower_components/angular-chart.js'
      ],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>/public',
          '<%= yeoman.dist %>/public/assets/images'
        ],
        // This is so we update image references in our ng-templates
        patterns: {
          js: [
            [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images']
          ]
        }
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.client %>/assets/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/public/assets/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.client %>/assets/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/public/assets/images'
        }]
      }
    },

    // Allow the use of non-minsafe AngularJS files. Automatically makes it
    // minsafe compatible so Uglify does not destroy the ng references
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat',
          src: '*/**.js',
          dest: '.tmp/concat'
        }]
      }
    },

    // Package all the html partials into a single javascript payload
    ngtemplates: {
      options: {
        // This should be the name of your apps angular module
        module: 'pumprApp',
        htmlmin: {
          collapseBooleanAttributes: true,
          collapseWhitespace: true,
          removeAttributeQuotes: true,
          removeEmptyAttributes: true,
          removeRedundantAttributes: true,
          removeScriptTypeAttributes: true,
          removeStyleLinkTypeAttributes: true
        },
        usemin: 'app/app.js'
      },
      main: {
        cwd: '<%= yeoman.client %>',
        src: ['{app,components}/**/*.html'],
        dest: '.tmp/templates.js'
      },
      tmp: {
        cwd: '.tmp',
        src: ['{app,components}/**/*.html'],
        dest: '.tmp/tmp-templates.js'
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/public/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.client %>',
          dest: '<%= yeoman.dist %>/public',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            'bower_components/**/*',
            'assets/images/**/*',
            'assets/fonts/**/*',
            'index.html'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/public/assets/images',
          src: ['generated/*']
        }, {
          expand: true,
          dest: '<%= yeoman.dist %>',
          src: [
            'package.json',
            'server/**/*'
          ]
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.client %>',
        dest: '.tmp/',
        src: ['{app,components}/**/*.css']
      }
    },

    buildcontrol: {
      options: {
        dir: 'dist',
        commit: true,
        push: true,
        connectCommits: false,
        message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
      },
      heroku: {
        options: {
          remote: 'heroku',
          branch: 'master'
        }
      },
      openshift: {
        options: {
          remote: 'openshift',
          branch: 'master'
        }
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
      ],
      test: [
      ],
      debug: {
        tasks: [
          'nodemon',
          'node-inspector'
        ],
        options: {
          logConcurrentOutput: true
        }
      },
      dist: [
        'imagemin',
        // 'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'karma.conf.js',
        singleRun: true
      }
    },

    mochaTest: {
      options: {
        reporter: 'spec'
      },
      src: ['server/**/*.spec.js']
    },

    protractor: {
      options: {
        configFile: 'protractor.conf.js'
      },
      chrome: {
        options: {
          args: {
            browser: 'chrome'
          }
        }
      }
    },

    env: {
      test: {
        NODE_ENV: 'test'
      },
      prod: {
        NODE_ENV: 'production'
      },
      all: localConfig
    },

    injector: {
      options: {

      },
      // Inject application script files into index.html (doesn't include bower)
      scripts: {
        options: {
          transform: function(filePath) {
            filePath = filePath.replace('/client/', '');
            filePath = filePath.replace('/.tmp/', '');
            return '<script src="' + filePath + '"></script>';
          },
          starttag: '<!-- injector:js -->',
          endtag: '<!-- endinjector -->'
        },
        files: {
          '<%= yeoman.client %>/index.html': [
              ['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js',
               '!{.tmp,<%= yeoman.client %>}/app/app.js',
               '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js',
               '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js']
            ]
        }
      },

      // Inject component css into index.html
      css: {
        options: {
          transform: function(filePath) {
            filePath = filePath.replace('/client/', '');
            filePath = filePath.replace('/.tmp/', '');
            return '<link rel="stylesheet" href="' + filePath + '">';
          },
          starttag: '<!-- injector:css -->',
          endtag: '<!-- endinjector -->'
        },
        files: {
          '<%= yeoman.client %>/index.html': [
            '<%= yeoman.client %>/{app,components}/**/*.css'
          ]
        }
      }
    },
  });

  // Used for delaying livereload until after server has restarted
  grunt.registerTask('wait', function () {
    grunt.log.ok('Waiting for server reload...');

    var done = this.async();

    setTimeout(function () {
      grunt.log.writeln('Done waiting!');
      done();
    }, 1500);
  });

  grunt.registerTask('express-keepalive', 'Keep grunt running', function() {
    this.async();
  });

  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'wait', 'open', 'express-keepalive']);
    }

    if (target === 'debug') {
      return grunt.task.run([
        'clean:server',
        'env:all',
        'concurrent:server',
        'injector',
        'wiredep',
        'autoprefixer',
        'concurrent:debug'
      ]);
    }

    grunt.task.run([
      'clean:server',
      'env:all',
      'concurrent:server',
      'injector',
      'wiredep',
      'autoprefixer',
      'express:dev',
      'wait',
      'open',
      'watch'
    ]);
  });

  grunt.registerTask('server', function () {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve']);
  });

  grunt.registerTask('test', function(target) {
    if (target === 'server') {
      return grunt.task.run([
        'env:all',
        'env:test',
        'mochaTest'
      ]);
    }

    else if (target === 'client') {
      return grunt.task.run([
        'clean:server',
        'env:all',
        'concurrent:test',
        'injector',
        'autoprefixer',
        'karma'
      ]);
    }

    else if (target === 'e2e') {
      return grunt.task.run([
        'clean:server',
        'env:all',
        'env:test',
        'concurrent:test',
        'injector',
        'wiredep',
        'autoprefixer',
        'express:dev',
        'protractor'
      ]);
    }

    else grunt.task.run([
      'test:server',
      'test:client'
    ]);
  });

  grunt.registerTask('build', [
    'clean:dist',
    // 'env:prod',
    'concurrent:dist',
    'injector',
    'wiredep',
    'useminPrepare',
    'autoprefixer',
    'ngtemplates',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'rev',
    'usemin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<commit_msg>removed concurrent:dist task<commit_after>// Generated on 2015-04-15 using generator-angular-fullstack 2.0.13
'use strict';

module.exports = function (grunt) {
  var localConfig;
  try {
    localConfig = require('./server/config/local.env');
  } catch(e) {
    localConfig = {};
  }

  // Load grunt tasks automatically, when needed
  require('jit-grunt')(grunt, {
    express: 'grunt-express-server',
    useminPrepare: 'grunt-usemin',
    ngtemplates: 'grunt-angular-templates',
    cdnify: 'grunt-google-cdn',
    protractor: 'grunt-protractor-runner',
    injector: 'grunt-asset-injector',
    buildcontrol: 'grunt-build-control'
  });

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    pkg: grunt.file.readJSON('package.json'),
    yeoman: {
      // configurable paths
      client: require('./bower.json').appPath || 'client',
      dist: 'dist'
    },
    express: {
      options: {
        port: process.env.PORT || 9000
      },
      dev: {
        options: {
          script: 'server/app.js',
          debug: true
        }
      },
      prod: {
        options: {
          script: 'dist/server/app.js'
        }
      }
    },
    open: {
      server: {
        url: 'http://localhost:<%= express.options.port %>'
      }
    },
    watch: {
      injectJS: {
        files: [
          '<%= yeoman.client %>/{app,components}/**/*.js',
          '!<%= yeoman.client %>/{app,components}/**/*.spec.js',
          '!<%= yeoman.client %>/{app,components}/**/*.mock.js',
          '!<%= yeoman.client %>/app/app.js'],
        tasks: ['injector:scripts']
      },
      injectCss: {
        files: [
          '<%= yeoman.client %>/{app,components}/**/*.css'
        ],
        tasks: ['injector:css']
      },
      mochaTest: {
        files: ['server/**/*.spec.js'],
        tasks: ['env:test', 'mochaTest']
      },
      jsTest: {
        files: [
          '<%= yeoman.client %>/{app,components}/**/*.spec.js',
          '<%= yeoman.client %>/{app,components}/**/*.mock.js'
        ],
        tasks: ['newer:jshint:all', 'karma']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        files: [
          '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.css',
          '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.html',
          '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js',
          '!{.tmp,<%= yeoman.client %>}{app,components}/**/*.spec.js',
          '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js',
          '<%= yeoman.client %>/assets/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}'
        ],
        options: {
          livereload: true
        }
      },
      express: {
        files: [
          'server/**/*.{js,json}'
        ],
        tasks: ['express:dev', 'wait'],
        options: {
          livereload: true,
          nospawn: true //Without this option specified express won't be reloaded
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '<%= yeoman.client %>/.jshintrc',
        reporter: require('jshint-stylish')
      },
      server: {
        options: {
          jshintrc: 'server/.jshintrc'
        },
        src: [
          'server/**/*.js',
          '!server/**/*.spec.js'
        ]
      },
      serverTest: {
        options: {
          jshintrc: 'server/.jshintrc-spec'
        },
        src: ['server/**/*.spec.js']
      },
      all: [
        '<%= yeoman.client %>/{app,components}/**/*.js',
        '!<%= yeoman.client %>/{app,components}/**/*.spec.js',
        '!<%= yeoman.client %>/{app,components}/**/*.mock.js'
      ],
      test: {
        src: [
          '<%= yeoman.client %>/{app,components}/**/*.spec.js',
          '<%= yeoman.client %>/{app,components}/**/*.mock.js'
        ]
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/*',
            '!<%= yeoman.dist %>/.git*',
            '!<%= yeoman.dist %>/.openshift',
            '!<%= yeoman.dist %>/Procfile'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/',
          src: '{,*/}*.css',
          dest: '.tmp/'
        }]
      }
    },

    // Debugging with node inspector
    'node-inspector': {
      custom: {
        options: {
          'web-host': 'localhost'
        }
      }
    },

    // Use nodemon to run server in debug mode with an initial breakpoint
    nodemon: {
      debug: {
        script: 'server/app.js',
        options: {
          nodeArgs: ['--debug-brk'],
          env: {
            PORT: process.env.PORT || 9000
          },
          callback: function (nodemon) {
            nodemon.on('log', function (event) {
              console.log(event.colour);
            });

            // opens browser on initial server start
            nodemon.on('config:update', function () {
              setTimeout(function () {
                require('open')('http://localhost:8080/debug?port=5858');
              }, 500);
            });
          }
        }
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      target: {
        src: '<%= yeoman.client %>/index.html',
        ignorePath: '<%= yeoman.client %>/',
        exclude: [/bootstrap-sass-official/, /bootstrap.js/, '/json3/', '/es5-shim/']
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= yeoman.dist %>/public/{,*/}*.js',
            '<%= yeoman.dist %>/public/{,*/}*.css',
            '<%= yeoman.dist %>/public/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= yeoman.dist %>/public/assets/fonts/*',
            '!<%= yeoman.dist %>/public/bower_components/Chart.js',
            '!<%= yeoman.dist %>/public/bower_components/angular-chart.js',
            '!<%= yeoman.dist %>/public/bower_components/animate.css'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: ['<%= yeoman.client %>/index.html'],
      options: {
        dest: '<%= yeoman.dist %>/public'
      }
    },

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/public/{,*/}*.html'],
      css: [
        '<%= yeoman.dist %>/public/{,*/}*.css',
        '!<%= yeoman.dist %>/public/bower_components/animate.css'
      ],
      js: [
        '<%= yeoman.dist %>/public/{,*/}*.js',
        '!<%= yeoman.dist %>/public/bower_components/Chart.js',
        '!<%= yeoman.dist %>/public/bower_components/angular-chart.js'
      ],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>/public',
          '<%= yeoman.dist %>/public/assets/images'
        ],
        // This is so we update image references in our ng-templates
        patterns: {
          js: [
            [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images']
          ]
        }
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.client %>/assets/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/public/assets/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.client %>/assets/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/public/assets/images'
        }]
      }
    },

    // Allow the use of non-minsafe AngularJS files. Automatically makes it
    // minsafe compatible so Uglify does not destroy the ng references
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat',
          src: '*/**.js',
          dest: '.tmp/concat'
        }]
      }
    },

    // Package all the html partials into a single javascript payload
    ngtemplates: {
      options: {
        // This should be the name of your apps angular module
        module: 'pumprApp',
        htmlmin: {
          collapseBooleanAttributes: true,
          collapseWhitespace: true,
          removeAttributeQuotes: true,
          removeEmptyAttributes: true,
          removeRedundantAttributes: true,
          removeScriptTypeAttributes: true,
          removeStyleLinkTypeAttributes: true
        },
        usemin: 'app/app.js'
      },
      main: {
        cwd: '<%= yeoman.client %>',
        src: ['{app,components}/**/*.html'],
        dest: '.tmp/templates.js'
      },
      tmp: {
        cwd: '.tmp',
        src: ['{app,components}/**/*.html'],
        dest: '.tmp/tmp-templates.js'
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/public/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.client %>',
          dest: '<%= yeoman.dist %>/public',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            'bower_components/**/*',
            'assets/images/**/*',
            'assets/fonts/**/*',
            'index.html'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/public/assets/images',
          src: ['generated/*']
        }, {
          expand: true,
          dest: '<%= yeoman.dist %>',
          src: [
            'package.json',
            'server/**/*'
          ]
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.client %>',
        dest: '.tmp/',
        src: ['{app,components}/**/*.css']
      }
    },

    buildcontrol: {
      options: {
        dir: 'dist',
        commit: true,
        push: true,
        connectCommits: false,
        message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
      },
      heroku: {
        options: {
          remote: 'heroku',
          branch: 'master'
        }
      },
      openshift: {
        options: {
          remote: 'openshift',
          branch: 'master'
        }
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
      ],
      test: [
      ],
      debug: {
        tasks: [
          'nodemon',
          'node-inspector'
        ],
        options: {
          logConcurrentOutput: true
        }
      },
      dist: [
        'imagemin',
        // 'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'karma.conf.js',
        singleRun: true
      }
    },

    mochaTest: {
      options: {
        reporter: 'spec'
      },
      src: ['server/**/*.spec.js']
    },

    protractor: {
      options: {
        configFile: 'protractor.conf.js'
      },
      chrome: {
        options: {
          args: {
            browser: 'chrome'
          }
        }
      }
    },

    env: {
      test: {
        NODE_ENV: 'test'
      },
      prod: {
        NODE_ENV: 'production'
      },
      all: localConfig
    },

    injector: {
      options: {

      },
      // Inject application script files into index.html (doesn't include bower)
      scripts: {
        options: {
          transform: function(filePath) {
            filePath = filePath.replace('/client/', '');
            filePath = filePath.replace('/.tmp/', '');
            return '<script src="' + filePath + '"></script>';
          },
          starttag: '<!-- injector:js -->',
          endtag: '<!-- endinjector -->'
        },
        files: {
          '<%= yeoman.client %>/index.html': [
              ['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js',
               '!{.tmp,<%= yeoman.client %>}/app/app.js',
               '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js',
               '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js']
            ]
        }
      },

      // Inject component css into index.html
      css: {
        options: {
          transform: function(filePath) {
            filePath = filePath.replace('/client/', '');
            filePath = filePath.replace('/.tmp/', '');
            return '<link rel="stylesheet" href="' + filePath + '">';
          },
          starttag: '<!-- injector:css -->',
          endtag: '<!-- endinjector -->'
        },
        files: {
          '<%= yeoman.client %>/index.html': [
            '<%= yeoman.client %>/{app,components}/**/*.css'
          ]
        }
      }
    },
  });

  // Used for delaying livereload until after server has restarted
  grunt.registerTask('wait', function () {
    grunt.log.ok('Waiting for server reload...');

    var done = this.async();

    setTimeout(function () {
      grunt.log.writeln('Done waiting!');
      done();
    }, 1500);
  });

  grunt.registerTask('express-keepalive', 'Keep grunt running', function() {
    this.async();
  });

  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'wait', 'open', 'express-keepalive']);
    }

    if (target === 'debug') {
      return grunt.task.run([
        'clean:server',
        'env:all',
        'concurrent:server',
        'injector',
        'wiredep',
        'autoprefixer',
        'concurrent:debug'
      ]);
    }

    grunt.task.run([
      'clean:server',
      'env:all',
      'concurrent:server',
      'injector',
      'wiredep',
      'autoprefixer',
      'express:dev',
      'wait',
      'open',
      'watch'
    ]);
  });

  grunt.registerTask('server', function () {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve']);
  });

  grunt.registerTask('test', function(target) {
    if (target === 'server') {
      return grunt.task.run([
        'env:all',
        'env:test',
        'mochaTest'
      ]);
    }

    else if (target === 'client') {
      return grunt.task.run([
        'clean:server',
        'env:all',
        'concurrent:test',
        'injector',
        'autoprefixer',
        'karma'
      ]);
    }

    else if (target === 'e2e') {
      return grunt.task.run([
        'clean:server',
        'env:all',
        'env:test',
        'concurrent:test',
        'injector',
        'wiredep',
        'autoprefixer',
        'express:dev',
        'protractor'
      ]);
    }

    else grunt.task.run([
      'test:server',
      'test:client'
    ]);
  });

  grunt.registerTask('build', [
    'clean:dist',
    // 'env:prod',
    // 'concurrent:dist',
    'injector',
    'wiredep',
    'useminPrepare',
    'autoprefixer',
    'ngtemplates',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'rev',
    'usemin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {

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

  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    language: grunt.option('lang') || 'en',

    meta: {
      banner: '/**\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      ' * <%= pkg.homepage %>\n' +
      ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
      ' * License: <%= pkg.license %>\n */\n'
    },

    build_dir: 'dist',

    files: {

      core: [
        'src/valdr.js',
        'src/core/valdrUtil-service.js',
        'src/core/validators/requiredValidator.js',
        'src/core/validators/minValidator.js',
        'src/core/validators/maxValidator.js',
        'src/core/validators/sizeValidator.js',
        'src/core/validators/emailValidator.js',
        'src/core/validators/urlValidator.js',
        'src/core/validators/digitsValidator.js',
        'src/core/validators/futureAndPastSharedValidator.js',
        'src/core/validators/pastValidator.js',
        'src/core/validators/futureValidator.js',
        'src/core/validators/patternValidator.js',
        'src/core/validators/minLengthValidator.js',
        'src/core/validators/maxLengthValidator.js',
        'src/core/validators/hibernateEmailValidator.js',
        'src/core/valdr-service.js',
        'src/core/valdrType-directive.js',
        'src/core/valdrFormItem-directive.js'
      ],

      message: [
        'src/message/valdrMessage-service.js',
        'src/message/valdrMessage-directive.js'
      ],

      test: ['src/**/*.spec.js']
    },

    jshint: {

      options: {
        jshintrc: true
      },

      all: ['Gruntfile.js', '<%= files.core %>', '<%= files.message %>', '<%= files.test %>'],

      test: {
        files: {
          src: ['<%= files.test %>']
        }
      }
    },

    concat: {

      banner: {
        options: {
          banner: '<%= meta.banner %>'
        },
        src: '<%= concat.core.dest %>',
        dest: '<%= concat.core.dest %>'
      },

      core: {
        src: ['js.prefix', '<%= files.core %>', 'js.suffix'],
        dest: '<%= build_dir %>/valdr.js'
      },

      message: {
        src: ['js.prefix', '<%= files.message %>', 'js.suffix'],
        dest: '<%= build_dir %>/valdr-message.js'
      }

    },

    uglify: {
      core: {
        files: {
          '<%= build_dir %>/valdr.min.js': '<%= concat.core.dest %>'
        }
      },
      message: {
        files: {
          '<%= build_dir %>/valdr-message.min.js': '<%= concat.message.dest %>'
        }
      }
    },

    karma: {
      'unit': {
        configFile: 'karma.conf.js',
        singleRun: true,
        browsers: ['PhantomJS']
      },

      'chrome-unit': {
        configFile: 'karma.conf.js',
        singleRun: true,
        browsers: ['Chrome']
      },

      'firefox-unit': {
        configFile: 'karma.conf.js',
        singleRun: true,
        browsers: ['Firefox']
      }
    },

    copy: {

      demo: {
        files: [{
          src: '*.js',
          dest: 'demo/js/',
          cwd: 'dist/',
          expand: true
        }]
      }
    },

    watch: {
      livereload: {
        options: {
          livereload: true
        },
        files: ['src/**/*.js'],
        tasks: ['concat:core', 'concat:message', 'concat:banner', 'uglify:core', 'uglify:message', 'copy:demo']
      }
    },

    express: {
      server: {
        options: {
          port: 3005,
          bases: '.',
          server: __dirname + '/server.js'
        }
      }
    }
  });

  grunt.registerTask('default', ['jshint:all', 'karma:unit']);
  grunt.registerTask('test', ['karma:unit']);

  // Advanced test tasks
  grunt.registerTask('test-chrome', ['karma:chrome-unit']);
  grunt.registerTask('test-firefox', ['karma:firefox-unit']);
  grunt.registerTask('test-all', ['karma']);

  grunt.registerTask('build', [
    'jshint:all',
    'karma:unit',
    'concat:core',
    'concat:message',
    'concat:banner',
    'uglify:core',
    'uglify:message'
  ]);

  // For development purpose.
  grunt.registerTask('dev', [
    'build',
    'copy:demo',
    'watch:livereload'
  ]);
  grunt.registerTask('server', [
    'express',
    'express-keepalive'
  ]);
};
<commit_msg>chore(build): lint when running the tests<commit_after>'use strict';

module.exports = function (grunt) {

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

  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    language: grunt.option('lang') || 'en',

    meta: {
      banner: '/**\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      ' * <%= pkg.homepage %>\n' +
      ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
      ' * License: <%= pkg.license %>\n */\n'
    },

    build_dir: 'dist',

    files: {

      core: [
        'src/valdr.js',
        'src/core/valdrUtil-service.js',
        'src/core/validators/requiredValidator.js',
        'src/core/validators/minValidator.js',
        'src/core/validators/maxValidator.js',
        'src/core/validators/sizeValidator.js',
        'src/core/validators/emailValidator.js',
        'src/core/validators/urlValidator.js',
        'src/core/validators/digitsValidator.js',
        'src/core/validators/futureAndPastSharedValidator.js',
        'src/core/validators/pastValidator.js',
        'src/core/validators/futureValidator.js',
        'src/core/validators/patternValidator.js',
        'src/core/validators/minLengthValidator.js',
        'src/core/validators/maxLengthValidator.js',
        'src/core/validators/hibernateEmailValidator.js',
        'src/core/valdr-service.js',
        'src/core/valdrType-directive.js',
        'src/core/valdrFormItem-directive.js'
      ],

      message: [
        'src/message/valdrMessage-service.js',
        'src/message/valdrMessage-directive.js'
      ],

      test: ['src/**/*.spec.js']
    },

    jshint: {

      options: {
        jshintrc: true
      },

      all: ['Gruntfile.js', '<%= files.core %>', '<%= files.message %>', '<%= files.test %>'],

      test: {
        files: {
          src: ['<%= files.test %>']
        }
      }
    },

    concat: {

      banner: {
        options: {
          banner: '<%= meta.banner %>'
        },
        src: '<%= concat.core.dest %>',
        dest: '<%= concat.core.dest %>'
      },

      core: {
        src: ['js.prefix', '<%= files.core %>', 'js.suffix'],
        dest: '<%= build_dir %>/valdr.js'
      },

      message: {
        src: ['js.prefix', '<%= files.message %>', 'js.suffix'],
        dest: '<%= build_dir %>/valdr-message.js'
      }

    },

    uglify: {
      core: {
        files: {
          '<%= build_dir %>/valdr.min.js': '<%= concat.core.dest %>'
        }
      },
      message: {
        files: {
          '<%= build_dir %>/valdr-message.min.js': '<%= concat.message.dest %>'
        }
      }
    },

    karma: {
      'unit': {
        configFile: 'karma.conf.js',
        singleRun: true,
        browsers: ['PhantomJS']
      },

      'chrome-unit': {
        configFile: 'karma.conf.js',
        singleRun: true,
        browsers: ['Chrome']
      },

      'firefox-unit': {
        configFile: 'karma.conf.js',
        singleRun: true,
        browsers: ['Firefox']
      }
    },

    copy: {

      demo: {
        files: [{
          src: '*.js',
          dest: 'demo/js/',
          cwd: 'dist/',
          expand: true
        }]
      }
    },

    watch: {
      livereload: {
        options: {
          livereload: true
        },
        files: ['src/**/*.js'],
        tasks: ['concat:core', 'concat:message', 'concat:banner', 'uglify:core', 'uglify:message', 'copy:demo']
      }
    },

    express: {
      server: {
        options: {
          port: 3005,
          bases: '.',
          server: __dirname + '/server.js'
        }
      }
    }
  });

  grunt.registerTask('test', ['jshint:all', 'karma:unit']);
  grunt.registerTask('default', ['test']);

  // Advanced test tasks
  grunt.registerTask('test-chrome', ['karma:chrome-unit']);
  grunt.registerTask('test-firefox', ['karma:firefox-unit']);
  grunt.registerTask('test-all', ['karma']);

  grunt.registerTask('build', [
    'jshint:all',
    'karma:unit',
    'concat:core',
    'concat:message',
    'concat:banner',
    'uglify:core',
    'uglify:message'
  ]);

  // For development purpose.
  grunt.registerTask('dev', [
    'build',
    'copy:demo',
    'watch:livereload'
  ]);
  grunt.registerTask('server', [
    'express',
    'express-keepalive'
  ]);
};
<|endoftext|>


<commit_before>var exec = require('child_process').exec;

var BIN = './node_modules/.bin/';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		mochaTest: {
			options: {
				timeout: 3000,
				ignoreLeaks: false,
				reporter: 'spec'
			},
			src: ['test/**/*_test.js']
		},
		jshint: {
			options: {
				jshintrc: true
			},
			src: ['lib/**/*.js', 'test/**/*.js']
		},
		clean: {
			src: ['tmp']
		},
		istanbul: {
			src: ['test/**/*_test.js']
		}
	});

	// Load grunt plugins for modules
	grunt.loadNpmTasks('grunt-mocha-test');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');

	// Register tasks
	grunt.registerMultiTask('istanbul', 'generate test coverage report', function() {
		var done = this.async(),
			cmd = BIN + 'istanbul cover --report html ' + BIN + '_mocha -- -R min ' +
				this.filesSrc.reduce(function(p,c) { return (p || '') + ' "' + c + '" '; });

		grunt.log.debug(cmd);
		exec(cmd, function(err, stdout, stderr) {
			if (err) { grunt.fail.fatal(err); }
			if (/No coverage information was collected/.test(stderr)) {
				grunt.fail.warn('No coverage information was collected. Report not generated.');
			} else {
				grunt.log.ok('test coverage report generated to "./coverage/index.html"');
			}
			done();
		});
	});
	grunt.registerTask('coverage', ['istanbul', 'clean']);
	grunt.registerTask('test', ['mochaTest']);
	grunt.registerTask('default', ['jshint', 'mochaTest', 'clean']);

};<commit_msg>add _tmp to clean<commit_after>var exec = require('child_process').exec;

var BIN = './node_modules/.bin/';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		mochaTest: {
			options: {
				timeout: 3000,
				ignoreLeaks: false,
				reporter: 'spec'
			},
			src: ['test/**/*_test.js']
		},
		jshint: {
			options: {
				jshintrc: true
			},
			src: ['lib/**/*.js', 'test/**/*.js']
		},
		clean: {
			src: ['tmp','_tmp']
		},
		istanbul: {
			src: ['test/**/*_test.js']
		}
	});

	// Load grunt plugins for modules
	grunt.loadNpmTasks('grunt-mocha-test');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');

	// Register tasks
	grunt.registerMultiTask('istanbul', 'generate test coverage report', function() {
		var done = this.async(),
			cmd = BIN + 'istanbul cover --report html ' + BIN + '_mocha -- -R min ' +
				this.filesSrc.reduce(function(p,c) { return (p || '') + ' "' + c + '" '; });

		grunt.log.debug(cmd);
		exec(cmd, function(err, stdout, stderr) {
			if (err) { grunt.fail.fatal(err); }
			if (/No coverage information was collected/.test(stderr)) {
				grunt.fail.warn('No coverage information was collected. Report not generated.');
			} else {
				grunt.log.ok('test coverage report generated to "./coverage/index.html"');
			}
			done();
		});
	});
	grunt.registerTask('coverage', ['istanbul', 'clean']);
	grunt.registerTask('test', ['mochaTest']);
	grunt.registerTask('default', ['jshint', 'mochaTest', 'clean']);

};<|endoftext|>


<commit_before>"use strict";

module.exports = require('grunto')(function(grunt) {

	grunt.registerTask('default', [
		'newer:jshint:all',
		'nodeunit',
		'watch'
	]);

	return {
		nodeunit: {
			all: [
				'tests/*.js'
			],
			options: {
			}
		},
		'jshint': {
			options: grunt.file.readJSON('.jshintrc'),
			all: [
				'**/*.{js,json}',
				'!node_modules/**/*.{js,json}',
				'!lib-cov/**/*.{js,json}'
			]
		},
		watch: {
			files: [
				'lib/**/*',
				'tests/**/*'
			],
			tasks: [
				'newer:jshint:all',
				'nodeunit'
			]
		}
	};

});<commit_msg>add eslint task<commit_after>'use strict';

var grunto = require('grunto');

module.exports = grunto(function (grunt) {

	grunt.registerTask('test', [
		'newer:eslint',
		'nodeunit'
	]);

	grunt.registerTask('default', [
		'test',
		'watch'
	]);

	return {
		nodeunit: {
			all: [
				'tests/*.js'
			]
		},
		eslint: {
			all: [
				'**/*.js',
				'!lib/**/*.js',
				'!node_modules/**/*',
				'!lib-cov/**/*'
			]
		},
		watch: {
			files: [
				'lib/**/*',
				'tests/**/*'
			],
			tasks: [
				'test'
			]
		}
	};
});
<|endoftext|>


<commit_before>module.exports = function (grunt) {
	"use strict";

	// initializes all grunt tasks, no need to load every task by itself
	require('load-grunt-tasks')(grunt);

	// create some nice statistics for time consumption of every task
	require('time-grunt')(grunt);

	grunt.initConfig({

		// reads the package.json and provide e.g. the package name
		pkg: grunt.file.readJSON('package.json'),

		// reads the deploy parameters username, password
		deploy: grunt.file.readJSON('deploy.json'),

		// removes all files from the specified folders
		clean: {
			dist: ['dist/'],
			tmp: ['.tmp/']
		},

		// checks the style of the javascript files
		jshint: {
			options: {
				curly: true,
				eqeqeq: true,
				unused: true,
				bitwise: true,
				forin: true,
				freeze: true,
				undef: true,
				strict: true,
				globals: {
					app: true,
					window: true,
					document: true,
					jQuery: true,
					angular: true,
					Uint8Array: false,
					ArrayBuffer: false
				}
			},
			prod: {
				src: ['src/js/**/*.js']
			},
			dev: {
				options: {
					globals: {
						// console is allowed in dev mode
						app: true,
						console: true,
						window: true,
						document: true,
						jQuery: true,
						angular: true,
						Uint8Array: false,
						ArrayBuffer: false
					}
				},
				src: ['src/js/**/*.js']
			},
			gruntfile: {
				options: {
					strict: true,
					globals: {
						require: true,
						module: true,
						Uint8Array: false,
						ArrayBuffer: false
					}
				},
				src: ['Gruntfile.js']
			}
		},

		jscs: {
			final: {
				options: {
					disallowArrowFunctions: true,
					disallowEmptyBlocks: true,
					disallowIdentifierNames: ['temp', 'foo', 'bar'],
					disallowMixedSpacesAndTabs: true,
					disallowMultiLineTernary: true,
					disallowMultipleLineBreaks: true,
					disallowMultipleLineStrings: true,
					disallowMultipleSpaces: true,
					disallowNestedTernaries: true,
					disallowNewlineBeforeBlockStatements: true,
					disallowOperatorBeforeLineBreak: ["+", "."],
					disallowSpaceAfterObjectKeys: true,
					disallowSpaceBeforeComma: true,
					disallowSpaceBeforeSemicolon: true,
					disallowSpacesInCallExpression: true,
					disallowTrailingComma: true,
					disallowTrailingWhitespace: true,
					disallowUnusedParams: true,
					disallowYodaConditions: true,
					requireBlocksOnNewline: true,
					requireCamelCaseOrUpperCaseIdentifiers: true,
					requireCommaBeforeLineBreak: true,
					requireCurlyBraces: true,
					requireKeywordsOnNewLine: ["else"],
					requireLineBreakAfterVariableAssignment: true,
					requireMatchingFunctionName: true,
					requirePaddingNewLinesAfterUseStrict: true,
					requireParenthesesAroundIIFE: true,
					requireSemicolons: true,
					requireSpaceAfterBinaryOperators: true,
					requireSpaceAfterComma: true,
					requireSpaceAfterLineComment: true,
					requireSpaceBeforeBinaryOperators: true,
					requireSpaceBeforeBlockStatements: true,
					requireSpaceBeforeObjectValues: true,
					requireSpaceBetweenArguments: true,
					requireSpacesInConditionalExpression: true,
					requireSpacesInForStatement: true,
					requireSpacesInsideObjectBrackets: "all",
					validateParameterSeparator: ", ",
					validateIndentation: "\t"
				},
				files: {
					src: ['src/js/**/*.js']
				}
			}
		},

		// compiles the sass code to css code
		sass: {
			dist: {
				files: [{
					expand: true,
					cwd: 'src/sass',
					src: ['*.{scss,sass}'],
					dest: '.tmp/styles',
					ext: '.css'
				}]
			}
		},

		// copies the specified files
		copy: {
			regular: {
				files: [{
					// fonts
					expand: true,
					flatten: true,
					src: ['bower_components/font-awesome/fonts/*.*', 'bower_components/bootstrap/fonts/*.*'],
					dest: 'dist/fonts/'
				}, {
					// images
					expand: true,
					flatten: true,
					src: ['bower_components/jcrop/css/*.gif', 'src/images/*'],
					dest: 'dist/styles/'
				}, {
					// index.html
					expand: true,
					cwd: 'src/html/',
					src: ['index.html'],
					dest: 'dist/'
				}]
			}
		},

		// converts language.json into productive form
		convertLanguageJson: {
			json: {
				options: {
					prefix: "reimbursement."
				},
				files: [{
					src: 'src/languages/languages.json',
					dest: 'dist/languages/languages.json',
					destType: 'file'
				}]
			}
		},

		// adds some necessary css prefixes like -webkit-
		autoprefixer: {
			options: {
				browsers: '> 2% in CH'
			},
			css: {
				src: 'dist/styles/app.css'
			}
		},

		// minifies the css code
		cssmin: {
			options: {
				keepSpecialComments: 0
			},
			target: {
				files: {
					'dist/styles/app.css': 'dist/styles/app.css',
					'dist/styles/libraries.css': 'dist/styles/libraries.css'
				}
			}
		},

		// uglifies the javascript code
		uglify: {
			js: {
				files: {
					'dist/javascript/app.js': 'dist/javascript/app.js',
					'dist/javascript/libraries.js': 'dist/javascript/libraries.js'
				}
			}
		},

		filerev: {
			options: {
				algorithm: 'md5',
				length: 25
			},
			dist: {
				files: [{
					src: [
						'dist/languages/*.json',
						'dist/javascript/*.js',
						'dist/styles/*.css'
					]
				}]
			}
		},

		// concats all css & js files from the index.html
		useminPrepare: {
			dev: 'src/html/index.html',
			options: {
				dest: 'dist',
				staging: '.tmp',
				flow: {
					steps: {
						js: ['concat'],
						css: ['concat']
					},
					// bugfix for usemin custom flow:
					post: []
				}
			}
		},

		// replaces the source files from index.html
		usemin: {
			html: ['dist/index.html'],
			options: {
				assetsDirs: ['dist']
			}
		},

		// concats only the app.js with templates.js (from html2js)
		concat: {
			appWithTemplates: {
				files: {
					'dist/javascript/app.js': ['.tmp/concat/templates.js', 'dist/javascript/app.js']
				}
			}
		},

		// converts all the html files to one single js template file
		html2js: {
			options: {
				base: 'src/html/templates/',
				module: 'reimbursement.templates',
				quoteChar: '\''
			},
			dev: {
				src: [ 'src/html/templates/**/*.tpl.html' ],
				dest: '.tmp/concat/templates.js'
			},
			prod: {
				options: {
					htmlmin: {
						collapseBooleanAttributes: true,
						collapseWhitespace: true,
						conservativeCollapse: true,
						removeComments: true
					}
				},
				src: [ 'src/html/templates/**/*.tpl.html' ],
				dest: '.tmp/concat/templates.js'
			}
		},

		htmlmin: {
			indexFile: {
				options: {
					collapseBooleanAttributes: true,
					collapseWhitespace: true,
					removeComments: true
					// conservative collapse is not necessary in index.html, because it contains no
					// elements styles with display: inline-block. if that changes, change this property
					/* conservativeCollapse: true */
				},
				files: {
					'dist/index.html': 'dist/index.html'
				}
			}
		},

		war: {
			target: {
				options: {
					war_dist_folder: 'dist',
					war_name: 'reimbursement-frontend',
					webxml_welcome: 'index.html',
					webxml_display_name: 'Reimbursement Front-End'
				},
				files: [{
					expand: true,
					cwd: 'dist',
					src: ['**'],
					dest: ''
				}]
			}
		},

		// upload the built war file
		http_upload: {
			prod: {
				options: {
					url: 'http://<%=deploy.username%>:<%=deploy.password%>@192.41.136.228/manager/text/deploy?path=&update=true',
					method: 'PUT',
					rejectUnauthorized: true
				},
				src: 'dist/reimbursement-frontend.war',
				dest: 'reimbursement-frontend'
			},
			int: {
				options: {
					url: 'http://<%=deploy.username%>:<%=deploy.password%>@192.41.136.227/manager/text/deploy?path=&update=true',
					method: 'PUT',
					rejectUnauthorized: true
				},
				src: 'dist/reimbursement-frontend.war',
				dest: 'reimbursement-frontend'
			}
		},

		// process, which monitors all source files and recompiles after a change
		watch: {
			options: {
				livereload: true
			},
			dev: {
				files: ['src/**/*.*'],
				tasks: ['default']
			},
			prod: {
				files: ['src/**/*.*'],
				tasks: ['prod']
			}
		},

		// starts a server and deploys the specified files
		connect: {
			dist: {
				options: {
					port: 9005,
					base: 'dist',
					open: 'http://<%= connect.dist.options.hostname %>:<%= connect.dist.options.port %>',
					hostname: 'localhost',
					livereload: true
				}
			}
		}

	});

	// the default grunt task, just call "grunt" and it will be executed
	grunt.registerTask('default', [
		'jshint:gruntfile',
		'jshint:dev',
		'jscs',
		'clean',
		'sass',
		'useminPrepare',
		'concat:generated',
		'html2js:dev',
		'concat:appWithTemplates',
		'autoprefixer',
		'copy',
		'convertLanguageJson',
		'filerev',
		'usemin',
		'clean:tmp'
	]);

	// the productive process, which also minifies. it can be started by calling "grunt prod"
	grunt.registerTask('prod', [
		'jshint:gruntfile',
		'jshint:prod',
		'jscs',
		'clean',
		'sass',
		'useminPrepare',
		'concat:generated',
		'html2js:prod',
		'concat:appWithTemplates',
		'autoprefixer',
		'copy',
		'convertLanguageJson',
		'uglify',
		'cssmin',
		'filerev',
		'usemin',
		'htmlmin',
		'clean:tmp'
	]);

	// starts a server instance with live deployment. it can be started by calling "grunt serve"
	grunt.registerTask('serve', [
		'default',
		'connect',
		'watch:dev'
	]);

	// starts a server instance with live deployment. it always takes the minified and uglified resources.
	grunt.registerTask('prod-serve', [
		'prod',
		'connect',
		'watch:prod'
	]);

	// deploys the application to the production tomcat server
	grunt.registerTask('deploy-prod', [
		'prod',
		'war',
		'http_upload:prod'
	]);

	// deploys the application to the integration tomcat server
	grunt.registerTask('deploy-int', [
		'prod',
		'war',
		'http_upload:int'
	]);

};
<commit_msg>renamed war to ROOT<commit_after>module.exports = function (grunt) {
	"use strict";

	// initializes all grunt tasks, no need to load every task by itself
	require('load-grunt-tasks')(grunt);

	// create some nice statistics for time consumption of every task
	require('time-grunt')(grunt);

	grunt.initConfig({

		// reads the package.json and provide e.g. the package name
		pkg: grunt.file.readJSON('package.json'),

		// reads the deploy parameters username, password
		deploy: grunt.file.readJSON('deploy.json'),

		// removes all files from the specified folders
		clean: {
			dist: ['dist/'],
			tmp: ['.tmp/']
		},

		// checks the style of the javascript files
		jshint: {
			options: {
				curly: true,
				eqeqeq: true,
				unused: true,
				bitwise: true,
				forin: true,
				freeze: true,
				undef: true,
				strict: true,
				globals: {
					app: true,
					window: true,
					document: true,
					jQuery: true,
					angular: true,
					Uint8Array: false,
					ArrayBuffer: false
				}
			},
			prod: {
				src: ['src/js/**/*.js']
			},
			dev: {
				options: {
					globals: {
						// console is allowed in dev mode
						app: true,
						console: true,
						window: true,
						document: true,
						jQuery: true,
						angular: true,
						Uint8Array: false,
						ArrayBuffer: false
					}
				},
				src: ['src/js/**/*.js']
			},
			gruntfile: {
				options: {
					strict: true,
					globals: {
						require: true,
						module: true,
						Uint8Array: false,
						ArrayBuffer: false
					}
				},
				src: ['Gruntfile.js']
			}
		},

		jscs: {
			final: {
				options: {
					disallowArrowFunctions: true,
					disallowEmptyBlocks: true,
					disallowIdentifierNames: ['temp', 'foo', 'bar'],
					disallowMixedSpacesAndTabs: true,
					disallowMultiLineTernary: true,
					disallowMultipleLineBreaks: true,
					disallowMultipleLineStrings: true,
					disallowMultipleSpaces: true,
					disallowNestedTernaries: true,
					disallowNewlineBeforeBlockStatements: true,
					disallowOperatorBeforeLineBreak: ["+", "."],
					disallowSpaceAfterObjectKeys: true,
					disallowSpaceBeforeComma: true,
					disallowSpaceBeforeSemicolon: true,
					disallowSpacesInCallExpression: true,
					disallowTrailingComma: true,
					disallowTrailingWhitespace: true,
					disallowUnusedParams: true,
					disallowYodaConditions: true,
					requireBlocksOnNewline: true,
					requireCamelCaseOrUpperCaseIdentifiers: true,
					requireCommaBeforeLineBreak: true,
					requireCurlyBraces: true,
					requireKeywordsOnNewLine: ["else"],
					requireLineBreakAfterVariableAssignment: true,
					requireMatchingFunctionName: true,
					requirePaddingNewLinesAfterUseStrict: true,
					requireParenthesesAroundIIFE: true,
					requireSemicolons: true,
					requireSpaceAfterBinaryOperators: true,
					requireSpaceAfterComma: true,
					requireSpaceAfterLineComment: true,
					requireSpaceBeforeBinaryOperators: true,
					requireSpaceBeforeBlockStatements: true,
					requireSpaceBeforeObjectValues: true,
					requireSpaceBetweenArguments: true,
					requireSpacesInConditionalExpression: true,
					requireSpacesInForStatement: true,
					requireSpacesInsideObjectBrackets: "all",
					validateParameterSeparator: ", ",
					validateIndentation: "\t"
				},
				files: {
					src: ['src/js/**/*.js']
				}
			}
		},

		// compiles the sass code to css code
		sass: {
			dist: {
				files: [{
					expand: true,
					cwd: 'src/sass',
					src: ['*.{scss,sass}'],
					dest: '.tmp/styles',
					ext: '.css'
				}]
			}
		},

		// copies the specified files
		copy: {
			regular: {
				files: [{
					// fonts
					expand: true,
					flatten: true,
					src: ['bower_components/font-awesome/fonts/*.*', 'bower_components/bootstrap/fonts/*.*'],
					dest: 'dist/fonts/'
				}, {
					// images
					expand: true,
					flatten: true,
					src: ['bower_components/jcrop/css/*.gif', 'src/images/*'],
					dest: 'dist/styles/'
				}, {
					// index.html
					expand: true,
					cwd: 'src/html/',
					src: ['index.html'],
					dest: 'dist/'
				}]
			}
		},

		// converts language.json into productive form
		convertLanguageJson: {
			json: {
				options: {
					prefix: "reimbursement."
				},
				files: [{
					src: 'src/languages/languages.json',
					dest: 'dist/languages/languages.json',
					destType: 'file'
				}]
			}
		},

		// adds some necessary css prefixes like -webkit-
		autoprefixer: {
			options: {
				browsers: '> 2% in CH'
			},
			css: {
				src: 'dist/styles/app.css'
			}
		},

		// minifies the css code
		cssmin: {
			options: {
				keepSpecialComments: 0
			},
			target: {
				files: {
					'dist/styles/app.css': 'dist/styles/app.css',
					'dist/styles/libraries.css': 'dist/styles/libraries.css'
				}
			}
		},

		// uglifies the javascript code
		uglify: {
			js: {
				files: {
					'dist/javascript/app.js': 'dist/javascript/app.js',
					'dist/javascript/libraries.js': 'dist/javascript/libraries.js'
				}
			}
		},

		filerev: {
			options: {
				algorithm: 'md5',
				length: 25
			},
			dist: {
				files: [{
					src: [
						'dist/languages/*.json',
						'dist/javascript/*.js',
						'dist/styles/*.css'
					]
				}]
			}
		},

		// concats all css & js files from the index.html
		useminPrepare: {
			dev: 'src/html/index.html',
			options: {
				dest: 'dist',
				staging: '.tmp',
				flow: {
					steps: {
						js: ['concat'],
						css: ['concat']
					},
					// bugfix for usemin custom flow:
					post: []
				}
			}
		},

		// replaces the source files from index.html
		usemin: {
			html: ['dist/index.html'],
			options: {
				assetsDirs: ['dist']
			}
		},

		// concats only the app.js with templates.js (from html2js)
		concat: {
			appWithTemplates: {
				files: {
					'dist/javascript/app.js': ['.tmp/concat/templates.js', 'dist/javascript/app.js']
				}
			}
		},

		// converts all the html files to one single js template file
		html2js: {
			options: {
				base: 'src/html/templates/',
				module: 'reimbursement.templates',
				quoteChar: '\''
			},
			dev: {
				src: [ 'src/html/templates/**/*.tpl.html' ],
				dest: '.tmp/concat/templates.js'
			},
			prod: {
				options: {
					htmlmin: {
						collapseBooleanAttributes: true,
						collapseWhitespace: true,
						conservativeCollapse: true,
						removeComments: true
					}
				},
				src: [ 'src/html/templates/**/*.tpl.html' ],
				dest: '.tmp/concat/templates.js'
			}
		},

		htmlmin: {
			indexFile: {
				options: {
					collapseBooleanAttributes: true,
					collapseWhitespace: true,
					removeComments: true
					// conservative collapse is not necessary in index.html, because it contains no
					// elements styles with display: inline-block. if that changes, change this property
					/* conservativeCollapse: true */
				},
				files: {
					'dist/index.html': 'dist/index.html'
				}
			}
		},

		war: {
			target: {
				options: {
					war_dist_folder: 'dist',
					war_name: 'ROOT',
					webxml_welcome: 'index.html',
					webxml_display_name: 'Reimbursement Front-End'
				},
				files: [{
					expand: true,
					cwd: 'dist',
					src: ['**'],
					dest: ''
				}]
			}
		},

		// upload the built war file
		http_upload: {
			prod: {
				options: {
					url: 'http://<%=deploy.username%>:<%=deploy.password%>@192.41.136.228/manager/text/deploy?path=&update=true',
					method: 'PUT',
					rejectUnauthorized: true
				},
				src: 'dist/ROOT.war',
				dest: 'reimbursement-frontend'
			},
			int: {
				options: {
					url: 'http://<%=deploy.username%>:<%=deploy.password%>@192.41.136.227/manager/text/deploy?path=&update=true',
					method: 'PUT',
					rejectUnauthorized: true
				},
				src: 'dist/ROOT.war',
				dest: 'reimbursement-frontend'
			}
		},

		// process, which monitors all source files and recompiles after a change
		watch: {
			options: {
				livereload: true
			},
			dev: {
				files: ['src/**/*.*'],
				tasks: ['default']
			},
			prod: {
				files: ['src/**/*.*'],
				tasks: ['prod']
			}
		},

		// starts a server and deploys the specified files
		connect: {
			dist: {
				options: {
					port: 9005,
					base: 'dist',
					open: 'http://<%= connect.dist.options.hostname %>:<%= connect.dist.options.port %>',
					hostname: 'localhost',
					livereload: true
				}
			}
		}

	});

	// the default grunt task, just call "grunt" and it will be executed
	grunt.registerTask('default', [
		'jshint:gruntfile',
		'jshint:dev',
		'jscs',
		'clean',
		'sass',
		'useminPrepare',
		'concat:generated',
		'html2js:dev',
		'concat:appWithTemplates',
		'autoprefixer',
		'copy',
		'convertLanguageJson',
		'filerev',
		'usemin',
		'clean:tmp'
	]);

	// the productive process, which also minifies. it can be started by calling "grunt prod"
	grunt.registerTask('prod', [
		'jshint:gruntfile',
		'jshint:prod',
		'jscs',
		'clean',
		'sass',
		'useminPrepare',
		'concat:generated',
		'html2js:prod',
		'concat:appWithTemplates',
		'autoprefixer',
		'copy',
		'convertLanguageJson',
		'uglify',
		'cssmin',
		'filerev',
		'usemin',
		'htmlmin',
		'clean:tmp'
	]);

	// starts a server instance with live deployment. it can be started by calling "grunt serve"
	grunt.registerTask('serve', [
		'default',
		'connect',
		'watch:dev'
	]);

	// starts a server instance with live deployment. it always takes the minified and uglified resources.
	grunt.registerTask('prod-serve', [
		'prod',
		'connect',
		'watch:prod'
	]);

	// deploys the application to the production tomcat server
	grunt.registerTask('deploy-prod', [
		'prod',
		'war',
		'http_upload:prod'
	]);

	// deploys the application to the integration tomcat server
	grunt.registerTask('deploy-int', [
		'prod',
		'war',
		'http_upload:int'
	]);

	//produce war file
	grunt.registerTask('deploy-local', [
		'default',
		'war'
	]);

};
<|endoftext|>


<commit_before>/*global module:false*/

var childProc = require("child_process");

module.exports = function(grunt) {
	var pkg, minfiles = {},
		lintFiles = ['Gruntfile.js', 'src/*.js', 'test/**/*.js'],
		pluginNamespaces = [
			"ajax",
			"autoplay",
			"drag",
			"dynamic-containers",
			"flip",
			"keybd",
			"loop",
			"pagination",
			"touch"
		];

	// Minify all the plugins
	pluginNamespaces.forEach(function( namespace, i ) {
		minfiles[ "dist/<%= pkg.name %>." + namespace + ".min.js" ] =
			[ "dist/<%= pkg.name %>." + namespace + ".js" ];
	});

	// Minify the main concatenated files
	minfiles[ "dist/<%= pkg.name %>.min.js" ] = [ "dist/<%= pkg.name %>.js" ];

	// Project configuration.
	grunt.initConfig({
		pkg: pkg = grunt.file.readJSON('package.json'),
		meta: {
			banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
				'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
				' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
		},

		concat: {
			dist: {
				src: ['<banner:meta.banner>', 'src/responsive-carousel.js', 'src/responsive-carousel.touch.js', 'src/responsive-carousel.drag.js', 'src/responsive-carousel.pagination.js', 'src/responsive-carousel.autoinit.js' ],
				dest: 'dist/<%= pkg.name %>.js'
			}
		},

		copy: {
			plugins: {
				files: [
					{
						expand: true,
						// NOTE prevent overwritting by only pulling namespaced files
						src: "src/*.*.js",
						dest: "dist/",
						filter: "isFile",
						flatten: true
					},

					{
						expand: true,
						src: "src/*.css",
						dest: "dist/",
						filter: "isFile",
						flatten: true
					}
				]
			}
		},

		uglify: {
			options: {
				banner: '<banner:meta.banner>'
			},

			dist: {
				files: minfiles
			}
		},

		watch: {
			files: lintFiles,
			tasks: 'jshint qunit'.split( " " )
		},

		jshint: {
			all: lintFiles
		},

		qunit: {
			all: [ "test/unit/responsive-carousel.html" ]
		}
	});

	grunt.loadNpmTasks('grunt-contrib-qunit');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-copy');

	grunt.task.registerTask( "compress", "compress the dist folder", function() {
		var done = this.async();
		childProc.exec( "tar czf dist-" + pkg.version + ".tar.gz dist", function() {
			done();
		});
	});

	// Default task.
	grunt.registerTask('default', 'jshint qunit copy:plugins concat uglify'.split( " " ));

	// Travis
	grunt.registerTask('travis', 'jshint qunit'.split( " " ));
};
<commit_msg>Fix #74 fix #83<commit_after>/*global module:false*/

var childProc = require("child_process");

module.exports = function(grunt) {
	var pkg, minfiles = {},
		lintFiles = ['Gruntfile.js', 'src/*.js', 'test/**/*.js'],
		pluginNamespaces = [
			"ajax",
			"autoplay",
			"drag",
			"dynamic-containers",
			"flip",
			"keybd",
			"loop",
			"pagination",
			"touch"
		];

	// Minify all the plugins
	pluginNamespaces.forEach(function( namespace, i ) {
		minfiles[ "dist/<%= pkg.name %>." + namespace + ".min.js" ] =
			[ "dist/<%= pkg.name %>." + namespace + ".js" ];
	});

	// Minify the main concatenated files
	minfiles[ "dist/<%= pkg.name %>.min.js" ] = [ "dist/<%= pkg.name %>.js" ];

	// Project configuration.
	grunt.initConfig({
		pkg: pkg = grunt.file.readJSON('package.json'),
		meta: {
			banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
				'<%= grunt.template.today("yyyy-mm-dd") %>\\n' +
				'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
				' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
		},

		concat: {
			dist: {
				options: {
					banner: '<%= meta.banner %>'
				},
				src: ['src/responsive-carousel.js', 'src/responsive-carousel.touch.js', 'src/responsive-carousel.drag.js', 'src/responsive-carousel.pagination.js', 'src/responsive-carousel.autoinit.js' ],
				dest: 'dist/<%= pkg.name %>.js'
			}
		},

		copy: {
			plugins: {
				files: [
					{
						expand: true,
						// NOTE prevent overwritting by only pulling namespaced files
						src: "src/*.*.js",
						dest: "dist/",
						filter: "isFile",
						flatten: true
					},

					{
						expand: true,
						src: "src/*.css",
						dest: "dist/",
						filter: "isFile",
						flatten: true
					}
				]
			}
		},

		uglify: {
			options: {
				banner: '<%= meta.banner %>'
			},

			dist: {
				files: minfiles
			}
		},

		watch: {
			files: lintFiles,
			tasks: 'jshint qunit'.split( " " )
		},

		jshint: {
			all: lintFiles
		},

		qunit: {
			all: [ "test/unit/responsive-carousel.html" ]
		}
	});

	grunt.loadNpmTasks('grunt-contrib-qunit');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-copy');

	grunt.task.registerTask( "compress", "compress the dist folder", function() {
		var done = this.async();
		childProc.exec( "tar czf dist-" + pkg.version + ".tar.gz dist", function() {
			done();
		});
	});

	// Default task.
	grunt.registerTask('default', 'jshint qunit copy:plugins concat uglify'.split( " " ));

	// Travis
	grunt.registerTask('travis', 'jshint qunit'.split( " " ));
};
<|endoftext|>