<commit_before>// Generated on 2014-12-15 using generator-mobile 1.0.0-alpha.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));
};
var modRewrite = require('connect-modrewrite');
var proxyRequest = require('grunt-connect-proxy/lib/utils').proxyRequest;

// # 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) {
    // 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'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        // TODO: Make this conditional
        watch: {
            coffee: {
                files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
                tasks: ['coffee:dist']
            },
            coffeeTest: {
                files: ['test/spec/{,*/}*.coffee'],
                tasks: ['coffee:test']
            },
            compass: {
                files: ['<%= yeoman.app %>**/*.{scss,sass}'],
                tasks: ['compass:server']
            },
            less: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.less'],
                tasks: ['less:dist']
            },
            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}'
                ]
            }
        },
        autoshot: {
            dist: {
                options: {
                    path: '<%= yeoman.dist %>/screenshots/',
                    remote : {
                        files: [
                            { src: 'http://localhost:<%= connect.options.port %>', dest: 'app.jpg'}
                        ]
                    },
                    viewport: ['320x480','480x320','384x640','640x384','602x963','963x602','600x960','960x600','800x1280','1280x800','768x1024','1024x768']
                }
            }
        },

        responsive_images: {
            dev: {
                options: {
                    sizes: [
                        {
                            width: 320,
                        },
                        {
                            width: 640
                        },
                        {
                            width: 1024
                        }
                    ]
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        connect: {
            options: {
                port: process.env.PORT || 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
            proxies: [
                {
                    context: ['/api', '/static'],
                    host: 'coding.net',
                    https: true,
                    changeOrigin: true
                }
            ],
            livereload: {
                options: {
                    port: 80,
                    middleware: function (connect) {
                        return [
                            proxyRequest,
                            modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png|\\.eot|\\.ttf|\\.woff$ /index.html [L]']),
                            lrSnippet,
                            //mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.app)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            proxyRequest,
                            modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png|\\.eot|\\.ttf|\\.woff$ /index.html [L]']),
                            mountFolder(connect, yeomanConfig.dist)
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://m.coding.net:<%= connect.options.port %>'
            }

            ,
            nexus4:{
                path: 'http://www.browserstack.com/start#os=android&os_version=4.2&device=LG+Nexus+4&speed=1&start=true&url=http://rnikitin.github.io/examples/jumbotron/'
            },
            nexus7:{
                path: 'http://www.browserstack.com/start#os=android&os_version=4.1&device=Google+Nexus+7&speed=1&start=true&url=http://rnikitin.github.io/examples/jumbotron/'
            },
            iphone5:{
                path: 'http://www.browserstack.com/start#os=ios&os_version=6.0&device=iPhone+5&speed=1&start=true&url=http://rnikitin.github.io/examples/jumbotron/'
            }

        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        browser_sync: {
            dev: {
                bsFiles: {
                    src : '<%= yeoman.app %>/styles/style.css'
                },
                options: {
                    watchTask: false,
                    debugInfo: true,
                    // Change to 0.0.0.0 to access externally
                    host: 'http://localhost:<%= connect.options.port %>',
                    server: {
                        baseDir: '<%= yeoman.app %>'
                    },
                    ghostMode: {
                        clicks: true,
                        scroll: true,
                        links: true,
                        forms: true
                    }
                }
            }
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: [
                '<%= yeoman.app %>/scripts/{,*/}*.js',
                '!<%= yeoman.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://localhost:<%= connect.options.port %>/index.html']
                }
            }
        },
        coffee: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/scripts',
                    src: '{,*/}*.coffee',
                    dest: '<%= yeoman.app %>/scripts',
                    ext: '.js'
                }]
            },
            test: {
                files: [{
                    expand: true,
                    cwd: 'test/spec',
                    src: '{,*/}*.coffee',
                    dest: '.tmp/spec',
                    ext: '.js'
                }]
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles',
                cssDir: '<%= yeoman.app %>/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',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        less: {
            options: {
                paths: ['<%= yeoman.app %>/bower_components'],
                compress: true,
                yuicompress: true,
                optimization: 2
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/styles',
                    src: '{,*/}*.less',
                    dest: '<%= yeoman.app %>/styles',
                    ext:  '.css'
                }]
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            dist: {}
        },*/
        //requirejs: {
        //    dist: {
        //        // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
        //        options: {
        //            // `name` and `out` is set by grunt-usemin
        //            baseUrl: yeomanConfig.app + '/scripts',
        //            optimize: 'none',
        //            // TODO: Figure out how to make sourcemaps work with grunt-usemin
        //            // https://github.com/yeoman/grunt-usemin/issues/30
        //            //generateSourceMaps: true,
        //            // required to support SourceMaps
        //            // http://requirejs.org/docs/errors.html#sourcemapcomments
        //            preserveLicenseComments: false,
        //            useStrict: true,
        //            wrap: true
        //            //uglify2: {} // https://github.com/mishoo/UglifyJS2
        //        }
        //    }
        //},
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
                        '!<%= yeoman.dist %>/images/static/*.{png,jpg,jpeg,gif,webp}',
                        '<%= yeoman.dist %>/styles/fonts/*',
                        '<%= yeoman.dist %>/bower_components/{,*}*.{js,css}'
                    ]
                }
            }
        },

        modernizr: {

            // Path to the build you're using for development.
            "devFile" : "<%= yeoman.app %>/bower_components/modernizr/modernizr.js",

            // Path to save out the built file.
            "outputFile" : "<%= yeoman.dist %>/scripts/modernizr.js",

            // Based on default settings on http://modernizr.com/download/
            "extra" : {
                "shiv" : true,
                "printshiv" : false,
                "load" : true,
                "mq" : false,
                "cssclasses" : true
            },

            // Based on default settings on http://modernizr.com/download/
            "extensibility" : {
                "addtest" : false,
                "prefixed" : false,
                "teststyles" : false,
                "testprops" : false,
                "testallprops" : false,
                "hasevents" : false,
                "prefixes" : false,
                "domprefixes" : false
            },

            // By default, source is uglified before saving
            "uglify" : true,

            // Define any tests you want to impliticly include.
            "tests" : [],

            // By default, this task will crawl your project for references to Modernizr tests.
            // Set to false to disable.
            "parseFiles" : true,

            // When parseFiles = true, this task will crawl all *.js, *.css, *.scss files, except files that are in node_modules/.
            // You can override this by defining a "files" array below.
            // "files" : [],

            // When parseFiles = true, matchCommunityTests = true will attempt to
            // match user-contributed tests.
            "matchCommunityTests" : false,

            // Have custom Modernizr tests? Add paths to their location here.
            "customTests" : []
        },

        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: 'index.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,png,txt}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif,ttf,eot,woff,woff2}',
                        'fonts/*',
                        'views/**/*.html'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= yeoman.dist %>/images',
                    src: [
                        'generated/*'
                    ]
                }]
            }
        },
        concurrent: {
            server: [
                'coffee:dist',
                'compass:server',
                'less:dist'
            ],
            test: [
                'coffee:dist',
                'compass',
                'less:dist'
            ],
            dist: [
                'coffee:dist',
                'compass:dist',
                'less:dist',
                'imagemin',
                'svgmin',
                'htmlmin'
            ]
        }
        //bower: {
        //    options: {
        //        exclude: ['modernizr']
        //    },
        //    all: {
        //        rjsConfig: '<%= yeoman.app %>/scripts/main.js'
        //    }
        //}
    });

    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-connect-proxy');

    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]);
    });

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

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

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

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

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

    grunt.registerTask('screenshots', [
        'clean:server',
        'concurrent:server',
        'connect:livereload',
        'autoshot'
    ]);

};
<commit_msg>disable proxy for now<commit_after>// Generated on 2014-12-15 using generator-mobile 1.0.0-alpha.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));
};
var modRewrite = require('connect-modrewrite');
var proxyRequest = require('grunt-connect-proxy/lib/utils').proxyRequest;

