<commit_before>'use strict';

var SERVER_PORT = 9000;

// # Globbing

module.exports = function(grunt) {
    // show elapsed time at the end
    require('time-grunt')(grunt);
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist',
        originalScriptTag: '<script src="scripts/main.js"></script>',
        tmpScriptTag: '<script src="scripts/.build.js"></script>'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        pkg: grunt.file.readJSON('bower.json'),
        banner: '/* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n',

        clean: {
            dev: ['.sass-cache', '.tmp', '<%= yeoman.app %>/.css'],
            dist: ['.sass-cache', '.tmp', '<%= yeoman.app %>/.css',
                '<%= yeoman.dist %>/scripts', '<%= yeoman.dist %>/styles', '<%= yeoman.dist %>/vendor'
            ],
            tmpBuild: ['<%= yeoman.app %>/scripts/.build.js']
        },

        sass: {
            dist: {
                options: {
                    style: 'expanded'
                },
                files: {
                    '<%= yeoman.app %>/.css/main.css': '<%= yeoman.app %>/styles/main.scss'
                }
            }
        },

        handlebars: {
            compile: {
                options: {
                    namespace: 'JST',
                    amd: true
                },
                files: {
                    '.tmp/scripts/templates.js': ['<%= yeoman.app %>/scripts/templates/*.hbs']
                }
            }
        },

        bower: {
            all: {
                rjsConfig: '<%= yeoman.app %>/scripts/main.js',
                options: {
                    exclude: ['jquery', 'modernizr', 'requirejs']
                }
            }
        },

        requirejs: {
            dist: {
                options: {
                    baseUrl: '<%= yeoman.app %>/scripts',
                    mainConfigFile: "<%= yeoman.app %>/scripts/main.js",
                    name: 'main',
                    optimize: 'none',
                    out: "<%= yeoman.app %>/scripts/.build.js",

                    paths: {
                        'templates': '.tmp/scripts/templates'
                    },

                    almond: false,
                    preserveLicenseComments: false
                }
            }
        },

        watch: {
            options: {
                spawn: false
            },
            css: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.scss'],
                tasks: ['sass']
            },
            handlebars: {
                files: [
                    '<%= yeoman.app %>/scripts/templates/*.hbs'
                ],
                tasks: ['handlebars']
            }
        },

        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },

        cssmin: {
            options: {
                banner: '<%= banner %>'
            }
        },

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

        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg,svg,gif}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },

        htmlmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },

        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/vendor/{,*/}*.js',
                    ]
                }
            }
        },

        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },

        copy: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: [
                        '*.{ico,png}',
                        'audio/{,*/}*.*'
                    ],
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },

        connect: {
            options: {
                protocol: 'https',
                port: grunt.option('port') || SERVER_PORT,
                open: true,
                // change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },
            dev: {
                options: {
                    base: [
                        '.tmp',
                        '<%= yeoman.app %>'
                    ]
                }
            },
            dist: {
                options: {
                    protocol: 'https',
                    base: '<%= yeoman.dist %>'
                }
            }
        },

        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.app %>/scripts/{,*/}*.js',
                '!<%= yeoman.app %>/vendor/*'
            ]
        },

        includereplace: {
            prod: {
                options: {
                    globals: {
                        appId: '13318',
                        authKey: 'WzrAY7vrGmbgFfP',
                        authSecret: 'xS2uerEveGHmEun',
                        debugQM: '0',
                        debugQB: '0'
                    }
                },
                src: '<%= yeoman.app %>/configs/environment.js',
                dest: '<%= yeoman.app %>/configs/main_config.js'
            },
            dev: {
                options: {
                    globals: {
                        appId: '36125',
                        authKey: 'gOGVNO4L9cBwkPE',
                        authSecret: 'JdqsMHCjHVYkVxV',
                        debugQM: '1',
                        debugQB: '1'
                    }
                },
                src: '<%= yeoman.app %>/configs/environment.js',
                dest: '<%= yeoman.app %>/configs/main_config.js'
            },
            local: {
                src: '<%= yeoman.app %>/config.js',
                dest: '<%= yeoman.app %>/configs/main_config.js'
            }
        }
    });

    var envTarget = grunt.option('env') || 'local';

    grunt.registerTask('createDefaultTemplate', function() {
        grunt.file.write('.tmp/scripts/templates.js', 'this.JST = this.JST || {};');
    });

    grunt.registerTask('createTmpScriptTag', function(rollBack) {
        var path = yeomanConfig.app + '/index.html';
        var indexFile = grunt.file.read(path);
        if (typeof rollBack === 'undefined') {
            grunt.file.write(path, indexFile.replace(yeomanConfig.originalScriptTag, yeomanConfig.tmpScriptTag));
        } else {
            grunt.file.write(path, indexFile.replace(yeomanConfig.tmpScriptTag, yeomanConfig.originalScriptTag));
            grunt.task.run(['clean:tmpBuild']);
        }
    });

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

    grunt.registerTask('serve', function(target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'connect:dist:keepalive']);
        }

        /***********************************************************************
        1) task - "grunt serve"
        > use configs from ../q-municate-web./app/config.js

        2) task - "grunt serve --env=dev"
        > use configs from ../q-municate-web./app/configs/environments.js and set DEV environment

        3) task - "grunt serve --env=prod"
        > use configs from ../q-municate-web./app/configs/environments.js and set PROD environment
        ***********************************************************************/
        grunt.task.run([
            'includereplace:' + envTarget,
            'clean:dev',
            'sass',
            'createDefaultTemplate',
            'handlebars',
            'connect:dev',
            'watch'
        ]);
    });

    /***************************************************************************
    1) task - "grunt build"
    > use configs from ../q-municate-web./app/config.js

    2) task - "grunt build --env=dev"
    > use configs from ../q-municate-web./app/configs/environments.js and set DEV environment

    3) task - "grunt build --env=prod"
    > use configs from ../q-municate-web./app/configs/environments.js and set PROD environment
    ***************************************************************************/
    grunt.registerTask('build', [
        'jshint',
        'includereplace:' + envTarget,
        'clean:dist',
        'sass',
        'createDefaultTemplate',
        'handlebars',
        'requirejs',
        'createTmpScriptTag',
        'useminPrepare',
        'concat',
        'cssmin',
        'uglify',
        'newer:imagemin',
        'htmlmin',
        'rev',
        'usemin',
        'newer:copy',
        'createTmpScriptTag:rollBack'
    ]);

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

};
<commit_msg>removed unnecessary options for sass task<commit_after>'use strict';

var SERVER_PORT = 9000;

// # Globbing

