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

    var environment = grunt.option('environment') || 'development';

    switch (environment) {
        case 'production':
            break;
        case 'development':
            break;
        default:
            console.log('Could not map environment `' + environment + '`');
            console.log('Defaulting to `development`');
            environment = 'development';
            break;
    }
    process.env.ANGULAR_ENV = environment;

    grunt.task.loadNpmTasks('grunt-contrib-clean');
    grunt.task.loadNpmTasks('grunt-broccoli');
    grunt.task.loadNpmTasks('grunt-bump');
    grunt.task.loadNpmTasks('grunt-exec');
    grunt.task.loadNpmTasks('grunt-express-server');

    grunt.initConfig({
        config: {
            destDir: 'dist/'
        },
        clean: {
            options : { force: true },
            dist    : [ '<%= config.destDir %>' ],
            tmp     : [ 'tmp' ]
        },
        broccoli: {
            dist: {
                dest: '<%= config.destDir %>',
            }
        },
        bump: {
            options: {
                files         : [ 'bower.json', 'package.json' ],
                commitFiles   : [ 'bower.json', 'package.json' ],
                commitMessage : 'Bumped version to: %VERSION%',
                createTag     : false,
                push          : false,

            }
        },
        exec: {
            updateWebdriver: {
                cmd: 'npm run update-webdriver'
            },
            broccoliTest: {
                cmd: 'npm test'
            }
        },
        express: {
            options: {
                port   : 4200,
                script : 'node_modules/angular-bro-app/lib/server.js'
            },
            e2e: {
                options: {
                    background: true
                }
            },
            server: {
                options: {
                    background: false,
                }
            }
        }
    });

    grunt.registerTask('default', 'Builds the angular app.', 'build');

    grunt.registerTask('build', 'Builds the angular app', 'broccoli:dist:build');

    grunt.registerTask('serve', 'Builds and launches a server for the app.', 'server');
    grunt.registerTask('server', 'Builds and launches a server for the app.', function () {
        process.env.ANGULAR_SERVER   = true;
        process.env.ANGULAR_DEST_DIR = grunt.config('config').destDir;

        grunt.task.run([
            'clean',
            'express:server'
        ]);
    });

    grunt.registerTask('test', 'Builds and runs unit tests.', function () {
        var broccoliType = 'build';

        process.env.ANGULAR_TEST = true;

        if (!!grunt.option('server')) {
            broccoliType = 'server';
            process.env.ANGULAR_SERVER = true;
        }

        grunt.task.run(broccoliType);
    });
};<commit_msg>Updated Scaffolded Gruntfile. - Added pre/post hooks to build and server tasks - Added documentation for each grun task<commit_after>module.exports = function (grunt) {
    "use strict";

    var environment = grunt.option('environment') || 'development';

    switch (environment) {
        case 'production':
            break;
        case 'development':
            break;
        case 'test':
            break;
        default:
            console.log('Could not map environment `' + environment + '`');
            console.log('Defaulting to `development`');
            environment = 'development';
            break;
    }
    process.env.ANGULAR_ENV = environment;

    grunt.task.loadNpmTasks('grunt-contrib-clean');
    grunt.task.loadNpmTasks('grunt-broccoli');
    grunt.task.loadNpmTasks('grunt-bump');
    grunt.task.loadNpmTasks('grunt-exec');
    grunt.task.loadNpmTasks('grunt-express-server');

    grunt.initConfig({
        config: {
            destDir: 'dist/'
        },
        clean: {
            options : { force: true },
            dist    : [ '<%= config.destDir %>' ],
            tmp     : [ 'tmp' ]
        },
        broccoli: {
            dist: {
                dest: '<%= config.destDir %>',
            }
        },
        bump: {
            options: {
                files         : [ 'bower.json', 'package.json' ],
                commitFiles   : [ 'bower.json', 'package.json' ],
                commitMessage : 'Bumped version to: %VERSION%',
                createTag     : false,
                push          : false,

            }
        },
        exec: {
            updateWebdriver: {
                cmd: 'npm run update-webdriver'
            },
            broccoliTest: {
                cmd: 'npm test'
            }
        },
        express: {
            options: {
                port   : 4200,
                script : 'node_modules/angular-bro-app/lib/server.js'
            },
            e2e: {
                options: {
                    background: true
                }
            },
            server: {
                options: {
                    background: false,
                }
            }
        }
    });

    grunt.registerTask('default', 'Builds the angular app.', 'build');

    /**
     * Anything that is required for the app to be built should happen here.
     */
    grunt.registerTask('prebuild', 'Preps the environment for the build.', [
        'clean'
    ]);

    /**
     * Build routine with pre and post hooks. Any modifications should happen in either the
     * `prebuild` or `postbuild` tasks.
     */
    grunt.registerTask('build', 'Builds the angular app.', [
        'prebuild',
        'broccoli:dist:build',
        'postbuild'
    ]);

    /**
     * Anything that is required for the app to be served / deployed should happen here.
     */
    grunt.registerTask('postbuild', 'Post processing of the built angular app.', [
    ]);


    /**
     * Anything that is required for the app to be built and served should happen here.
     */
    grunt.registerTask('preserver', 'Prepwork for the server.', [
        'prebuild'
    ]);

    /**
     * Server routine with pre hooks. Any modifications should happen in the `preserver` task.
     * NOTE: There is not post hook as the last task is a forever running task, and any future
     * task wouldn't ever be run.
     */
    grunt.registerTask('serve',  'Builds and launches a server for the app.', 'server');
    grunt.registerTask('server', 'Builds and launches a server for the app.', function () {
        process.env.ANGULAR_SERVER   = true;
        process.env.ANGULAR_DEST_DIR = grunt.config('config').destDir;

        grunt.task.run([
            'preserver',
            'express:server'
        ]);
    });

    /**
     * Test prepwork goes here. In general you shouldn't need to modify this task, but rather update
     * the `prebuild` step.
     */
    grunt.registerTask('test', 'Builds and runs unit tests.', function () {
        var broccoliType = 'build';

        process.env.ANGULAR_TEST = true;
        process.env.ANGULAR_ENV  = 'test';

        if (!!grunt.option('server')) {
            broccoliType = 'server';
            process.env.ANGULAR_SERVER = true;
        }

        grunt.task.run(broccoliType);
    });
};
{'fraction_non_alphanumeric': 0.12413982934214148, 'fraction_numerical': 0.0013762730525736307, 'mean_word_length': 1.543577178858943, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2748650', 'n_tokens_mistral': 2068, 'n_tokens_neox': 1958, 'n_words': 462}