// # 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) {
    // 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'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        // TODO: Make this conditional
        watch: {
            coffee: {
                files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
                tasks: ['coffee:dist']
            },
            coffeeTest: {
                files: ['test/spec/{,*/}*.coffee'],
                tasks: ['coffee:test']
            },
            compass: {
                files: ['<%= yeoman.app %>**/*.{scss,sass}'],
                tasks: ['compass:server']
            },
            less: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.less'],
                tasks: ['less:dist']
            },
            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}'
                ]
            }
        },
        autoshot: {
            dist: {
                options: {
                    path: '<%= yeoman.dist %>/screenshots/',
                    remote : {
                        files: [
                            { src: 'http://localhost:<%= connect.options.port %>', dest: 'app.jpg'}
                        ]
                    },
                    viewport: ['320x480','480x320','384x640','640x384','602x963','963x602','600x960','960x600','800x1280','1280x800','768x1024','1024x768']
                }
            }
        },

        responsive_images: {
            dev: {
                options: {
                    sizes: [
                        {
                            width: 320,
                        },
                        {
                            width: 640
                        },
                        {
                            width: 1024
                        }
                    ]
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        connect: {
            options: {
                port: process.env.PORT || 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
            //proxies: [
            //    {
            //        context: ['/api', '/static'],
            //        host: 'coding.net',
            //        https: true,
            //        changeOrigin: true
            //    }
            //],
            livereload: {
                options: {
                    port: 80,
                    middleware: function (connect) {
                        return [
                            //proxyRequest,
                            modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png|\\.eot|\\.ttf|\\.woff$ /index.html [L]']),
                            lrSnippet,
                            //mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.app)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            proxyRequest,
                            modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png|\\.eot|\\.ttf|\\.woff$ /index.html [L]']),
                            mountFolder(connect, yeomanConfig.dist)
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://m.coding.net:<%= connect.options.port %>'
            }

            ,
            nexus4:{
                path: 'http://www.browserstack.com/start#os=android&os_version=4.2&device=LG+Nexus+4&speed=1&start=true&url=http://rnikitin.github.io/examples/jumbotron/'
            },
            nexus7:{
                path: 'http://www.browserstack.com/start#os=android&os_version=4.1&device=Google+Nexus+7&speed=1&start=true&url=http://rnikitin.github.io/examples/jumbotron/'
            },
            iphone5:{
                path: 'http://www.browserstack.com/start#os=ios&os_version=6.0&device=iPhone+5&speed=1&start=true&url=http://rnikitin.github.io/examples/jumbotron/'
            }

        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        browser_sync: {
            dev: {
                bsFiles: {
                    src : '<%= yeoman.app %>/styles/style.css'
                },
                options: {
                    watchTask: false,
                    debugInfo: true,
                    // Change to 0.0.0.0 to access externally
                    host: 'http://localhost:<%= connect.options.port %>',
                    server: {
                        baseDir: '<%= yeoman.app %>'
                    },
                    ghostMode: {
                        clicks: true,
                        scroll: true,
                        links: true,
                        forms: true
                    }
                }
            }
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: [
                '<%= yeoman.app %>/scripts/{,*/}*.js',
                '!<%= yeoman.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://localhost:<%= connect.options.port %>/index.html']
                }
            }
        },
        coffee: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/scripts',
                    src: '{,*/}*.coffee',
                    dest: '<%= yeoman.app %>/scripts',
                    ext: '.js'
                }]
            },
            test: {
                files: [{
                    expand: true,
                    cwd: 'test/spec',
                    src: '{,*/}*.coffee',
                    dest: '.tmp/spec',
                    ext: '.js'
                }]
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles',
                cssDir: '<%= yeoman.app %>/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',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        less: {
            options: {
                paths: ['<%= yeoman.app %>/bower_components'],
                compress: true,
                yuicompress: true,
                optimization: 2
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/styles',
                    src: '{,*/}*.less',
                    dest: '<%= yeoman.app %>/styles',
                    ext:  '.css'
                }]
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            dist: {}
        },*/
        //requirejs: {
        //    dist: {
        //        // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
        //        options: {
        //            // `name` and `out` is set by grunt-usemin
        //            baseUrl: yeomanConfig.app + '/scripts',
        //            optimize: 'none',
        //            // TODO: Figure out how to make sourcemaps work with grunt-usemin
        //            // https://github.com/yeoman/grunt-usemin/issues/30
        //            //generateSourceMaps: true,
        //            // required to support SourceMaps
        //            // http://requirejs.org/docs/errors.html#sourcemapcomments
        //            preserveLicenseComments: false,
        //            useStrict: true,
        //            wrap: true
        //            //uglify2: {} // https://github.com/mishoo/UglifyJS2
        //        }
        //    }
        //},
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
                        '!<%= yeoman.dist %>/images/static/*.{png,jpg,jpeg,gif,webp}',
                        '<%= yeoman.dist %>/styles/fonts/*',
                        '<%= yeoman.dist %>/bower_components/{,*}*.{js,css}'
                    ]
                }
            }
        },

        modernizr: {

            // Path to the build you're using for development.
            "devFile" : "<%= yeoman.app %>/bower_components/modernizr/modernizr.js",

            // Path to save out the built file.
            "outputFile" : "<%= yeoman.dist %>/scripts/modernizr.js",

            // Based on default settings on http://modernizr.com/download/
            "extra" : {
                "shiv" : true,
                "printshiv" : false,
                "load" : true,
                "mq" : false,
                "cssclasses" : true
            },

            // Based on default settings on http://modernizr.com/download/
            "extensibility" : {
                "addtest" : false,
                "prefixed" : false,
                "teststyles" : false,
                "testprops" : false,
                "testallprops" : false,
                "hasevents" : false,
                "prefixes" : false,
                "domprefixes" : false
            },

            // By default, source is uglified before saving
            "uglify" : true,

            // Define any tests you want to impliticly include.
            "tests" : [],

            // By default, this task will crawl your project for references to Modernizr tests.
            // Set to false to disable.
            "parseFiles" : true,

            // When parseFiles = true, this task will crawl all *.js, *.css, *.scss files, except files that are in node_modules/.
            // You can override this by defining a "files" array below.
            // "files" : [],

            // When parseFiles = true, matchCommunityTests = true will attempt to
            // match user-contributed tests.
            "matchCommunityTests" : false,

            // Have custom Modernizr tests? Add paths to their location here.
            "customTests" : []
        },

        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: 'index.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,png,txt}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif,ttf,eot,woff,woff2}',
                        'fonts/*',
                        'views/**/*.html'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= yeoman.dist %>/images',
                    src: [
                        'generated/*'
                    ]
                }]
            }
        },
        concurrent: {
            server: [
                'coffee:dist',
                'compass:server',
                'less:dist'
            ],
            test: [
                'coffee:dist',
                'compass',
                'less:dist'
            ],
            dist: [
                'coffee:dist',
                'compass:dist',
                'less:dist',
                'imagemin',
                'svgmin',
                'htmlmin'
            ]
        }
        //bower: {
        //    options: {
        //        exclude: ['modernizr']
        //    },
        //    all: {
        //        rjsConfig: '<%= yeoman.app %>/scripts/main.js'
        //    }
        //}
    });

    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-connect-proxy');

    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]);
    });

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

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

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

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

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

    grunt.registerTask('screenshots', [
        'clean:server',
        'concurrent:server',
        'connect:livereload',
        'autoshot'
    ]);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-karma');
	grunt.loadNpmTasks('grunt-ng-annotate');

	grunt.registerTask('default', ['jshint', 'karma:dist', 'concat:dev']);
	grunt.registerTask('dist', ['jshint', 'karma:dist', 'concat:dist', 'ngAnnotate:dist', 'uglify:dist', 'clean']);
	grunt.registerTask('test', ['jshint', 'concat:dev', 'karma:dev']);

	grunt.initConfig({
		concat: {
			dev: {
				src: ['src/*.js', 'src/**/*.js', '!src/modules/ngSharepointMocks/*'],
				dest: 'dist/angular-sharepoint.js'
			},
			dist: {
				files: {
					'tmp/angular-sharepoint.js':['src/*.js', 'src/**/*.js', '!src/modules/ngSharepointMocks/*'],
					//'tmp/angular-sharepoint-full.js':['src/*.js', 'src/**/*.js', '!src/modules/ngSharepointMocks/*'],
					//'tmp/angular-sharepoint.js':['src/modules/ngSharepoint/**/*.js'],
					//'tmp/angular-sharepoint-lists.js':['src/modules/ngSharepointLists/**/*.js'],
					'tmp/angular-sharepoint-mocks.js':['src/modules/ngSharepointMocks/**/*.js']
				}
			}
		},
		jshint: {
			default: ['src/*.js', 'src/**/*.js']
		},
		ngAnnotate: {
			dist: {
				files: {
					'dist/angular-sharepoint.js': ['tmp/angular-sharepoint.js'],
					//'dist/angular-sharepoint-full.js': ['tmp/angular-sharepoint-full.js'],
					//'dist/angular-sharepoint-lists.js': ['tmp/angular-sharepoint-lists.js'],
					'dist/angular-sharepoint-mocks.js': ['tmp/angular-sharepoint-mocks.js']
				}
			}
		},
		uglify: {
			dist: {
				compress: true,
				files: {
					'dist/angular-sharepoint.min.js': ['dist/angular-sharepoint.js'],
					//'dist/angular-sharepoint-full.min.js': ['dist/angular-sharepoint-full.js'],
					//'dist/angular-sharepoint-lists.min.js': ['dist/angular-sharepoint-lists.js'],
					'dist/angular-sharepoint-mocks.min.js': ['dist/angular-sharepoint-mocks.js'],
				}
			}
		},
		karma: {
			options: {
				frameworks: ['jasmine'],
				files: [
					'bower_components/angular/angular.min.js',
					'bower_components/angular-mocks/angular-mocks.js',
					'src/**/*.js',
					'test/unit/**/*.js'
				],
				singleRun: true,
				preprocessors: {
					'src/*.js': 'coverage'
				},
				reporters: ['progress', 'coverage'],
				coverageReporter: {
				  type : 'lcovonly',
				  dir : 'coverage/'
				}
			},
			dev: {
				browsers: ['Chrome']
			},
			dist: {
				browsers: ['PhantomJS']
			}
		},
		clean: [
			'tmp/'
		]
	});
};
<commit_msg>Optimized task order and ignore spec files in the build<commit_after>module.exports = function(grunt) {
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-karma');
	grunt.loadNpmTasks('grunt-ng-annotate');

	grunt.registerTask('default', ['jshint', 'concat:dev', 'karma:dist']);
	grunt.registerTask('dist', ['jshint', 'concat:dist', 'ngAnnotate:dist', 'karma:dist', 'uglify:dist', 'clean']);
	grunt.registerTask('test', ['jshint', 'concat:dev', 'karma:dev']);

	grunt.initConfig({
		concat: {
			dev: {
				src: ['src/*.js', 'src/**/*.js', '!src/modules/ngSharepointMocks/*'],
				dest: 'dist/angular-sharepoint.js'
			},
			dist: {
				files: {
					'tmp/angular-sharepoint.js':['src/*.js', 'src/**/*.js', '!src/**/*.spec.js', '!src/modules/ngSharepointMocks/*'],
					//'tmp/angular-sharepoint-full.js':['src/*.js', 'src/**/*.js', '!src/modules/ngSharepointMocks/*'],
					//'tmp/angular-sharepoint.js':['src/modules/ngSharepoint/**/*.js'],
					//'tmp/angular-sharepoint-lists.js':['src/modules/ngSharepointLists/**/*.js'],
					'tmp/angular-sharepoint-mocks.js':['src/modules/ngSharepointMocks/**/*.js']
				}
			}
		},
		jshint: {
			default: ['src/*.js', 'src/**/*.js', '!src/**/*.spec.js']
		},
		ngAnnotate: {
			dist: {
				files: {
					'dist/angular-sharepoint.js': ['tmp/angular-sharepoint.js'],
					//'dist/angular-sharepoint-full.js': ['tmp/angular-sharepoint-full.js'],
					//'dist/angular-sharepoint-lists.js': ['tmp/angular-sharepoint-lists.js'],
					'dist/angular-sharepoint-mocks.js': ['tmp/angular-sharepoint-mocks.js']
				}
			}
		},
		uglify: {
			dist: {
				compress: true,
				files: {
					'dist/angular-sharepoint.min.js': ['dist/angular-sharepoint.js'],
					//'dist/angular-sharepoint-full.min.js': ['dist/angular-sharepoint-full.js'],
					//'dist/angular-sharepoint-lists.min.js': ['dist/angular-sharepoint-lists.js'],
					'dist/angular-sharepoint-mocks.min.js': ['dist/angular-sharepoint-mocks.js'],
				}
			}
		},
		karma: {
			options: {
				frameworks: ['jasmine'],
				files: [
					'bower_components/angular/angular.min.js',
					'bower_components/angular-mocks/angular-mocks.js',
					'dist/angular-sharepoint.js',
					'src/**/*.spec.js'
				],
				singleRun: true,
				preprocessors: {
					'src/*.js': 'coverage'
				},
				reporters: ['progress', 'coverage'],
				coverageReporter: {
				  type : 'lcovonly',
				  dir : 'coverage/'
				}
			},
			dev: {
				browsers: ['Chrome']
			},
			dist: {
				browsers: ['PhantomJS']
			}
		},
		clean: [
			'tmp/'
		]
	});
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

  // Grunt tasks
  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  // Assemble build
  grunt.loadNpmTasks('assemble');

  // Project configuration.
  grunt.initConfig({

    config: {
      src: 'src',
      dist: 'dist'
    },

    watch: {
      assemble: {
        files: ['<%= config.src %>/{content,data,templates}/{,*/}*.{md,hbs,yml}'],
        tasks: ['assemble']
      },
      compass: {
        files: ['<%= config.src %>/sass/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '.tmp/*.html',
          '.tmp/css/{,*/}*.css',
          '<%= config.dist %>/{,*/}*.html',
          '<%= config.dist %>/assets/{,*/}*.css',
          '<%= config.dist %>/assets/{,*/}*.js',
          '<%= config.dist %>/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    connect: {
      options: {
        port: 9000,
        livereload: 35729,
        // change this to '0.0.0.0' to access the server from outside
        hostname: 'localhost'
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= config.dist %>'
          ]
        }
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        loadAll: '<%= config.src %>/assets/gumby/sass/extensions',
        sassDir: '<%= config.src %>/sass',
        cssDir: '.tmp/css',
        generatedImagesDir: '.tmp/img/generated',
        imagesDir: '<%= config.src %>/img',
        fontsDir: '<%= config.src %>/fonts',
        importPath: '<%= config.src %>/assets',
        httpImagesPath: '/img',
        httpGeneratedImagesPath: '/img/generated',
        httpFontsPath: '/css/fonts',
        relativeAssets: true,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= config.dist %>/img/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

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

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= config.dist %>/js/{,*/}*.js',
            '<%= config.dist %>/css/{,*/}*.css',
            '<%= config.dist %>/img/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= config.dist %>/css/fonts/*'
          ]
        }
      }
    },

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

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= config.dist %>/{,*/}*.html'],
      css: ['<%= config.dist %>/css/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= config.dist %>']
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.{png,jpg,jpeg,gif}',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    svgmin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.svg',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.dist %>',
            src: '*.html',
            dest: '<%= config.dist %>'
          }
        ]
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [
          {
            expand: true,
            dot: true,
            cwd: '<%= config.src %>',
            dest: '<%= config.dist %>',
            src: [
              '*.{ico,png,txt}',
              'img/{,*/}*.{webp}',
              'fonts/*',
              'CNAME'
            ]
          },
          {
            expand: true,
            cwd: '.tmp',
            dest: '<%= config.dist %>',
            src: '*.html'
          },
          {
            expand: true,
            cwd: '.tmp/img',
            dest: '<%= config.dist %>/img',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '<%= config.dist %>/fonts',
            src: '**'
          }
        ]
      },
      dev: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '.tmp/fonts/',
            src: '**'
          }
        ]
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server',
        'assemble'
      ],
      dist: [
        'compass:dist',
        'assemble',
        'imagemin',
        'svgmin'
      ]
    },

    assemble: {
      pages: {
        options: {
          flatten: true,
          layout: 'default.hbs',
          layoutdir: '<%= config.src %>/templates/layouts',
          assets: '<%= config.dist %>/assets',
          partials: '<%= config.src %>/templates/partials/*.hbs',
          plugins: ['assemble-contrib-permalinks','assemble-contrib-sitemap'],
        },
        files: {
          '.tmp/': ['<%= config.src %>/templates/pages/*.hbs']
        }
      }
    },

    // Before generating any new files,
    // remove any previously-created files.

    clean: {
      dist: {
        files: [
          {
            dot: true,
            src: [
              '.tmp',
              '<%= config.dist %>/*',
              '!<%= config.dist %>/.git*'
            ]
          }
        ]
      },
      server: '.tmp'
    },

    // Automatically create/push gh-pages
    'gh-pages': {
      options: {
        base: 'dist'
      },
      src: ['**']
    }

  });

  grunt.registerTask('server', [
    'clean',
    'concurrent:server',
    'copy:dev',
    'autoprefixer',
    'connect:livereload',
    'watch'
  ]);

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

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

};
<commit_msg>Added deploy task<commit_after>'use strict';