module.exports = function(grunt) {
    // show elapsed time at the end
    require('time-grunt')(grunt);
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist',
        originalScriptTag: '<script src="scripts/main.js"></script>',
        tmpScriptTag: '<script src="scripts/.build.js"></script>'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        pkg: grunt.file.readJSON('bower.json'),
        banner: '/* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n',

        clean: {
            dev: ['.sass-cache', '.tmp', '<%= yeoman.app %>/.css'],
            dist: ['.sass-cache', '.tmp', '<%= yeoman.app %>/.css',
                '<%= yeoman.dist %>/scripts', '<%= yeoman.dist %>/styles', '<%= yeoman.dist %>/vendor'
            ],
            tmpBuild: ['<%= yeoman.app %>/scripts/.build.js']
        },

        sass: {
            dist: {
                files: {
                    '<%= yeoman.app %>/.css/main.css': '<%= yeoman.app %>/styles/main.scss'
                }
            }
        },

        handlebars: {
            compile: {
                options: {
                    namespace: 'JST',
                    amd: true
                },
                files: {
                    '.tmp/scripts/templates.js': ['<%= yeoman.app %>/scripts/templates/*.hbs']
                }
            }
        },

        bower: {
            all: {
                rjsConfig: '<%= yeoman.app %>/scripts/main.js',
                options: {
                    exclude: ['jquery', 'modernizr', 'requirejs']
                }
            }
        },

        requirejs: {
            dist: {
                options: {
                    baseUrl: '<%= yeoman.app %>/scripts',
                    mainConfigFile: "<%= yeoman.app %>/scripts/main.js",
                    name: 'main',
                    optimize: 'none',
                    out: "<%= yeoman.app %>/scripts/.build.js",

                    paths: {
                        'templates': '.tmp/scripts/templates'
                    },

                    almond: false,
                    preserveLicenseComments: false
                }
            }
        },

        watch: {
            options: {
                spawn: false
            },
            css: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.scss'],
                tasks: ['sass']
            },
            handlebars: {
                files: [
                    '<%= yeoman.app %>/scripts/templates/*.hbs'
                ],
                tasks: ['handlebars']
            }
        },

        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },

        cssmin: {
            options: {
                banner: '<%= banner %>'
            }
        },

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

        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg,svg,gif}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },

        htmlmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },

        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/vendor/{,*/}*.js',
                    ]
                }
            }
        },

        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },

        copy: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: [
                        '*.{ico,png}',
                        'audio/{,*/}*.*'
                    ],
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },

        connect: {
            options: {
                protocol: 'https',
                port: grunt.option('port') || SERVER_PORT,
                open: true,
                // change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },
            dev: {
                options: {
                    base: [
                        '.tmp',
                        '<%= yeoman.app %>'
                    ]
                }
            },
            dist: {
                options: {
                    protocol: 'https',
                    base: '<%= yeoman.dist %>'
                }
            }
        },

        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.app %>/scripts/{,*/}*.js',
                '!<%= yeoman.app %>/vendor/*'
            ]
        },

        includereplace: {
            prod: {
                options: {
                    globals: {
                        appId: '13318',
                        authKey: 'WzrAY7vrGmbgFfP',
                        authSecret: 'xS2uerEveGHmEun',
                        debugQM: '0',
                        debugQB: '0'
                    }
                },
                src: '<%= yeoman.app %>/configs/environment.js',
                dest: '<%= yeoman.app %>/configs/main_config.js'
            },
            dev: {
                options: {
                    globals: {
                        appId: '36125',
                        authKey: 'gOGVNO4L9cBwkPE',
                        authSecret: 'JdqsMHCjHVYkVxV',
                        debugQM: '1',
                        debugQB: '1'
                    }
                },
                src: '<%= yeoman.app %>/configs/environment.js',
                dest: '<%= yeoman.app %>/configs/main_config.js'
            },
            local: {
                src: '<%= yeoman.app %>/config.js',
                dest: '<%= yeoman.app %>/configs/main_config.js'
            }
        }
    });

    var envTarget = grunt.option('env') || 'local';

    grunt.registerTask('createDefaultTemplate', function() {
        grunt.file.write('.tmp/scripts/templates.js', 'this.JST = this.JST || {};');
    });

    grunt.registerTask('createTmpScriptTag', function(rollBack) {
        var path = yeomanConfig.app + '/index.html';
        var indexFile = grunt.file.read(path);
        if (typeof rollBack === 'undefined') {
            grunt.file.write(path, indexFile.replace(yeomanConfig.originalScriptTag, yeomanConfig.tmpScriptTag));
        } else {
            grunt.file.write(path, indexFile.replace(yeomanConfig.tmpScriptTag, yeomanConfig.originalScriptTag));
            grunt.task.run(['clean:tmpBuild']);
        }
    });

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

    grunt.registerTask('serve', function(target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'connect:dist:keepalive']);
        }

        /***********************************************************************
        1) task - "grunt serve"
        > use configs from ../q-municate-web./app/config.js

        2) task - "grunt serve --env=dev"
        > use configs from ../q-municate-web./app/configs/environments.js and set DEV environment

        3) task - "grunt serve --env=prod"
        > use configs from ../q-municate-web./app/configs/environments.js and set PROD environment
        ***********************************************************************/
        grunt.task.run([
            'includereplace:' + envTarget,
            'clean:dev',
            'sass',
            'createDefaultTemplate',
            'handlebars',
            'connect:dev',
            'watch'
        ]);
    });

    /***************************************************************************
    1) task - "grunt build"
    > use configs from ../q-municate-web./app/config.js

    2) task - "grunt build --env=dev"
    > use configs from ../q-municate-web./app/configs/environments.js and set DEV environment

    3) task - "grunt build --env=prod"
    > use configs from ../q-municate-web./app/configs/environments.js and set PROD environment
    ***************************************************************************/
    grunt.registerTask('build', [
        'jshint',
        'includereplace:' + envTarget,
        'clean:dist',
        'sass',
        'createDefaultTemplate',
        'handlebars',
        'requirejs',
        'createTmpScriptTag',
        'useminPrepare',
        'concat',
        'cssmin',
        'uglify',
        'newer:imagemin',
        'htmlmin',
        'rev',
        'usemin',
        'newer:copy',
        'createTmpScriptTag:rollBack'
    ]);

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

};
<|endoftext|>


<commit_before>// Build the front-end source to run locally.
module.exports = function (grunt) {

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

    grunt.initConfig({

        eslint: {
            options: {
                configFile: './lint/es-lint.json'    // Default rules: http://eslint.org/docs/rules/
            },
            target: [
                './js/scripts/*.js',
                './js/scripts/**/*.js'
            ]
        },

        concat: {
            options: {
                separator: ';',
                banner: '/* This file is generated with Grunt and should not be edited directly. */\n'
            },
            js: {
                files: {
                    // Third party javascript dependencies used in this website.
                    './js/dependencies.js' : [
                        // Libraries managed with Bower.
                        './bower_components/angular/angular.js'

                        // If libraries can't be managed by Bower, add them here.
                    ],

                    // All custom scripts written for this website.
                    './js/scripts.js': [
                        './js/scripts/*.js'
                    ]
                }
            }
        },

        scsslint: {
            allFiles: [
                './css/sass/default.scss',
                './css/sass/**/*.scss'
            ],
            options: {
                config: './lint/scss-lint.yml',
                colorizeOutput: true
            },
        },

        sass: {
            dist: {
                options: {
                    style: 'expanded',
                    lineNumbers: true,
                    'sourcemap=none': ''
                },
                files: {
                    './css/default.css': './css/sass/default.scss'
                }
            }
        },

        pleeease: {
            custom: {
                options: {
                    autoprefixer: {
                        'browsers': ['last 4 versions']
                    },
                    minifier: false
                },
                files: {
                    './css/default.css': './css/default.css'
                }
            }
        },

        htmlangular: {
            options: {
                reportpath: 'lint/html-angular-validate-report.json'
            },
            files: {
                src: [
                    './*.html'
                ]
            }
        },

        cssmin: {
            options: {
                sourceMap: true
            },
            target: {
                files: [{
                    expand: true,
                    cwd: './css',
                    src: ['*.css', '!*.min.css'],
                    dest: './css',
                    ext: '.min.css'
                }]
            }
        },

        uglify: {
            options: {
                mangle: false,
                sourceMap: true,
                compress: {
                    drop_console: true
                }
            },
            scripts: {
                files: {
                    './js/scripts.min.js': ['./js/scripts.js']
                }
            },
            dependencies: {
                files: {
                    './js/dependencies.min.js': ['./js/dependencies.js']
                }
            }
        },

        // Re-run these automated tasks each time certain files are modified.
        watch: {
            sass: {
                files: [
                    './lint/scss-lint.yml',
                    './css/**/*.scss'
                ],
                tasks: [
                    'scsslint',
                    'sass',
                    'pleeease'
                ]
            },
            scripts: {
                files: [
                    './lint/es-lint.json',
                    './js/scripts/*.js',
                    './js/scripts/**/*.js'
                ],
                tasks: [
                    'eslint',
                    'concat'
                ]
            },
            html: {
                files: [
                    'index.html'
                ],
                tasks: [
                    'htmlangular'
                ]
            },
            grunt: {
                files: [
                    './Gruntfile.js'
                ],
                tasks: [
                    'concat',
                    'sass',
                    'pleeease'
                ]
            }
        }

    });

    // During development, continuous building for both css and javascript: run 'grunt watch' command (see watch above).
    // Warning: this watch does not include minification.

    // Prior to release. One-off build for both css and javascript, including minification: run 'grunt' command.
    grunt.registerTask('default', [
        'eslint',
        'concat',
        'scsslint',
        'sass',
        'pleeease',
        'htmlangular',
        'cssmin',
        'uglify'
    ]);

    grunt.registerTask('sassy', [
        'scsslint',
        'sass',
        'pleeease',
        'cssmin'
    ]);
};<commit_msg>updated deployment tasks in default grunt<commit_after>// Build the front-end source to run locally.
module.exports = function (grunt) {

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

    grunt.initConfig({

        eslint: {
            options: {
                configFile: './lint/es-lint.json'    // Default rules: http://eslint.org/docs/rules/
            },
            target: [
                './js/scripts/*.js',
                './js/scripts/**/*.js'
            ]
        },

        concat: {
            options: {
                separator: ';',
                banner: '/* This file is generated with Grunt and should not be edited directly. */\n'
            },
            js: {
                files: {
                    // Third party javascript dependencies used in this website.
                    './js/dependencies.js' : [
                        // Libraries managed with Bower.
                        './bower_components/angular/angular.js'

                        // If libraries can't be managed by Bower, add them here.
                    ],

                    // All custom scripts written for this website.
                    './js/scripts.js': [
                        './js/scripts/*.js'
                    ]
                }
            }
        },

        scsslint: {
            allFiles: [
                './css/sass/default.scss',
                './css/sass/**/*.scss'
            ],
            options: {
                config: './lint/scss-lint.yml',
                colorizeOutput: true
            },
        },

        sass: {
            dist: {
                options: {
                    style: 'expanded',
                    lineNumbers: true,
                    'sourcemap=none': ''
                },
                files: {
                    './css/default.css': './css/sass/default.scss'
                }
            }
        },

        pleeease: {
            custom: {
                options: {
                    autoprefixer: {
                        'browsers': ['last 4 versions']
                    },
                    minifier: false
                },
                files: {
                    './css/default.css': './css/default.css'
                }
            }
        },

        htmlangular: {
            options: {
                reportpath: 'lint/html-angular-validate-report.json'
            },
            files: {
                src: [
                    './*.html'
                ]
            }
        },

        cssmin: {
            options: {
                sourceMap: true
            },
            target: {
                files: [{
                    expand: true,
                    cwd: './css',
                    src: ['*.css', '!*.min.css'],
                    dest: './css',
                    ext: '.min.css'
                }]
            }
        },

        uglify: {
            options: {
                mangle: false,
                sourceMap: true,
                compress: {
                    drop_console: true
                }
            },
            scripts: {
                files: {
                    './js/scripts.min.js': ['./js/scripts.js']
                }
            },
            dependencies: {
                files: {
                    './js/dependencies.min.js': ['./js/dependencies.js']
                }
            }
        },

        // Re-run these automated tasks each time certain files are modified.
        // These tasks are meant for development and include linting.
        watch: {
            sass: {
                files: [
                    './lint/scss-lint.yml',
                    './css/**/*.scss'
                ],
                tasks: [
                    'scsslint',
                    'sass',
                    'pleeease'
                ]
            },
            scripts: {
                files: [
                    './lint/es-lint.json',
                    './js/scripts/*.js',
                    './js/scripts/**/*.js'
                ],
                tasks: [
                    'eslint',
                    'concat'
                ]
            },
            html: {
                files: [
                    'index.html'
                ],
                tasks: [
                    'htmlangular'
                ]
            },
            grunt: {
                files: [
                    './Gruntfile.js'
                ],
                tasks: [
                    'concat',
                    'sass',
                    'pleeease'
                ]
            }
        }

    });

    // During development, continuous building for both css and javascript: run 'grunt watch' command (see watch above).
    // Warning: this watch does not include minification.

    // Prior to release. One-off build for both css and javascript, including minification: run 'grunt' command.
    // There is no linting in this version, since linting is meant to happen during development.
    grunt.registerTask('default', [
        'concat',
        'uglify',
        'sass',
        'pleeease',
        'cssmin'
    ]);
};<|endoftext|>


<commit_before>module.exports = function (grunt) {
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-bumpup');
    grunt.loadNpmTasks('grunt-jsdoc');
    grunt.loadNpmTasks('grunt-tagrelease');

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

        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> | Copyright (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.homepage %> | Released under the MIT License */\n',
                report: "gzip"
            },
            dist: {
                files: {
                    'dist/<%= pkg.name %>.min.js': ['src/*.js']
                }
            }
        },

        copy: {
            main: {
                files: [
                    {
                        src : ['dist/<%= pkg.name %>.min.js'],
                        dest: 'dist/<%= pkg.name %>.v<%= pkg.version %>.min.js'
                    }
                ]
            }
        },

        jshint: {
            files: ['Gruntfile.js', 'src/*.js'],
            options: {
                globals: {
                    jQuery: true
                }
            }
        },

        bumpup: {
            files: ['package.json']
        },

        jsdoc: {
            dist: {
                src: ['src/*.js'],
                options: {
                    destination: 'docs'
                }
            }
        },

        tagrelease: {
            file: 'package.json',
            commit:  false,
            message: 'Marks v%version%.',
            prefix:  '',
            annotate: true
        }
    });

    grunt.registerTask('updatePackage', function () {
        grunt.config.set('pkg', grunt.file.readJSON('package.json'));
    });

    grunt.registerTask('test', ['jshint']);
    grunt.registerTask('build', ['uglify', 'copy']);
    grunt.registerTask('default', ['test', 'build']);

    grunt.registerTask('release', function (type) {
        if (!type) {
            type = 'patch';
        }

        grunt.task.run('test');
        grunt.task.run('bumpup:' + type);
        grunt.task.run('updatePackage');
        grunt.task.run('build');
        grunt.task.run('tagrelease');
    });
};<commit_msg>Use the title in the header instead of name.<commit_after>module.exports = function (grunt) {
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-bumpup');
    grunt.loadNpmTasks('grunt-jsdoc');
    grunt.loadNpmTasks('grunt-tagrelease');

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

        uglify: {
            options: {
                banner: '/*! <%= pkg.title %> | Copyright (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.homepage %> | Released under the MIT License */\n',
                report: "gzip"
            },
            dist: {
                files: {
                    'dist/<%= pkg.name %>.min.js': ['src/*.js']
                }
            }
        },

        copy: {
            main: {
                files: [
                    {
                        src : ['dist/<%= pkg.name %>.min.js'],
                        dest: 'dist/<%= pkg.name %>.v<%= pkg.version %>.min.js'
                    }
                ]
            }
        },

        jshint: {
            files: ['Gruntfile.js', 'src/*.js'],
            options: {
                globals: {
                    jQuery: true
                }
            }
        },

        bumpup: {
            files: ['package.json']
        },

        jsdoc: {
            dist: {
                src: ['src/*.js'],
                options: {
                    destination: 'docs'
                }
            }
        },

        tagrelease: {
            file: 'package.json',
            commit:  false,
            message: 'Marks v%version%.',
            prefix:  '',
            annotate: true
        }
    });

    grunt.registerTask('updatePackage', function () {
        grunt.config.set('pkg', grunt.file.readJSON('package.json'));
    });

    grunt.registerTask('test', ['jshint']);
    grunt.registerTask('build', ['uglify', 'copy']);
    grunt.registerTask('default', ['test', 'build']);

    grunt.registerTask('release', function (type) {
        if (!type) {
            type = 'patch';
        }

        grunt.task.run('test');
        grunt.task.run('bumpup:' + type);
        grunt.task.run('updatePackage');
        grunt.task.run('build');
        grunt.task.run('tagrelease');
    });
};<|endoftext|>


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

  // Project configuration.
  grunt.initConfig({
	clean : ['doc'],
    jsdoc : {
		basic: {
			src: ['tasks/**.js', 'tasks/lib/*.js'],
			options: {
				destination: 'doc/basic'
			}
		},
        docstrap : {
            src: ['tasks/**.js', 'tasks/lib/*.js', 'README.md'],
            options:{
				destination: 'doc/docstrap',
                template: "node_modules/ink-docstrap/template",
                configure: "node_modules/ink-docstrap/template/jsdoc.conf.json"
			}
        }
	},
	nodeunit : {
        unit : ['test/jsdoc-plugin_test.js'],
        basic : ['test/jsdoc-basic_test.js'],
        docstrap : ['test/jsdoc-docstrap_test.js']
	},
	jshint : {
		files : ['Gruntfile.js', 'tasks/*.js', 'tasks/lib/*.js', 'test/*.js'],
		options: {
			node : true,
			smarttabs : true
		}
	}
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');

  // Load local tasks.
  grunt.loadTasks('tasks');

  // Default task.
  grunt.registerTask('default', ['jshint', 'test']);

  //testing tasks
  grunt.registerTask('test-basic', ['jsdoc:basic', 'nodeunit:basic']);
  grunt.registerTask('test-docstrap', ['jsdoc:docstrap', 'nodeunit:docstrap']);
  grunt.registerTask('test', ['clean', 'nodeunit:unit', 'test-basic', 'test-docstrap']);

};
<commit_msg>Gruntfile: Fix indent, all using spaces, and some whitespace<commit_after>module.exports = function(grunt) {
  'use strict';

  // Project configuration.
  grunt.initConfig({
    clean : ['doc'],
    jsdoc : {
      basic : {
        src : ['tasks/**.js', 'tasks/lib/*.js'],
        options : {
          destination: 'doc/basic'
        }
      },
      docstrap : {
        src : ['tasks/**.js', 'tasks/lib/*.js', 'README.md'],
        options : {
          destination : 'doc/docstrap',
            template : "node_modules/ink-docstrap/template",
            configure : "node_modules/ink-docstrap/template/jsdoc.conf.json"
        }
      }
    },
    nodeunit : {
      unit : ['test/jsdoc-plugin_test.js'],
      basic : ['test/jsdoc-basic_test.js'],
      docstrap : ['test/jsdoc-docstrap_test.js']
    },
    jshint : {
      files : ['Gruntfile.js', 'tasks/*.js', 'tasks/lib/*.js', 'test/*.js'],
      options: {
        node : true,
        smarttabs : true
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');

  // Load local tasks.
  grunt.loadTasks('tasks');

  // Default task.
  grunt.registerTask('default', ['jshint', 'test']);

  //testing tasks
  grunt.registerTask('test-basic', ['jsdoc:basic', 'nodeunit:basic']);
  grunt.registerTask('test-docstrap', ['jsdoc:docstrap', 'nodeunit:docstrap']);
  grunt.registerTask('test', ['clean', 'nodeunit:unit', 'test-basic', 'test-docstrap']);

};
<|endoftext|>


<commit_before>var path = require("path"),
	webpack = require("webpack");

module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON("package.json"),
		autoprefixer: {
			build: {
				expand: true,
				cwd: "build",
				src: ["**/*.css"],
				dest: "build"
			}
		},
		clean: {
			build: {
				src: ["build"]
			},
			stylesheets: {
				src: ["build/**/*.css", "!build/application.css", "build/css"]
			},
			scripts: {
				src: ["build/**/*.js", "!build/application.js", "build/js"]
			},
			sourcemaps: {
				src: ["build/application.js.map"]
			},
			phantom: {
				src: ["phantom/build/**"]
			}
		},
		connect: {
			dev: {
				options: {
					port: 8000,
					base: "build",
					hostname: "*",
					keepalive: false
				}
			},
			demo: {
				options: {
					port: 8000,
					base: "build",
					hostname: "*",
					keepalive: true
				}
			},
			phantom: {
				options: {
					port: 8800,
					base: ".",
					hostname: "127.0.0.1",
					keepalive: false
				}
			}
		},
		copy: {
			build: {
				cwd: "src",
				src: ["**",
					"!**/*.scss",
					"!**/*.js",
					"!sass",
					"!js",
					"!css",
					"!**/components/**",
					"!index.html"],
				dest: "build",
				expand: true
			},
			phantom: {
				cwd: "build",
				src: ["**",
					"!index.html"],
				dest: "phantom/build",
				expand: true
			}
		},
		cssmin: {
			build: {
				files: {
					"build/application.css": ["build/application.css"]
				}
			}
		},
		jshint: {
			js: ["src/js/*.js"],
			options: {
				globals: {
					require: false,
					module: true,
					console: false,
					window: true,
					$: false
				},
				node: true,
				strict: false,
				undef: true,
				unused: true,
				loopfunc: true
			}
		},
		mochacov: {
			coverage: {
				options: {
					"check-leaks": true,
					"clearRequireCache": false,
					"debug": true,
					"output": "test/results.html",
					"quiet": false,
					"reporter": "html-cov",
					"require": ["test/common"]
				}
			},
			options: {
				"files": "test/*.js"
			},
			passing: {
				options: {
					"check-leaks": true,
					"clearRequireCache": false,
					"quiet": false,
					"reporter": "spec",
					"require": ["test/common"]
				}
			}
		},
		sass: {
			dist: {
				files: {
					"build/application.css" : "src/sass/application.scss"
				}
			}
		},
		uglify: {
			build: {
				options: {
					mangle: false,
					sourceMap: true,
					sourceMapIn: "build/application.js.map",
					sourceMapName: "build/application.js.map"
				},
				files: {
					"build/application.js": ["build/application.js"]
				}
			}
		},
		watch: {
			options: {
				livereload: false,
				spawn: false
			},
			stylesheets: {
				files: "src/**/*.scss",
				tasks: ["stylesheets"]
			},
			scripts: {
				files: "src/**/*.js",
				tasks: ["scripts"]
			},
			// i didn't understood what this used for and looks like it does nothing
			// "scripts" watch will pick this files and run "build" which will run "copy" task
			// so we don't need this watcher
			//copy: {
			//	files: ["src/**",
			//			"src/*",
			//			"!src/**/*.scss",
			//			"!src/**/*.js",
			//			"!src/**/*"],
			//	tasks: ["copy"]
			//},
			html: {
				files: ["src/index.html"],
				tasks: ["copy:build"]
			},
			test: {
				files: ["test/*.js"],
				tasks: ["build"]
			},
			phantom: {
				files: ["phantom/test.js", "build/application.js", "build/index.html"],
				tasks: ["wait:phantom", "test_phantom"]
			}
		},
		webpack: {
			build: {
				devtool: "sourcemap",
				entry: "./src/js/main.js",
				output: {
					path: "build/",
					filename: "application.js"
				},
				plugins: [
					new webpack.ResolverPlugin(
						new webpack.ResolverPlugin
							.DirectoryDescriptionFilePlugin("bower.json",
								["main"]
							)
					)
				],
				resolve: {
					root: [path.join(__dirname, "src", "components")]
				}
			}
		},
		mocha_phantomjs: {
			all: ['phantom/build/index.html']
		},
		htmlbuild: {
			build: {
				src: 'src/index.html',
				dest: 'build/'
			},
			phantom: {
				src: 'src/index.html',
				dest: 'phantom/build/'
			}
		},
		concurrent: {
			options: {
				logConcurrentOutput: true,
				limit: 4
			},
			dev: {
				tasks: [
					"watch:stylesheets",
					"watch:scripts",
					"watch:html"
					//"watch:test"
				]
			},
			phantom: {
				tasks: [
					"watch:phantom"
				]
			}
		},
		wait: {
			phantom: {
				options: {
					delay: 5000
				}
			}
		}
	});

	grunt.loadNpmTasks("grunt-autoprefixer");
	grunt.loadNpmTasks("grunt-contrib-clean");
	grunt.loadNpmTasks("grunt-contrib-connect");
	grunt.loadNpmTasks("grunt-contrib-copy");
	grunt.loadNpmTasks("grunt-contrib-cssmin");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-watch");
	grunt.loadNpmTasks("grunt-mocha-cov");
	grunt.loadNpmTasks("grunt-sass");
	grunt.loadNpmTasks('grunt-webpack');
	grunt.loadNpmTasks('grunt-mocha-phantomjs');
	grunt.loadNpmTasks('grunt-html-build');
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-wait');

	grunt.registerTask(
		"welcome_message", function () {
			grunt.log.writeln('######################################################'.bold);
			grunt.log.writeln('Welcome to xokei'.bold);
			grunt.log.writeln('');
			grunt.log.writeln('Next commands are available for you:'['yellow']);
			grunt.log.writeln('Run ' + '`grunt release`'['green'] + ' to build source codes to ' + './build/'['magenta'] + ' folder that you can host on your server');
			grunt.log.writeln('Run ' + '`grunt demo`'['green'] + ' to launch demo web server hosting ' + './build/'['magenta'] + ' folder');
			grunt.log.writeln('');
			grunt.log.writeln('Commands for developers:'['yellow']);
			grunt.log.writeln('Run ' + '`grunt dev`'['green'] + ' to build source codes, start web server and watch for file changes');
			grunt.log.writeln('Run ' + '`grunt phantom`'['green'] + '* in separate window to watch for changes and run phantom (headless web browser) tests');
			grunt.log.writeln('*only if you want to run tests to make sure your changes will not break anything');
			grunt.log.writeln('######################################################'.bold);
		});
	grunt.registerTask(
		"phantom_message", function () {
			grunt.log.writeln('You can look at tests in your browser at ' + 'http://127.0.0.1:8800/phantom/build'['magenta'] + ' if you want');
		});

	grunt.registerTask(
		"test",
		[
			"mochacov:passing",
			"mochacov:coverage"
		]);

	grunt.registerTask(
		"test_phantom",
		[
			"clean:phantom",
			"copy:phantom",
			"htmlbuild:phantom",
			"mocha_phantomjs",
		]);

	grunt.registerTask(
		"stylesheets",
		[
			"sass",
			"autoprefixer",
			"cssmin"
		]);

	grunt.registerTask(
		"scripts",
		[
			"jshint",
			//"test",
			"webpack",
			"uglify",
			"clean:scripts"
			//"phantom"
		]);

	grunt.registerTask(
		"build",
		[
			"clean:build",
			"copy:build",
			"htmlbuild:build",
			"stylesheets",
			"scripts"
		]);

	grunt.registerTask(
		"default",
		[
			"welcome_message"
			//"build",
			//"connect",
			//"watch"
		]);

	/////////////////////////////////////

	grunt.registerTask(
		"release",
		[
			"build",
			"clean:sourcemaps"
		]);

	grunt.registerTask(
		"demo",
		[
			"connect:demo"
		]);

	grunt.registerTask(
		"dev",
		[
			"build",
			"connect:dev",
			"concurrent:dev"
		]);

	grunt.registerTask(
		"phantom",
		[
			"test_phantom",
			"connect:phantom",
			"phantom_message",
			"watch:phantom"
		]);
};
<commit_msg>Changes to grunt testing<commit_after>var path = require("path"),
	webpack = require("webpack");

module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON("package.json"),
		autoprefixer: {
			build: {
				expand: true,
				cwd: "build",
				src: ["**/*.css"],
				dest: "build"
			}
		},
		clean: {
			build: {
				src: ["build"]
			},
			stylesheets: {
				src: ["build/**/*.css", "!build/application.css", "build/css"]
			},
			scripts: {
				src: ["build/**/*.js", "!build/application.js", "build/js"]
			},
			sourcemaps: {
				src: ["build/application.js.map"]
			},
			phantom: {
				src: ["phantom/build/**"]
			}
		},
		connect: {
			dev: {
				options: {
					port: 8000,
					base: "build",
					hostname: "*",
					keepalive: false
				}
			},
			demo: {
				options: {
					port: 8000,
					base: "build",
					hostname: "*",
					keepalive: true
				}
			},
			phantom: {
				options: {
					port: 8800,
					base: ".",
					hostname: "127.0.0.1",
					keepalive: false
				}
			}
		},
		copy: {
			build: {
				cwd: "src",
				src: ["**",
					"!**/*.scss",
					"!**/*.js",
					"!sass",
					"!js",
					"!css",
					"!**/components/**",
					"!index.html"],
				dest: "build",
				expand: true
			},
			phantom: {
				cwd: "build",
				src: ["**",
					"!index.html"],
				dest: "phantom/build",
				expand: true
			}
		},
		cssmin: {
			build: {
				files: {
					"build/application.css": ["build/application.css"]
				}
			}
		},
		jshint: {
			js: ["src/js/*.js"],
			options: {
				globals: {
					require: false,
					module: true,
					console: false,
					window: true,
					$: false
				},
				node: true,
				strict: false,
				undef: true,
				unused: true,
				loopfunc: true
			}
		},
		mochacov: {
			coverage: {
				options: {
					"check-leaks": true,
					"clearRequireCache": false,
					"debug": true,
					"output": "test/results.html",
					"quiet": false,
					"reporter": "html-cov",
					"require": ["test/common"]
				}
			},
			options: {
				"files": "test/*.js"
			},
			passing: {
				options: {
					"check-leaks": true,
					"clearRequireCache": false,
					"quiet": false,
					"reporter": "spec",
					"require": ["test/common"]
				}
			}
		},
		sass: {
			dist: {
				files: {
					"build/application.css" : "src/sass/application.scss"
				}
			}
		},
		uglify: {
			build: {
				options: {
					mangle: false,
					sourceMap: true,
					sourceMapIn: "build/application.js.map",
					sourceMapName: "build/application.js.map"
				},
				files: {
					"build/application.js": ["build/application.js"]
				}
			}
		},
		watch: {
			options: {
				livereload: false,
				spawn: false
			},
			stylesheets: {
				files: "src/**/*.scss",
				tasks: ["stylesheets"]
			},
			scripts: {
				files: "src/**/*.js",
				tasks: ["scripts"]
			},
			// i didn't understood what this used for and looks like it does nothing
			// "scripts" watch will pick this files and run "build" which will run "copy" task
			// so we don't need this watcher
			//copy: {
			//	files: ["src/**",
			//			"src/*",
			//			"!src/**/*.scss",
			//			"!src/**/*.js",
			//			"!src/**/*"],
			//	tasks: ["copy"]
			//},
			html: {
				files: ["src/index.html"],
				tasks: ["copy:build"]
			},
			test: {
				files: ["test/*.js"],
				tasks: ["build"]
			},
			phantom: {
				files: ["phantom/test.js", "build/application.js", "build/index.html"],
				tasks: ["test_phantom"]
			}
		},
		webpack: {
			build: {
				devtool: "sourcemap",
				entry: "./src/js/main.js",
				output: {
					path: "build/",
					filename: "application.js"
				},
				plugins: [
					new webpack.ResolverPlugin(
						new webpack.ResolverPlugin
							.DirectoryDescriptionFilePlugin("bower.json",
								["main"]
							)
					)
				],
				resolve: {
					root: [path.join(__dirname, "src", "components")]
				}
			}
		},
		mocha_phantomjs: {
			all: ['phantom/build/index.html']
		},
		htmlbuild: {
			build: {
				src: 'src/index.html',
				dest: 'build/'
			},
			phantom: {
				src: 'src/index.html',
				dest: 'phantom/build/'
			}
		},
		concurrent: {
			options: {
				logConcurrentOutput: true,
				limit: 4
			},
			dev: {
				tasks: [
					"watch:stylesheets",
					"watch:scripts",
					"watch:html",
					"watch:test"
				]
			}
		},
		wait: {
			phantom: {
				options: {
					delay: 5000
				}
			}
		}
	});

	grunt.loadNpmTasks("grunt-autoprefixer");
	grunt.loadNpmTasks("grunt-contrib-clean");
	grunt.loadNpmTasks("grunt-contrib-connect");
	grunt.loadNpmTasks("grunt-contrib-copy");
	grunt.loadNpmTasks("grunt-contrib-cssmin");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-watch");
	grunt.loadNpmTasks("grunt-mocha-cov");
	grunt.loadNpmTasks("grunt-sass");
	grunt.loadNpmTasks('grunt-webpack');
	grunt.loadNpmTasks('grunt-mocha-phantomjs');
	grunt.loadNpmTasks('grunt-html-build');
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-wait');

	grunt.registerTask(
		"welcome_message", function () {
			grunt.log.writeln('######################################################'.bold);
			grunt.log.writeln('Welcome to xokei'.bold);
			grunt.log.writeln('');
			grunt.log.writeln('Next commands are available for you:'['yellow']);
			grunt.log.writeln('Run ' + '`grunt release`'['green'] + ' to build source codes to ' + './build/'['magenta'] + ' folder that you can host on your server');
			grunt.log.writeln('Run ' + '`grunt demo`'['green'] + ' to launch demo web server hosting ' + './build/'['magenta'] + ' folder');
			grunt.log.writeln('');
			grunt.log.writeln('Commands for developers:'['yellow']);
			grunt.log.writeln('Run ' + '`grunt dev`'['green'] + ' to build source codes, start web server and watch for file changes');
			grunt.log.writeln('Run ' + '`grunt phantom`'['green'] + '* in separate window to watch for changes and run phantom (headless web browser) tests');
			grunt.log.writeln('*only if you want to run tests to make sure your changes will not break anything');
			grunt.log.writeln('######################################################'.bold);
		});
	grunt.registerTask(
		"phantom_message", function () {
			grunt.log.writeln('You can look at tests in your browser at ' + 'http://127.0.0.1:8800/phantom/build'['magenta'] + ' if you want');
		});

	grunt.registerTask(
		"test",
		[
			"mochacov:passing",
			"mochacov:coverage"
		]);

	grunt.registerTask(
		"test_phantom",
		[
			"clean:phantom",
			"copy:phantom",
			"htmlbuild:phantom",
			"mocha_phantomjs",
		]);

	grunt.registerTask(
		"stylesheets",
		[
			"sass",
			"autoprefixer",
			"cssmin"
		]);

	grunt.registerTask(
		"scripts",
		[
			"jshint",
			"test",
			"webpack",
			"uglify",
			"clean:scripts"
			//"phantom"
		]);

	grunt.registerTask(
		"build",
		[
			"clean:build",
			"copy:build",
			"htmlbuild:build",
			"stylesheets",
			"scripts"
		]);

	grunt.registerTask(
		"default",
		[
			"welcome_message"
			//"build",
			//"connect",
			//"watch"
		]);

	/////////////////////////////////////

	grunt.registerTask(
		"release",
		[
			"build",
			"clean:sourcemaps"
		]);

	grunt.registerTask(
		"demo",
		[
			"connect:demo"
		]);

	grunt.registerTask(
		"dev",
		[
			"build",
			"connect:dev",
			"concurrent:dev"
		]);

	grunt.registerTask(
		"phantom",
		[
			"test_phantom",
			"connect:phantom",
			"phantom_message",
			"watch:phantom"
		]);
};
<|endoftext|>