module.exports = function(grunt) {

  // Grunt tasks
  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  // Assemble build
  grunt.loadNpmTasks('assemble');

  // Project configuration.
  grunt.initConfig({

    config: {
      src: 'src',
      dist: 'dist'
    },

    watch: {
      assemble: {
        files: ['<%= config.src %>/{content,data,templates}/{,*/}*.{md,hbs,yml}'],
        tasks: ['assemble']
      },
      compass: {
        files: ['<%= config.src %>/sass/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '.tmp/*.html',
          '.tmp/css/{,*/}*.css',
          '<%= config.dist %>/{,*/}*.html',
          '<%= config.dist %>/assets/{,*/}*.css',
          '<%= config.dist %>/assets/{,*/}*.js',
          '<%= config.dist %>/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    connect: {
      options: {
        port: 9000,
        livereload: 35729,
        // change this to '0.0.0.0' to access the server from outside
        hostname: 'localhost'
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= config.dist %>'
          ]
        }
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        loadAll: '<%= config.src %>/assets/gumby/sass/extensions',
        sassDir: '<%= config.src %>/sass',
        cssDir: '.tmp/css',
        generatedImagesDir: '.tmp/img/generated',
        imagesDir: '<%= config.src %>/img',
        fontsDir: '<%= config.src %>/fonts',
        importPath: '<%= config.src %>/assets',
        httpImagesPath: '/img',
        httpGeneratedImagesPath: '/img/generated',
        httpFontsPath: '/css/fonts',
        relativeAssets: true,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= config.dist %>/img/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

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

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= config.dist %>/js/{,*/}*.js',
            '<%= config.dist %>/css/{,*/}*.css',
            '<%= config.dist %>/img/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= config.dist %>/css/fonts/*'
          ]
        }
      }
    },

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

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= config.dist %>/{,*/}*.html'],
      css: ['<%= config.dist %>/css/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= config.dist %>']
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.{png,jpg,jpeg,gif}',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    svgmin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.svg',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.dist %>',
            src: '*.html',
            dest: '<%= config.dist %>'
          }
        ]
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [
          {
            expand: true,
            dot: true,
            cwd: '<%= config.src %>',
            dest: '<%= config.dist %>',
            src: [
              '*.{ico,png,txt}',
              'img/{,*/}*.{webp}',
              'fonts/*',
              'CNAME'
            ]
          },
          {
            expand: true,
            cwd: '.tmp',
            dest: '<%= config.dist %>',
            src: '*.html'
          },
          {
            expand: true,
            cwd: '.tmp/img',
            dest: '<%= config.dist %>/img',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '<%= config.dist %>/fonts',
            src: '**'
          }
        ]
      },
      dev: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '.tmp/fonts/',
            src: '**'
          }
        ]
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server',
        'assemble'
      ],
      dist: [
        'compass:dist',
        'assemble',
        'imagemin',
        'svgmin'
      ]
    },

    assemble: {
      pages: {
        options: {
          flatten: true,
          layout: 'default.hbs',
          layoutdir: '<%= config.src %>/templates/layouts',
          assets: '<%= config.dist %>/assets',
          partials: '<%= config.src %>/templates/partials/*.hbs',
          plugins: ['assemble-contrib-permalinks','assemble-contrib-sitemap'],
        },
        files: {
          '.tmp/': ['<%= config.src %>/templates/pages/*.hbs']
        }
      }
    },

    // Before generating any new files,
    // remove any previously-created files.

    clean: {
      dist: {
        files: [
          {
            dot: true,
            src: [
              '.tmp',
              '<%= config.dist %>/*',
              '!<%= config.dist %>/.git*'
            ]
          }
        ]
      },
      server: '.tmp'
    },

    // Automatically create/push gh-pages
    'gh-pages': {
      options: {
        base: 'dist'
      },
      src: ['**']
    }

  });

  grunt.registerTask('server', [
    'clean',
    'concurrent:server',
    'copy:dev',
    'autoprefixer',
    'connect:livereload',
    'watch'
  ]);

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

  grunt.registerTask('deploy', [
    'build',
    'gh-pages'
  ]);

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

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {

	/**
	 * 1.清理
	 * 2.用bower安装依赖
	 * 3.生成stylus样式
	 */
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),

		//claen the dist before copy & compile files
		clean: {
			dist: ["dist/"],
			examples: ["examples/butterfly"]
		},

		//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
		bower: {
			install: {
				options: {
					production: true,
					targetDir: 'vendor',
					layout: 'byComponent',
					install: true,
					verbose: true,
					cleanTargetDir: true,
					cleanBowerDir: true
				}
			}
		},

		//compile stylus to css
		stylus: {
			compile: {
				options: {
					'include css': true
				},
				files: {
					'dist/css/butterfly.css': 'stylus/butterfly.styl'
				}
			}
		},

		//copy the src/images and vendor to dist
		copy: {
			source: {
				files: [
					//复制butterfly的js源码到dist/js
					{expand: true, cwd: 'js/', src: ['**'], dest: 'dist/js'}
				]
			},
			vendor: {
				files: [
					//复制require.js
					{expand: true, cwd: 'vendor/requirejs', src: ['require.js'], dest: 'dist/js'},
					//复制ratchet的js文件到dist/js
					{expand: true, cwd: 'vendor/ratchet/js', src: ['ratchet.js'], dest: 'dist/js'},
					//复制ratchet的图标文件到dist/fonts
					{expand: true, cwd: 'vendor/ratchet/fonts', src: ['**'], dest: 'dist/fonts'},
					//复制整个vendor目录
					{expand: true, cwd: 'vendor/', src: ['**'], dest: 'dist/vendor'}
				]
			},
			examples: {
				files: [{expand: true, cwd: 'dist/', src: ['**'], dest: 'examples/butterfly/'}]
			}
		}
	});

	grunt.loadNpmTasks('grunt-bower-task');
	grunt.loadNpmTasks('grunt-contrib-symlink');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-requirejs');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');

	grunt.registerTask('build', [
		'clean:dist',
		'stylus:compile',
		'copy:vendor',
		'copy:source'
	]);

	grunt.registerTask('examples', [
		'clean:examples',
		'copy:examples'
	]);

	grunt.registerTask('default', [
		'build',
		'examples'
	]);
};<commit_msg>spell error<commit_after>module.exports = function(grunt) {

	/**
	 * 1.清理
	 * 2.用bower安装依赖
	 * 3.生成stylus样式
	 */
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),

		//clean the dist before copy & compile files
		clean: {
			dist: ["dist/"],
			examples: ["examples/butterfly"]
		},

		//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
		bower: {
			install: {
				options: {
					production: true,
					targetDir: 'vendor',
					layout: 'byComponent',
					install: true,
					verbose: true,
					cleanTargetDir: true,
					cleanBowerDir: true
				}
			}
		},

		//compile stylus to css
		stylus: {
			compile: {
				options: {
					'include css': true
				},
				files: {
					'dist/css/butterfly.css': 'stylus/butterfly.styl'
				}
			}
		},

		//copy the src/images and vendor to dist
		copy: {
			source: {
				files: [
					//复制butterfly的js源码到dist/js
					{expand: true, cwd: 'js/', src: ['**'], dest: 'dist/js'}
				]
			},
			vendor: {
				files: [
					//复制require.js
					{expand: true, cwd: 'vendor/requirejs', src: ['require.js'], dest: 'dist/js'},
					//复制ratchet的js文件到dist/js
					{expand: true, cwd: 'vendor/ratchet/js', src: ['ratchet.js'], dest: 'dist/js'},
					//复制ratchet的图标文件到dist/fonts
					{expand: true, cwd: 'vendor/ratchet/fonts', src: ['**'], dest: 'dist/fonts'},
					//复制整个vendor目录
					{expand: true, cwd: 'vendor/', src: ['**'], dest: 'dist/vendor'}
				]
			},
			examples: {
				files: [{expand: true, cwd: 'dist/', src: ['**'], dest: 'examples/butterfly/'}]
			}
		}
	});

	grunt.loadNpmTasks('grunt-bower-task');
	grunt.loadNpmTasks('grunt-contrib-symlink');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-requirejs');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');

	grunt.registerTask('build', [
		'clean:dist',
		'stylus:compile',
		'copy:vendor',
		'copy:source'
	]);

	grunt.registerTask('examples', [
		'clean:examples',
		'copy:examples'
	]);

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