<commit_before>// Generated on 2013-07-11 using generator-webapp 0.2.2
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            options: {
                nospawn: true
            },
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server']
            },
            livereload: {
                options: {
                    livereload: LIVERELOAD_PORT
                },
                files: [
                    '<%= yeoman.app %>/*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ]
            }
        },
        connect: {
            options: {
                port: 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.app),
                            lrSnippet
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, yeomanConfig.dist)
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= yeoman.app %>/images',
                javascriptsDir: '<%= yeoman.app %>/scripts',
                fontsDir: '<%= yeoman.app %>/styles/fonts',
                importPath: '<%= yeoman.app %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                relativeAssets: false
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            dist: {}
        },*/
        // not enabled since usemin task does concat and uglify
        // check index.html to edit your build targets
        // enable this task if you prefer defining your build targets here
        /*uglify: {
            dist: {}
        },*/
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/styles/fonts/*'
                    ]
                }
            }
        },
        useminPrepare: {
            options: {
                dest: '<%= yeoman.dist %>'
            },
            html: '<%= yeoman.app %>/index.html'
        },
        usemin: {
            options: {
                dirs: ['<%= yeoman.dist %>']
            },
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css']
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/main.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.app %>/styles/{,*/}*.css'
                    ]
                }
            }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,txt}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/*',
                        'views/{,*/}*.html'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= yeoman.dist %>/images',
                    src: [
                        'generated/*'
                    ]
                }]
            }
        },
        concurrent: {
            server: [
                'compass:server'
            ],
            test: [
                'compass'
            ],
            dist: [
                'compass:dist',
                'imagemin',
                'svgmin',
                'htmlmin'
            ]
        }
    });

    grunt.registerTask('server', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'concurrent:server',
            'connect:livereload',
            'open',
            'watch'
        ]);
    });

    grunt.registerTask('test', [
        'clean:server',
        'concurrent:test',
        'connect:test'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        'useminPrepare',
        'concurrent:dist',
        'cssmin',
        'concat',
        'uglify',
        'copy',
        'rev',
        'usemin'
    ]);

    grunt.registerTask('default', [
        'test',
        'build'
    ]);
};
<commit_msg>Remove test task<commit_after>// Generated on 2013-07-11 using generator-webapp 0.2.2
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            options: {
                nospawn: true
            },
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server']
            },
            livereload: {
                options: {
                    livereload: LIVERELOAD_PORT
                },
                files: [
                    '<%= yeoman.app %>/*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ]
            }
        },
        connect: {
            options: {
                port: 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.app),
                            lrSnippet
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, yeomanConfig.dist)
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= yeoman.app %>/images',
                javascriptsDir: '<%= yeoman.app %>/scripts',
                fontsDir: '<%= yeoman.app %>/styles/fonts',
                importPath: '<%= yeoman.app %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                relativeAssets: false
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            dist: {}
        },*/
        // not enabled since usemin task does concat and uglify
        // check index.html to edit your build targets
        // enable this task if you prefer defining your build targets here
        /*uglify: {
            dist: {}
        },*/
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/styles/fonts/*'
                    ]
                }
            }
        },
        useminPrepare: {
            options: {
                dest: '<%= yeoman.dist %>'
            },
            html: '<%= yeoman.app %>/index.html'
        },
        usemin: {
            options: {
                dirs: ['<%= yeoman.dist %>']
            },
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css']
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/main.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.app %>/styles/{,*/}*.css'
                    ]
                }
            }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,txt}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/*',
                        'views/{,*/}*.html'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= yeoman.dist %>/images',
                    src: [
                        'generated/*'
                    ]
                }]
            }
        },
        concurrent: {
            server: [
                'compass:server'
            ],
            test: [
                'compass'
            ],
            dist: [
                'compass:dist',
                'imagemin',
                'svgmin',
                'htmlmin'
            ]
        }
    });

    grunt.registerTask('server', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'concurrent:server',
            'connect:livereload',
            'open',
            'watch'
        ]);
    });

    grunt.registerTask('build', [
        'clean:dist',
        'useminPrepare',
        'concurrent:dist',
        'cssmin',
        'concat',
        'uglify',
        'copy',
        'rev',
        'usemin'
    ]);

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


<commit_before>/* jshint node: true */

module.exports = function (grunt) {
  'use strict';

  // Force use of Unix newlines
  grunt.util.linefeed = '\n';

  RegExp.quote = function (string) {
    return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
  }

  var fs = require('fs')

  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
              ' * TODC Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
              ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
              ' * Licensed under <%= _.pluck(pkg.licenses, "type") %> (<%= _.pluck(pkg.licenses, "url") %>)\n' +
              ' */\n',
    jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',

    // Bootstrap variables
    bootstrapDir: 'bootstrap',
    bootstrapGit: 'https://github.com/twbs/bootstrap.git',
    bootstrapVersion: 'v3.1.0',

    // Task configuration.
    clean: {
      dist: ['dist']
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      gruntfile: {
        src: 'Gruntfile.js'
      },
      assets: {
        src: 'docs/assets/js/application.js'
      }
    },

    jscs: {
      options: {
        config: 'js/.jscs.json',
      },
      gruntfile: {
        src: ['Gruntfile.js']
      },
      assets: {
        src: ['docs/assets/js/application.js']
      }
    },

    csslint: {
      options: {
        csslintrc: 'less/.csslintrc'
      },
      src: [
        'dist/css/todc-bootstrap.css',
        'docs/assets/css/docs.css'
      ]
    },

    less: {
      compileCore: {
        options: {
          strictMath: true,
          sourceMap: true,
          outputSourceFiles: true,
          sourceMapURL: '<%= pkg.name %>.css.map',
          sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': 'less/todc-bootstrap.less'
        }
      },
      minify: {
        options: {
          cleancss: true,
          report: 'min'
        },
        files: {
          'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css'
        }
      }
    },

    usebanner: {
      dist: {
        options: {
          position: 'top',
          banner: '<%= banner %>'
        },
        files: {
          src: [
            'dist/css/<%= pkg.name %>.css',
            'dist/css/<%= pkg.name %>.min.css',
          ]
        }
      }
    },

    csscomb: {
      sort: {
        options: {
          config: 'less/.csscomb.json'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css']
        }
      }
    },

    copy: {
      bootstrap: {
        expand: true,
        flatten: false,
        cwd: '<%= bootstrapDir %>/dist',
        src: '**',
        dest: 'dist'
      },
      docs: {
        expand: true,
        cwd: './dist',
        src: [
          '{css,js}/*.min.*',
          'css/*.map',
          'fonts/*',
          'img/*'
        ],
        dest: 'docs/dist'
      },
      images: {
        expand: true,
        src: ['img/*'],
        dest: 'dist'
      }
    },

    compress: {
      main: {
        options: {
          archive: 'dist/<%= pkg.name %>-<%= pkg.version %>-dist.zip',
          mode: 'zip',
          pretty: true
        },
        expand: true,
        cwd: 'dist',
        src: '**',
        dest: 'todc-bootstrap/'
      }
    },

    jekyll: {
      docs: {}
    },

    validation: {
      options: {
        charset: 'utf-8',
        doctype: 'HTML5',
        failHard: true,
        reset: true,
        relaxerror: [
          'Bad value X-UA-Compatible for attribute http-equiv on element meta.',
          'Element img is missing required attribute src.'
        ]
      },
      files: {
        src: ['_gh_pages/**/*.html']
      }
    },

    watch: {
      less: {
        files: 'less/*.less',
        tasks: ['less']
      }
    },

    // checkout-bootstrap task
    shell: {
      gitclone: {
        command: 'git clone <%= bootstrapGit %> <%= bootstrapDir %>',
        options: {
          failOnError: true,
          stderr: true,
          stdout: true
        }
      },
      gitcheckout: {
        command: 'git checkout tags/<%= bootstrapVersion %>',
        options: {
          stderr: true,
          stdout: true,
          execOptions: {
            cwd: '<%= bootstrapDir %>'
          }
        }
      }
    },

    sed: {
      versionNumber: {
        pattern: (function () {
          var old = grunt.option('oldver')
          return old ? RegExp.quote(old) : old
        })(),
        replacement: grunt.option('newver'),
        recursive: true
      }
    }
  });

  // These plugins provide necessary tasks.
  require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});

  // Clone bootstrap and checkout the appropriate tag task.
  grunt.registerTask('checkout-bootstrap', ['shell']);

  // Docs HTML validation task
  grunt.registerTask('validate-html', ['jekyll', 'validation']);

  // Test task.
  var testSubtasks = ['dist-css', 'jshint', 'jscs', 'validate-html'];
  grunt.registerTask('test', testSubtasks);

  // CSS distribution task.
  grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner', 'dist-docs']);

  // Docs distribution task.
  grunt.registerTask('dist-docs', ['copy:docs']);

  // // Full distribution task.
  // grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']);
  grunt.registerTask('dist', ['clean', 'dist-css', 'copy']);

  // // Default task.
  grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data']);

  // Version numbering task.
  // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
  // This can be overzealous, so its changes should always be manually reviewed!
  grunt.registerTask('change-version-number', ['sed']);

  grunt.registerTask('build-glyphicons-data', function () {
    // Pass encoding, utf8, so `readFileSync` will return a string instead of a
    // buffer
    var glyphiconsFile = fs.readFileSync('bootstrap/less/glyphicons.less', 'utf8')
    var glpyhiconsLines = glyphiconsFile.split('\n')

    // Use any line that starts with ".glyphicon-" and capture the class name
    var iconClassName = /^\.(glyphicon-[^\s]+)/
    var glyphiconsData = '# This file is generated via Grunt task. **Do not edit directly.** \n' +
                         '# See the \'build-glyphicons-data\' task in Gruntfile.js.\n\n';
    for (var i = 0, len = glpyhiconsLines.length; i < len; i++) {
      var match = glpyhiconsLines[i].match(iconClassName)

      if (match != null) {
        glyphiconsData += '- ' + match[1] + '\n'
      }
    }

    // Create the `_data` directory if it doesn't already exist
    if (!fs.existsSync('docs/_data')) fs.mkdirSync('docs/_data')

    fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData)
  });
};
<commit_msg>enable CSSLint in test suite; fixes 12094<commit_after>/* jshint node: true */