<commit_before>// Gruntfile for VexFlow.
// Mohit Muthanna Cheppudira <mohit@muthanna.com>

module.exports = function(grunt) {
  var L = grunt.log.writeln;
  var BANNER = '/**\n' +
                ' * VexFlow <%= pkg.version %> built on <%= grunt.template.today("yyyy-mm-dd") %>.\n' +
                ' * Copyright (c) 2010 Mohit Muthanna Cheppudira <mohit@muthanna.com>\n' +
                ' *\n' +
                ' * http://www.vexflow.com  http://github.com/0xfe/vexflow\n' +
                ' */\n';
  var BUILD_DIR = 'build';
  var RELEASE_DIR = 'releases';
  var MODULE_ENTRY = 'src/index.js';
  var TARGET_RAW = BUILD_DIR + '/vexflow-debug.js';
  var TARGET_MIN = BUILD_DIR + '/vexflow-min.js';
  var TARGET_TESTS = BUILD_DIR + '/vexflow-tests.js';

  var SOURCES = ["src/*.js", "!src/header.js", "!src/container.js"];

  var TEST_SOURCES = [
    "tests/vexflow_test_helpers.js", "tests/mocks.js",
    "tests/*_tests.js", "tests/run.js"];

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        banner: BANNER,
        sourceMap: true
      },
      tests: {
        src: TEST_SOURCES,
        dest: TARGET_TESTS
      }
    },
    rollup: {
      options: {
        banner: BANNER,
        format: 'umd',
        moduleName: 'Vex',
        sourceMap: true
      },
      files: {
        src: MODULE_ENTRY,
        dest: TARGET_RAW
      }
    },
    uglify: {
      options: {
        banner: BANNER,
        sourceMap: true
      },
      build: {
        src: TARGET_RAW,
        dest: TARGET_MIN
      }
    },
    jshint: {
      files: SOURCES,
      options: {
        esversion: 6,
        eqnull: true,   // allow == and ~= for nulls
        sub: true,      // don't enforce dot notation
        trailing: true, // no more trailing spaces
        globals: {
          "Vex": false,
          "Raphael": false
         }
      }
    },
    qunit: {
      files: ['tests/flow.html']
    },
    watch: {
      scripts: {
        files: ['src/*', 'Gruntfile.js'],
        tasks: ['concat:vexflow'],
        options: {
          interrupt: true
        }
      },
      tests: {
        files: ['tests/*'],
        tasks: ['concat:tests'],
        options: {
          interrupt: true
        }
      }
    },
    copy: {
      release: {
        files: [
          {
            expand: true,
            dest: RELEASE_DIR,
            cwd: BUILD_DIR,
            src    : ['*.js', 'docs/**', '*.map']
          }
        ]
      }
    },
    docco: {
      src: SOURCES,
      options: {
        layout: 'linear',
        output: 'build/docs'
      }
    },
    gitcommit: {
      releases: {
        options: {
          message: "Committing release binaries for new version: <%= pkg.version %>",
          verbose: true
        },
        files: [
          {
            src: [RELEASE_DIR + "/*.js", RELEASE_DIR + "/*.map"],
            expand: true
          }
        ]
      }
    },
    bump: {
      options: {
        files: ['package.json', 'component.json'],
        commitFiles: ['package.json', 'component.json'],
        updateConfigs: ['pkg'],
        createTag: false,
        push: false
      }
    },
    release: {
      options: {
        bump: false,
        commit: false
      }
    },
    clean: [BUILD_DIR],
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-rollup');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-docco');
  grunt.loadNpmTasks('grunt-release');
  grunt.loadNpmTasks('grunt-bump');
  grunt.loadNpmTasks('grunt-git');

  // Default task(s).
  grunt.registerTask('default', ['jshint', 'rollup', 'concat', 'uglify', 'docco']);
  grunt.registerTask('test', 'Run qunit tests.', ['rollup', 'concat', 'qunit']);

  // Release current build.
  grunt.registerTask('stage', 'Stage current binaries to releases/.', function() {
    grunt.task.run('default');
    grunt.task.run('copy:release');
  });

  // Increment package version and publish to NPM.
  grunt.registerTask('publish', 'Publish VexFlow NPM.', function() {
    grunt.task.run('bump');
    grunt.task.run('stage');
    grunt.task.run('test');
    grunt.task.run('gitcommit:releases');
    grunt.task.run('release');
  });
};
<commit_msg>Using absolute paths in rollup:sourceMapFile to make it generate relative map paths.<commit_after>// Gruntfile for VexFlow.
// Mohit Muthanna Cheppudira <mohit@muthanna.com>