module.exports = function (grunt) {
  'use strict';

  // Force use of Unix newlines
  grunt.util.linefeed = '\n';

  RegExp.quote = function (string) {
    return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
  }

  var fs = require('fs')

  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
              ' * TODC Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
              ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
              ' * Licensed under <%= _.pluck(pkg.licenses, "type") %> (<%= _.pluck(pkg.licenses, "url") %>)\n' +
              ' */\n',
    jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',

    // Bootstrap variables
    bootstrapDir: 'bootstrap',
    bootstrapGit: 'https://github.com/twbs/bootstrap.git',
    bootstrapVersion: 'v3.1.0',

    // Task configuration.
    clean: {
      dist: ['dist']
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      gruntfile: {
        src: 'Gruntfile.js'
      },
      assets: {
        src: 'docs/assets/js/application.js'
      }
    },

    jscs: {
      options: {
        config: 'js/.jscs.json',
      },
      gruntfile: {
        src: ['Gruntfile.js']
      },
      assets: {
        src: ['docs/assets/js/application.js']
      }
    },

    csslint: {
      options: {
        csslintrc: 'less/.csslintrc'
      },
      src: [
        'dist/css/todc-bootstrap.css',
        'docs/assets/css/docs.css'
      ]
    },

    less: {
      compileCore: {
        options: {
          strictMath: true,
          sourceMap: true,
          outputSourceFiles: true,
          sourceMapURL: '<%= pkg.name %>.css.map',
          sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': 'less/todc-bootstrap.less'
        }
      },
      minify: {
        options: {
          cleancss: true,
          report: 'min'
        },
        files: {
          'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css'
        }
      }
    },

    usebanner: {
      dist: {
        options: {
          position: 'top',
          banner: '<%= banner %>'
        },
        files: {
          src: [
            'dist/css/<%= pkg.name %>.css',
            'dist/css/<%= pkg.name %>.min.css',
          ]
        }
      }
    },

    csscomb: {
      sort: {
        options: {
          config: 'less/.csscomb.json'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css']
        }
      }
    },

    copy: {
      bootstrap: {
        expand: true,
        flatten: false,
        cwd: '<%= bootstrapDir %>/dist',
        src: '**',
        dest: 'dist'
      },
      docs: {
        expand: true,
        cwd: './dist',
        src: [
          '{css,js}/*.min.*',
          'css/*.map',
          'fonts/*',
          'img/*'
        ],
        dest: 'docs/dist'
      },
      images: {
        expand: true,
        src: ['img/*'],
        dest: 'dist'
      }
    },

    compress: {
      main: {
        options: {
          archive: 'dist/<%= pkg.name %>-<%= pkg.version %>-dist.zip',
          mode: 'zip',
          pretty: true
        },
        expand: true,
        cwd: 'dist',
        src: '**',
        dest: 'todc-bootstrap/'
      }
    },

    jekyll: {
      docs: {}
    },

    validation: {
      options: {
        charset: 'utf-8',
        doctype: 'HTML5',
        failHard: true,
        reset: true,
        relaxerror: [
          'Bad value X-UA-Compatible for attribute http-equiv on element meta.',
          'Element img is missing required attribute src.'
        ]
      },
      files: {
        src: ['_gh_pages/**/*.html']
      }
    },

    watch: {
      less: {
        files: 'less/*.less',
        tasks: ['less']
      }
    },

    // checkout-bootstrap task
    shell: {
      gitclone: {
        command: 'git clone <%= bootstrapGit %> <%= bootstrapDir %>',
        options: {
          failOnError: true,
          stderr: true,
          stdout: true
        }
      },
      gitcheckout: {
        command: 'git checkout tags/<%= bootstrapVersion %>',
        options: {
          stderr: true,
          stdout: true,
          execOptions: {
            cwd: '<%= bootstrapDir %>'
          }
        }
      }
    },

    sed: {
      versionNumber: {
        pattern: (function () {
          var old = grunt.option('oldver')
          return old ? RegExp.quote(old) : old
        })(),
        replacement: grunt.option('newver'),
        recursive: true
      }
    }
  });

  // These plugins provide necessary tasks.
  require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});

  // Clone bootstrap and checkout the appropriate tag task.
  grunt.registerTask('checkout-bootstrap', ['shell']);

  // Docs HTML validation task
  grunt.registerTask('validate-html', ['jekyll', 'validation']);

  // Test task.
  var testSubtasks = ['dist-css', 'csslint', 'jshint', 'jscs', 'validate-html'];
  grunt.registerTask('test', testSubtasks);

  // CSS distribution task.
  grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner', 'dist-docs']);

  // Docs distribution task.
  grunt.registerTask('dist-docs', ['copy:docs']);

  // // Full distribution task.
  // grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']);
  grunt.registerTask('dist', ['clean', 'dist-css', 'copy']);

  // // Default task.
  grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data']);

  // Version numbering task.
  // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
  // This can be overzealous, so its changes should always be manually reviewed!
  grunt.registerTask('change-version-number', ['sed']);

  grunt.registerTask('build-glyphicons-data', function () {
    // Pass encoding, utf8, so `readFileSync` will return a string instead of a
    // buffer
    var glyphiconsFile = fs.readFileSync('bootstrap/less/glyphicons.less', 'utf8')
    var glpyhiconsLines = glyphiconsFile.split('\n')

    // Use any line that starts with ".glyphicon-" and capture the class name
    var iconClassName = /^\.(glyphicon-[^\s]+)/
    var glyphiconsData = '# This file is generated via Grunt task. **Do not edit directly.** \n' +
                         '# See the \'build-glyphicons-data\' task in Gruntfile.js.\n\n';
    for (var i = 0, len = glpyhiconsLines.length; i < len; i++) {
      var match = glpyhiconsLines[i].match(iconClassName)

      if (match != null) {
        glyphiconsData += '- ' + match[1] + '\n'
      }
    }

    // Create the `_data` directory if it doesn't already exist
    if (!fs.existsSync('docs/_data')) fs.mkdirSync('docs/_data')

    fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData)
  });
};
<|endoftext|>