module.exports = function(grunt) {
  var path = require('path');
  var L = grunt.log.writeln;
  var BANNER = '/**\n' +
                ' * VexFlow <%= pkg.version %> built on <%= grunt.template.today("yyyy-mm-dd") %>.\n' +
                ' * Copyright (c) 2010 Mohit Muthanna Cheppudira <mohit@muthanna.com>\n' +
                ' *\n' +
                ' * http://www.vexflow.com  http://github.com/0xfe/vexflow\n' +
                ' */\n';
  var BASE_DIR = __dirname;
  var BUILD_DIR = path.join(BASE_DIR, 'build');
  var RELEASE_DIR = path.join(BASE_DIR, 'releases');
  var MODULE_ENTRY = path.join(BASE_DIR, 'src/index.js');
  var TARGET_RAW = path.join(BUILD_DIR, 'vexflow-debug.js');
  var TARGET_MIN = path.join(BUILD_DIR, 'vexflow-min.js');
  var TARGET_TESTS = path.join(BUILD_DIR, 'vexflow-tests.js');

  var SOURCES = ["src/*.js", "!src/header.js", "!src/container.js"];

  var TEST_SOURCES = [
    "tests/vexflow_test_helpers.js", "tests/mocks.js",
    "tests/*_tests.js", "tests/run.js"];

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        banner: BANNER,
        sourceMap: true
      },
      tests: {
        src: TEST_SOURCES,
        dest: TARGET_TESTS
      }
    },
    rollup: {
      options: {
        banner: BANNER,
        format: 'umd',
        moduleName: 'Vex',
        sourceMap: true,
        sourceMapFile: TARGET_RAW
      },
      files: {
        src: MODULE_ENTRY,
        dest: TARGET_RAW
      }
    },
    uglify: {
      options: {
        banner: BANNER,
        sourceMap: true
      },
      build: {
        src: TARGET_RAW,
        dest: TARGET_MIN
      }
    },
    jshint: {
      files: SOURCES,
      options: {
        esversion: 6,
        eqnull: true,   // allow == and ~= for nulls
        sub: true,      // don't enforce dot notation
        trailing: true, // no more trailing spaces
        globals: {
          "Vex": false,
          "Raphael": false
         }
      }
    },
    qunit: {
      files: ['tests/flow.html']
    },
    watch: {
      scripts: {
        files: ['src/*', 'Gruntfile.js'],
        tasks: ['concat:vexflow'],
        options: {
          interrupt: true
        }
      },
      tests: {
        files: ['tests/*'],
        tasks: ['concat:tests'],
        options: {
          interrupt: true
        }
      }
    },
    copy: {
      release: {
        files: [
          {
            expand: true,
            dest: RELEASE_DIR,
            cwd: BUILD_DIR,
            src    : ['*.js', 'docs/**', '*.map']
          }
        ]
      }
    },
    docco: {
      src: SOURCES,
      options: {
        layout: 'linear',
        output: 'build/docs'
      }
    },
    gitcommit: {
      releases: {
        options: {
          message: "Committing release binaries for new version: <%= pkg.version %>",
          verbose: true
        },
        files: [
          {
            src: [RELEASE_DIR + "/*.js", RELEASE_DIR + "/*.map"],
            expand: true
          }
        ]
      }
    },
    bump: {
      options: {
        files: ['package.json', 'component.json'],
        commitFiles: ['package.json', 'component.json'],
        updateConfigs: ['pkg'],
        createTag: false,
        push: false
      }
    },
    release: {
      options: {
        bump: false,
        commit: false
      }
    },
    clean: [BUILD_DIR],
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-rollup');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-docco');
  grunt.loadNpmTasks('grunt-release');
  grunt.loadNpmTasks('grunt-bump');
  grunt.loadNpmTasks('grunt-git');

  // Default task(s).
  grunt.registerTask('default', ['jshint', 'rollup', 'concat', 'uglify', 'docco']);
  grunt.registerTask('test', 'Run qunit tests.', ['rollup', 'concat', 'qunit']);

  // Release current build.
  grunt.registerTask('stage', 'Stage current binaries to releases/.', function() {
    grunt.task.run('default');
    grunt.task.run('copy:release');
  });

  // Increment package version and publish to NPM.
  grunt.registerTask('publish', 'Publish VexFlow NPM.', function() {
    grunt.task.run('bump');
    grunt.task.run('stage');
    grunt.task.run('test');
    grunt.task.run('gitcommit:releases');
    grunt.task.run('release');
  });
};
<|endoftext|>


<commit_before>
module.exports = function(grunt) {

    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    grunt.initConfig({

        // watch for changes and trigger compass, jshint, uglify and livereload
        watch: {
            js: {
                files: ['jquery-handlebars.js'],
                tasks: ['uglify','jshint'],
                options: {
                    livereload: true,
                },
            }
        },

        // uglify to concat & minify
        uglify: {
            js: {
                files: {
                    'jquery-handlebars.min.js': 'jquery-handlebars.js',
                },
                options: {
                    compress: {
                        comparisons: true,
                        conditionals: true,
                        dead_code: true,
                        drop_console: true,
                        unsafe: true,
                        unused: true
                    }
                }
            }
        },

        jshint: {
            all: ['jquery-handlebars.js'],
            options: {
                curly: true,
                eqeqeq: true,
                eqnull: true,
                notypeof: true,
                undef: true,
                browser: true,
                globals: {
                  jQuery: true,
                  '$': true
                }
            }
        }

    });

    // register task
    grunt.registerTask('default', ['watch']);
};
<commit_msg>Updated grunt.js<commit_after>
module.exports = function(grunt) {

    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    grunt.initConfig({

        // Watch for changes to the main file to trigger uglification and hinting
        watch: {
            js: {
                files: ['jquery-handlebars.js'],
                tasks: ['uglify','jshint'],
                options: {
                    livereload: true,
                },
            }
        },

        // Check the code meets the following standards
        jshint: {
            all: ['jquery-handlebars.js'],
            options: {
                curly: true,
                eqeqeq: true,
                eqnull: true,
                notypeof: true,
                undef: true,
                browser: true,
                globals: {
                  jQuery: true,
                  '$': true
                }
            }
        },

        // Uglify aka minify the file
        uglify: {
            js: {
                files: {
                    'jquery-handlebars.min.js': 'jquery-handlebars.js',
                },
                options: {
                    // See the uglify documentation for more details
                    compress: {
                        comparisons: true,
                        conditionals: true,
                        dead_code: true,
                        drop_console: true,
                        unsafe: true,
                        unused: true
                    }
                }
            }
        },

    });

    // Register the default task to watch for any changes to jquery-handlebars.js
    grunt.registerTask('default', ['watch']);

    // 'grunt jshint' to check the syntax
    // 'grunt uglify to uglify the jquery-handlebars.js file
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
    // load all grunt tasks matching the `grunt-*` pattern
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({

      autoprefixer: {
        options: {
          browsers: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1']
        },
        build: {
          src: 'public/css/style.css'
        }
      },

      csscomb: {
        options: {
          config: 'public/css/.csscomb.json'
        },
        build: {
          src: 'public/css/style.css',
          dest: 'public/css/style.css'
        }
      },

      shell: {
        jekyll: {
          command: 'jekyll build --drafts'
        }
      },

      watch: {
        options: {
          livereload: true
        },
        jekyllSources: {
          files: [
            '*.html', '*.md', '*.yml', '**/*.html', '**/*.md',
            'public/**', '_posts/**', '_projects/**', '_includes/**',
            '_layouts/**', 'atom.xml',
          ],
          tasks: ['shell:jekyll']
        }
      },

      connect: {
        server: {
          options: {
            base: '_site/',
            port: 9001
          }
        }
      },
      open: {
        server: {
          path: 'http://localhost:<%= connect.server.options.port %>/'
        }
      }

    });

    grunt.registerTask('build', [
      'autoprefixer:build', 'csscomb:build'
    ]);

    grunt.registerTask('server', [
      'connect:server',
      'open:server',
      'watch'
    ]);

    // livereload task
    grunt.registerTask('serve', ['server']);

    // default task
    grunt.registerTask('default', 'build');
}
<commit_msg>Updated captured files for grunt-watch.<commit_after>module.exports = function (grunt) {
    // load all grunt tasks matching the `grunt-*` pattern
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({

      autoprefixer: {
        options: {
          browsers: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1']
        },
        build: {
          src: 'public/css/style.css'
        }
      },

      csscomb: {
        options: {
          config: 'public/css/.csscomb.json'
        },
        build: {
          src: 'public/css/style.css',
          dest: 'public/css/style.css'
        }
      },

      shell: {
        jekyll: {
          command: 'jekyll build --drafts'
        }
      },

      watch: {
        options: {
          livereload: true
        },
        jekyllSources: {
          files: [
            '*.html', '*.md', '*.yml', 'public/**', '_posts/**',
            '_projects/**', '_includes/**', '_layouts/**', '_drafts',
            'atom.xml'
          ],
          tasks: ['shell:jekyll']
        }
      },

      connect: {
        server: {
          options: {
            base: '_site/',
            port: 9001
          }
        }
      },
      open: {
        server: {
          path: 'http://localhost:<%= connect.server.options.port %>/'
        }
      }

    });

    grunt.registerTask('build', [
      'autoprefixer:build', 'csscomb:build'
    ]);

    grunt.registerTask('server', [
      'connect:server',
      'open:server',
      'watch'
    ]);

    // livereload task
    grunt.registerTask('serve', ['server']);

    // default task
    grunt.registerTask('default', 'build');
}
<|endoftext|>