<commit_before>var path = require('path');

module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-yuidoc');

    //explicity set source files because order is important
    var srcFiles = [
        '<%= dirs.src %>/core.js',
        '<%= dirs.src %>/utils/utils.js',
        '<%= dirs.src %>/utils/vector.js',
        '<%= dirs.src %>/audio/audio.js',
        '<%= dirs.src %>/controls/controls.js',
        '<%= dirs.src %>/controls/gamepad.js',
        '<%= dirs.src %>/debug/debug.js',
        '<%= dirs.src %>/entity/Sprite.js',
        '<%= dirs.src %>/entity/Entity.js',
        '<%= dirs.src %>/entity/entityPool.js',
        '<%= dirs.src %>/gui/gui.js',
        '<%= dirs.src %>/gui/hud.js',
        '<%= dirs.src %>/gui/hud/HudItem.js',
        '<%= dirs.src %>/loader/loader.js',
        '<%= dirs.src %>/map/Map.js',
        '<%= dirs.src %>/map/Layer.js',
        '<%= dirs.src %>/map/tiled/TiledMap.js',
        '<%= dirs.src %>/map/tiled/TiledLayer.js',
        '<%= dirs.src %>/map/tiled/TiledTileset.js',
        '<%= dirs.src %>/map/tiled/TiledObjectGroup.js',
        '<%= dirs.src %>/plugin/plugin.js'
    ]

    var banner = [
        '/**',
        ' * @license',
        ' * <%= pkg.longName %> - v<%= pkg.version %>',
        ' * Copyright (c) 2012, Chad Engler',
        ' * <%= pkg.homepage %>',
        ' *',
        ' * Compiled: <%= grunt.template.today("yyyy-mm-dd") %>',
        ' *',
        ' * <%= pkg.longName %> is licensed under the <%= pkg.license %> License.',
        ' * <%= pkg.licenseUrl %>',
        ' */',
        ''
    ].join('\n');

    //Project Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        dirs: {
            build: 'build',
            docs: 'docs',
            src: 'src',
            test: 'test',
            tools: 'tools',
            vendor: 'vendor'
        },
        files: {
            vendor: '<%= dirs.vendor %>/**/*js',
            srcBlob: '<%= dirs.src %>/**/*.js',
            testBlob: '<%= dirs.test %>/unit/**/*.js',
            intro: '<%= dirs.src %>/intro.js',
            outro: '<%= dirs.src %>/outro.js',
            build: '<%= dirs.build %>/<%= pkg.name %>.js',
            buildMin: '<%= dirs.build %>/<%= pkg.name %>.min.js'
        },
        concat: {
            options: {
                banner: banner
            },
            dist: {
                src: ['<%= files.intro %>', '<%= files.vendor %>'].concat(srcFiles).concat(['<%= files.outro %>']),
                dest: '<%= files.build %>'
            }
        },
        uglify: {
            options: {
                banner: banner,
                mangle: false
            },
            dist: {
                src: '<%= files.build %>',
                dest: '<%= files.buildMin %>'
            }
        },
        jshint: {
            beforeconcat: ['<%= files.srcBlob %>'],
            afterconcat: ['<%= files.build %>'],
            test: ['<%= files.testBlob %>'],
            options: {
                /* Enforcement options */
                bitwise: false,     //allow bitwise operators
                camelcase: true,    //must use camelCase or UPPER_CASE
                curly: false,       //one line conditionals w/o braces are allowed
                eqeqeq: true,       //must use === if possible
                forin: true,        //forin loops much check hasOwnProperty
                immed: true,        //self-calling functions must be wrapped in parens
                latedef: true,      //can't use a variable until it is defined
                newcap: true,       //ctor names must be Captialized
                noarg: true,        //arguments.caller/callee are deprecated, disallow
                noempty: true,      //warn about empty blocks
                nonew: true,        //no using `new Constructor();` without saving the value (no using only side-effects)
                plusplus: false,    //you can use unary increment and decrement operators
                quotmark: true,     //quotes must be consistent
                unused: true,       //warn about declared but not used variables
                strict: false,      //do not require functions to be able to run in strict-mode
                trailing: true,     //help prevent weird whitespace errors in multi-line strings using \
                maxlen: 200,        //no line should be longer than 120 characters

                /* Environments */
                browser: true,      //this runs in a browser :)
                devel: false,       //warn about using console.log and the like
                jquery: false,      //no jquery used here
                node: false,        //no node support...YET! :)
                worker: true,       //web-workers are used

                /* Globals */
                undef: true,
                globals: {
                    requirejs: false,
                    require: false,
                    define: false,
                    gf: false,
                    QUnit: false,
                    Q: false,
                    $: false
                }
            }
        },
        connect: {
            qunit: {
                options: {
                    port: grunt.option('port-test') | 9002,
                    base: './'
                }
            },
            test: {
                options: {
                    port: grunt.option('port-test') | 9002,
                    base: './',
                    keepalive: true
                }
            }
        },
        qunit: {
            all: {
                options: {
                    urls: ['http://localhost:' + (grunt.option('port-test') || 9002) + '/test/index.html']
                }
            }
        },
        yuidoc: {
            compile: {
                name: '<%= pkg.name %>',
                description: '<%= pkg.description %>',
                version: '<%= pkg.version %>',
                url: '<%= pkg.homepage %>',
                options: {
                    paths: '<%= dirs.src %>',
                    outdir: '<%= dirs.docs %>'
                }
            }
        }
    });

    //Load tasks
    grunt.registerTask('default', ['concat', 'uglify']);
    grunt.registerTask('build', ['concat', 'uglify']);
    grunt.registerTask('test', ['concat', 'connect:qunit', 'qunit']);
    grunt.registerTask('docs', ['yuidoc']);
};<commit_msg>rename Vector.js<commit_after>var path = require('path');