<commit_before>//jshint maxcomplexity: 12, maxstatements: false, camelcase: false
var testConfig = require('./build/test/config');
module.exports = function (grunt) {
	'use strict';

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-mocha');
	grunt.loadTasks('build/tasks');

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		clean: ['dist', 'tmp'],
		'update-help': {
			options: {
				version: '<%=pkg.version%>'
			},
			rules: {
				src: ['lib/rules/**/*.json']
			}
		},
		concat: {
			engine: {
				src: [
					'lib/intro.stub',
					'lib/core/index.js',
					'lib/core/*/index.js',
					'lib/core/**/index.js',
					'lib/core/**/*.js',
					'<%= configure.rules.dest.auto %>',
					'lib/core/export.js',
					'lib/outro.stub'
				],
				dest: 'dist/axe.js',
				options: {
					process: true
				}
			},
			commons: {
				src: [
					'lib/commons/intro.stub',
					'lib/commons/index.js',
					'lib/commons/*/index.js',
					'lib/commons/**/*.js',
					'lib/commons/export.js',
					'lib/commons/outro.stub'
				],
				dest: 'tmp/commons.js'
			}
		},
		configure: {
			rules: {
				src: ['<%= concat.commons.dest %>'],
				options: {
					tags: grunt.option('tags')
				},
				dest: {
					auto: 'tmp/rules.js',
					descriptions: 'doc/rule-descriptions.md'
				}
			}
		},
		langs : {
			generate: {
				check: 'lib/checks/language/valid-lang'
			}
		},
		validate: {
			tools: {
				options: {
					type: 'tool'
				},
				src: 'lib/tools/**/*.json'
			},
			check: {
				options: {
					type: 'check'
				},
				src: 'lib/checks/**/*.json'
			},
			rule: {
				options: {
					type: 'rule'
				},
				src: 'lib/rules/**/*.json'
			}
		},
		uglify: {
			beautify: {
				files: [{
					src: ['<%= concat.engine.dest %>'],
					dest: '<%= concat.engine.dest %>'
				}],
				options: {
					mangle: false,
					compress: false,
					beautify: {
						beautify: true,
						indent_level: 2,
						bracketize: true,
						quote_style: 1
					},
					preserveComments: 'some'
				}
			},
			lib: {
				files: [{
					src: ['<%= concat.engine.dest %>'],
					dest: 'dist/axe.min.js'
				}],
				options: {
					preserveComments: 'some'
				}
			},
			index: {
				files: [{
					src: ['tmp/index.js'],
					dest: 'tmp/index.js'
				}],
				options: {
					preserveComments: 'some'
				}
			}
		},
		nodeify: {
			core: {
				src: ['tmp/index.js'],
				dest: 'dist/index.js'
			}
		},
		copy: {
			index: {
				files: [{
					src: ['<%= concat.engine.dest %>'],
					dest: 'tmp/index.js'
				}]
			},
			manifests: {
				files: [{
					src: ['package.json'],
					dest: 'dist/'
				}, {
					src: ['README.md'],
					dest: 'dist/'
				}, {
					src: ['bower.json'],
					dest: 'dist/'
				}, {
					src: ['LICENSE'],
					dest: 'dist/'
				}]
			}
		},
		watch: {
			files: ['lib/**/*', 'test/**/*.js', 'Gruntfile.js'],
			tasks: ['build', 'testconfig', 'fixture']
		},
		testconfig: {
			test: {
				src: ['test/integration/rules/**/*.json'],
				dest: 'tmp/integration-tests.js'
			}
		},
		fixture: {
			engine: {
				src: '<%= concat.engine.src %>',
				dest: 'test/core/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/core',
					data: {
						title: 'aXe Core Tests'
					}
				}
			},
			checks: {
				src: [
					'<%= concat.engine.dest %>',
					'build/test/engine.js',
					'<%= configure.rules.dest.auto %>'
				],
				dest: 'test/checks/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/checks',
					data: {
						title: 'aXe Check Tests'
					}
				}
			},
			commons: {
				src: [
					'<%= concat.engine.dest %>',
					'build/test/engine.js',
					'<%= configure.rules.dest.auto %>'
				],
				dest: 'test/commons/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/commons',
					data: {
						title: 'aXe Commons Tests'
					}
				}
			},
			integration: {
				src: ['<%= concat.engine.dest %>'],
				dest: 'test/integration/rules/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/integration/rules',
					tests: ['../../../tmp/integration-tests.js', 'runner.js'],
					data: {
						title: 'aXe Integration Tests'
					}
				}
			}
		},
		mocha: testConfig(grunt),
		'test-webdriver': testConfig(grunt, {
			browser: grunt.option('browser') || 'firefox'
		}),
		connect: {
			test: {
				options: {
					hostname: '0.0.0.0',
					port: grunt.option('port') || 9876,
					base: ['.']
				}
			}
		},
		jshint: {
			axe: {
				options: {
					jshintrc: true,
					reporter: grunt.option('report') ? 'checkstyle' : undefined,
					reporterOutput: grunt.option('report') ? 'tmp/lint.xml' : undefined
				},
				src: ['lib/**/*.js', 'test/**/*.js', 'build/tasks/**/*.js', 'doc/**/*.js', 'Gruntfile.js']
			}
		}
	});

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

	grunt.registerTask('build', ['clean', 'validate', 'concat:commons', 'configure',
		'concat:engine', 'copy', 'uglify', 'nodeify']);

	grunt.registerTask('test', ['build',  'testconfig', 'fixture', 'connect',
		'mocha', 'jshint']);

	grunt.registerTask('test-browser', ['build',  'testconfig', 'fixture', 'connect',
		'test-webdriver', 'jshint']);

	grunt.registerTask('dev', ['build', 'testconfig', 'fixture', 'connect', 'watch']);
};
<commit_msg>move to a diff patch<commit_after>//jshint maxcomplexity: 12, maxstatements: false, camelcase: false
var testConfig = require('./build/test/config');
module.exports = function (grunt) {
	'use strict';

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-mocha');
	grunt.loadTasks('build/tasks');

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		clean: ['dist', 'tmp'],
		'update-help': {
			options: {
				version: '<%=pkg.version%>'
			},
			rules: {
				src: ['lib/rules/**/*.json']
			}
		},
		concat: {
			engine: {
				src: [
					'lib/intro.stub',
					'lib/core/index.js',
					'lib/core/*/index.js',
					'lib/core/**/index.js',
					'lib/core/**/*.js',
					'<%= configure.rules.dest.auto %>',
					'lib/core/export.js',
					'lib/outro.stub'
				],
				dest: 'dist/axe.js',
				options: {
					process: true
				}
			},
			commons: {
				src: [
					'lib/commons/intro.stub',
					'lib/commons/index.js',
					'lib/commons/*/index.js',
					'lib/commons/**/*.js',
					'lib/commons/export.js',
					'lib/commons/outro.stub'
				],
				dest: 'tmp/commons.js'
			}
		},
		configure: {
			rules: {
				src: ['<%= concat.commons.dest %>'],
				options: {
					tags: grunt.option('tags')
				},
				dest: {
					auto: 'tmp/rules.js',
					descriptions: 'doc/rule-descriptions.md'
				}
			}
		},
		langs : {
			generate: {
				check: 'lib/checks/language/valid-lang'
			}
		},
		validate: {
			tools: {
				options: {
					type: 'tool'
				},
				src: 'lib/tools/**/*.json'
			},
			check: {
				options: {
					type: 'check'
				},
				src: 'lib/checks/**/*.json'
			},
			rule: {
				options: {
					type: 'rule'
				},
				src: 'lib/rules/**/*.json'
			}
		},
		uglify: {
			beautify: {
				files: [{
					src: ['<%= concat.engine.dest %>'],
					dest: '<%= concat.engine.dest %>'
				}],
				options: {
					mangle: false,
					compress: false,
					beautify: {
						beautify: true,
						indent_level: 2,
						bracketize: true,
						quote_style: 1
					},
					preserveComments: 'some'
				}
			},
			lib: {
				files: [{
					src: ['<%= concat.engine.dest %>'],
					dest: 'dist/axe.min.js'
				}],
				options: {
					preserveComments: 'some'
				}
			},
			index: {
				files: [{
					src: ['tmp/index.js'],
					dest: 'tmp/index.js'
				}],
				options: {
					preserveComments: 'some'
				}
			}
		},
		nodeify: {
			core: {
				src: ['tmp/index.js'],
				dest: 'dist/index.js'
			}
		},
		copy: {
			index: {
				files: [{
					src: ['<%= concat.engine.dest %>'],
					dest: 'tmp/index.js'
				}]
			},
			manifests: {
				files: [{
					src: ['package.json'],
					dest: 'dist/'
				}, {
					src: ['README.md'],
					dest: 'dist/'
				}, {
					src: ['bower.json'],
					dest: 'dist/'
				}, {
					src: ['LICENSE'],
					dest: 'dist/'
				}]
			}
		},
		watch: {
			files: ['lib/**/*', 'test/**/*.js', 'Gruntfile.js'],
			tasks: ['build', 'testconfig', 'fixture']
		},
		testconfig: {
			test: {
				src: ['test/integration/rules/**/*.json'],
				dest: 'tmp/integration-tests.js'
			}
		},
		fixture: {
			engine: {
				src: '<%= concat.engine.src %>',
				dest: 'test/core/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/core',
					data: {
						title: 'aXe Core Tests'
					}
				}
			},
			checks: {
				src: [
					'<%= concat.engine.dest %>',
					'build/test/engine.js',
					'<%= configure.rules.dest.auto %>'
				],
				dest: 'test/checks/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/checks',
					data: {
						title: 'aXe Check Tests'
					}
				}
			},
			commons: {
				src: [
					'<%= concat.engine.dest %>',
					'build/test/engine.js',
					'<%= configure.rules.dest.auto %>'
				],
				dest: 'test/commons/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/commons',
					data: {
						title: 'aXe Commons Tests'
					}
				}
			},
			integration: {
				src: ['<%= concat.engine.dest %>'],
				dest: 'test/integration/rules/index.html',
				options: {
					fixture: 'test/runner.tmpl',
					testCwd: 'test/integration/rules',
					tests: ['../../../tmp/integration-tests.js', 'runner.js'],
					data: {
						title: 'aXe Integration Tests'
					}
				}
			}
		},
		mocha: testConfig(grunt),
		'test-webdriver': testConfig(grunt, {
			browser: grunt.option('browser') || 'firefox'
		}),
		connect: {
			test: {
				options: {
					hostname: '0.0.0.0',
					port: grunt.option('port') || 9876,
					base: ['.']
				}
			}
		},
		jshint: {
			axe: {
				options: {
					jshintrc: true,
					reporter: grunt.option('report') ? 'checkstyle' : undefined,
					reporterOutput: grunt.option('report') ? 'tmp/lint.xml' : undefined
				},
				src: ['lib/**/*.js', 'test/**/*.js', 'build/tasks/**/*.js', 'doc/**/*.js', 'Gruntfile.js']
			}
		}
	});

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

	grunt.registerTask('build', ['clean', 'validate', 'concat:commons', 'configure',
		'concat:engine', 'copy', 'uglify', 'nodeify']);

	grunt.registerTask('test', ['build',  'testconfig', 'fixture', 'connect',
		'mocha', 'jshint']);

	grunt.registerTask('test-browser', ['build',  'testconfig', 'fixture', 'connect',
		'test-webdriver', 'jshint']);
};
<|endoftext|>