module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-yuidoc');

    //explicity set source files because order is important
    var srcFiles = [
        '<%= dirs.src %>/core.js',
        '<%= dirs.src %>/utils/utils.js',
        '<%= dirs.src %>/utils/Vector.js',
        '<%= dirs.src %>/audio/audio.js',
        '<%= dirs.src %>/controls/controls.js',
        '<%= dirs.src %>/controls/gamepad.js',
        '<%= dirs.src %>/debug/debug.js',
        '<%= dirs.src %>/entity/Sprite.js',
        '<%= dirs.src %>/entity/Entity.js',
        '<%= dirs.src %>/entity/entityPool.js',
        '<%= dirs.src %>/gui/gui.js',
        '<%= dirs.src %>/gui/hud.js',
        '<%= dirs.src %>/gui/hud/HudItem.js',
        '<%= dirs.src %>/loader/loader.js',
        '<%= dirs.src %>/map/Map.js',
        '<%= dirs.src %>/map/Layer.js',
        '<%= dirs.src %>/map/tiled/TiledMap.js',
        '<%= dirs.src %>/map/tiled/TiledLayer.js',
        '<%= dirs.src %>/map/tiled/TiledTileset.js',
        '<%= dirs.src %>/map/tiled/TiledObjectGroup.js',
        '<%= dirs.src %>/plugin/plugin.js'
    ]

    var banner = [
        '/**',
        ' * @license',
        ' * <%= pkg.longName %> - v<%= pkg.version %>',
        ' * Copyright (c) 2012, Chad Engler',
        ' * <%= pkg.homepage %>',
        ' *',
        ' * Compiled: <%= grunt.template.today("yyyy-mm-dd") %>',
        ' *',
        ' * <%= pkg.longName %> is licensed under the <%= pkg.license %> License.',
        ' * <%= pkg.licenseUrl %>',
        ' */',
        ''
    ].join('\n');

    //Project Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        dirs: {
            build: 'build',
            docs: 'docs',
            src: 'src',
            test: 'test',
            tools: 'tools',
            vendor: 'vendor'
        },
        files: {
            vendor: '<%= dirs.vendor %>/**/*js',
            srcBlob: '<%= dirs.src %>/**/*.js',
            testBlob: '<%= dirs.test %>/unit/**/*.js',
            intro: '<%= dirs.src %>/intro.js',
            outro: '<%= dirs.src %>/outro.js',
            build: '<%= dirs.build %>/<%= pkg.name %>.js',
            buildMin: '<%= dirs.build %>/<%= pkg.name %>.min.js'
        },
        concat: {
            options: {
                banner: banner
            },
            dist: {
                src: ['<%= files.intro %>', '<%= files.vendor %>'].concat(srcFiles).concat(['<%= files.outro %>']),
                dest: '<%= files.build %>'
            }
        },
        uglify: {
            options: {
                banner: banner,
                mangle: false
            },
            dist: {
                src: '<%= files.build %>',
                dest: '<%= files.buildMin %>'
            }
        },
        jshint: {
            beforeconcat: ['<%= files.srcBlob %>'],
            afterconcat: ['<%= files.build %>'],
            test: ['<%= files.testBlob %>'],
            options: {
                /* Enforcement options */
                bitwise: false,     //allow bitwise operators
                camelcase: true,    //must use camelCase or UPPER_CASE
                curly: false,       //one line conditionals w/o braces are allowed
                eqeqeq: true,       //must use === if possible
                forin: true,        //forin loops much check hasOwnProperty
                immed: true,        //self-calling functions must be wrapped in parens
                latedef: true,      //can't use a variable until it is defined
                newcap: true,       //ctor names must be Captialized
                noarg: true,        //arguments.caller/callee are deprecated, disallow
                noempty: true,      //warn about empty blocks
                nonew: true,        //no using `new Constructor();` without saving the value (no using only side-effects)
                plusplus: false,    //you can use unary increment and decrement operators
                quotmark: true,     //quotes must be consistent
                unused: true,       //warn about declared but not used variables
                strict: false,      //do not require functions to be able to run in strict-mode
                trailing: true,     //help prevent weird whitespace errors in multi-line strings using \
                maxlen: 200,        //no line should be longer than 120 characters

                /* Environments */
                browser: true,      //this runs in a browser :)
                devel: false,       //warn about using console.log and the like
                jquery: false,      //no jquery used here
                node: false,        //no node support...YET! :)
                worker: true,       //web-workers are used

                /* Globals */
                undef: true,
                globals: {
                    requirejs: false,
                    require: false,
                    define: false,
                    gf: false,
                    QUnit: false,
                    Q: false,
                    $: false
                }
            }
        },
        connect: {
            qunit: {
                options: {
                    port: grunt.option('port-test') | 9002,
                    base: './'
                }
            },
            test: {
                options: {
                    port: grunt.option('port-test') | 9002,
                    base: './',
                    keepalive: true
                }
            }
        },
        qunit: {
            all: {
                options: {
                    urls: ['http://localhost:' + (grunt.option('port-test') || 9002) + '/test/index.html']
                }
            }
        },
        yuidoc: {
            compile: {
                name: '<%= pkg.name %>',
                description: '<%= pkg.description %>',
                version: '<%= pkg.version %>',
                url: '<%= pkg.homepage %>',
                options: {
                    paths: '<%= dirs.src %>',
                    outdir: '<%= dirs.docs %>'
                }
            }
        }
    });

    //Load tasks
    grunt.registerTask('default', ['concat', 'uglify']);
    grunt.registerTask('build', ['concat', 'uglify']);
    grunt.registerTask('test', ['concat', 'connect:qunit', 'qunit']);
    grunt.registerTask('docs', ['yuidoc']);
};<|endoftext|>