<commit_before>/*
 * This gruntfile is based on the project-gruntfile found at:
 *  https://github.com/Breinify/brein-javascript/tree/master/grunt/project-gruntfile.js
 *
 * The following dependencies have to be added:
 *  "grunt": "^0.4.5",
 *  "grunt-bower-install-simple": "^1.2.1",
 *  "grunt-contrib-clean": "^1.0.0",
 *  "grunt-contrib-concat": "^1.0.0",
 *  "grunt-contrib-connect": "^1.0.1",
 *  "grunt-contrib-copy": "^1.0.0",
 *  "grunt-contrib-jasmine": "^1.0.0",
 *  "grunt-contrib-uglify": "^1.0.1",
 *  "grunt-contrib-watch": "^1.0.0",
 *  "grunt-string-replace": "^1.2.1",
 *  "main-bower-files": "^2.11.1"
 *
 * Template Version: 1.0.2
 *
 * Change Log:
 *
 * 1.0.2
 *  - added possibility to define a port for the server
 *  - added replacement of placeholders in JavaScripts ({{PROJECT.VERSION}})
 *  - added a first taste of Jasmine
 *  - added a default-layout
 *
 * 1.0.1
 *  - added a file checking dependency for bower_components
 *  - added this header, i.e. versions without this header are based on 1.0.0
 *
 * 1.0.0
 *  - first release
 */
module.exports = function (grunt) {

    /*
     * Configuration settings
     */
    var defaultPort = 20000;
    var banner = '/*\n' +
        ' * ' + '<%= pkg.name %>\n' +
        ' * ' + 'v<%= pkg.version %>\n' +
        ' **/\n';
    var bowerPaths = {
        bowerDirectory: 'bower_components',
        bowerrc: '.bowerrc',
        bowerJson: 'bower.json'
    };

    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('main-bower-files');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-copy');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-bower-install-simple');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-clean');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-connect');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-watch');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-concat');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-uglify');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-string-replace');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-jasmine');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-sync-json');

    //noinspection JSUnresolvedFunction
    grunt.initConfig({

        /*
         * Store the project settings from the package.json file into the pkg property.
         * This allows us to refer to the values of properties within our package.json
         * file: <%= pkg.name %>.
         */
        pkg: grunt.file.readJSON('package.json'),

        'sync-json': {
            'options': {
                'indent': 2,
                'include': [
                    'name',
                    'description',
                    'version',
                    'author as authors'
                ]
            },
            bower: {
                files: {
                    'bower.json': 'package.json'
                }
            }
        },

        /*
         * For some tasks, we want to clean up a little.
         */
        clean: {

            /*
             * In the case of dependencies, we have to remove all the dependencies.
             * In addition, the important files will be copied to target/dep. Thus,
             * we clean this as well.
             */
            dep: [
                'target/dep',
                'bower_components'
            ],
            combine: [
                'target/replaced',
                'target/combined'
            ],
            /*
             * In the case of distribution, we have to remove the distributed stuff.
             */
            dist: [
                'target/combined',
                'dist'
            ],
            setup: [
                'target/root'
            ]
        },

        /*
         * The watch tasks observes changes on the file-system, which
         * allow us to see changes directly in the browser.
         */
        watch: {
            server: {
                options: {
                    livereload: true,

                    /*
                     * See documentation: Setting this option to false speeds
                     * up the reaction time of the watch (usually 500ms faster
                     * for most)
                     */
                    spawn: false
                },

                // define the task to run when a change happens
                tasks: ['setup'],

                // files to observe, can be an array
                files: ['src/**/*', 'sample/**/*']
            }
        },

        /*
         * The connect task starts a web server for us to see our results and
         * do some testing.
         */
        connect: {
            server: {
                options: {
                    port: '<%= server.port %>',
                    base: 'target/root'
                    // we don't need any livereload because we have watch
                    // livereload: true
                }
            }
        },

        /*
         * Task used to install bower dependencies.
         */
        'bower-install-simple': {
            dep: {
                options: {
                    production: false
                }
            }
        },

        /*
         * Modify the bower dependencies and move the needed files to the
         * target location.
         */
        bower: {
            dep: {
                options: {
                    includeDev: true,
                    checkExistence: true,
                    paths: bowerPaths,
                    overrides: {
                        'brein-util': {'main': 'common/dist/brein-util-common.js'},
                        'cryptojslib': {
                            'main': [
                                'components/core.js',

                                // base64 encoding
                                'components/enc-base64.js',<commit_msg>removed common from gruntfile<commit_after>/*
 * This gruntfile is based on the project-gruntfile found at:
 *  https://github.com/Breinify/brein-javascript/tree/master/grunt/project-gruntfile.js
 *
 * The following dependencies have to be added:
 *  "grunt": "^0.4.5",
 *  "grunt-bower-install-simple": "^1.2.1",
 *  "grunt-contrib-clean": "^1.0.0",
 *  "grunt-contrib-concat": "^1.0.0",
 *  "grunt-contrib-connect": "^1.0.1",
 *  "grunt-contrib-copy": "^1.0.0",
 *  "grunt-contrib-jasmine": "^1.0.0",
 *  "grunt-contrib-uglify": "^1.0.1",
 *  "grunt-contrib-watch": "^1.0.0",
 *  "grunt-string-replace": "^1.2.1",
 *  "main-bower-files": "^2.11.1"
 *
 * Template Version: 1.0.2
 *
 * Change Log:
 *
 * 1.0.2
 *  - added possibility to define a port for the server
 *  - added replacement of placeholders in JavaScripts ({{PROJECT.VERSION}})
 *  - added a first taste of Jasmine
 *  - added a default-layout
 *
 * 1.0.1
 *  - added a file checking dependency for bower_components
 *  - added this header, i.e. versions without this header are based on 1.0.0
 *
 * 1.0.0
 *  - first release
 */
module.exports = function (grunt) {

    /*
     * Configuration settings
     */
    var defaultPort = 20000;
    var banner = '/*\n' +
        ' * ' + '<%= pkg.name %>\n' +
        ' * ' + 'v<%= pkg.version %>\n' +
        ' **/\n';
    var bowerPaths = {
        bowerDirectory: 'bower_components',
        bowerrc: '.bowerrc',
        bowerJson: 'bower.json'
    };

    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('main-bower-files');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-copy');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-bower-install-simple');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-clean');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-connect');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-watch');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-concat');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-uglify');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-string-replace');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-contrib-jasmine');
    //noinspection JSUnresolvedFunction
    grunt.loadNpmTasks('grunt-sync-json');

    //noinspection JSUnresolvedFunction
    grunt.initConfig({

        /*
         * Store the project settings from the package.json file into the pkg property.
         * This allows us to refer to the values of properties within our package.json
         * file: <%= pkg.name %>.
         */
        pkg: grunt.file.readJSON('package.json'),

        'sync-json': {
            'options': {
                'indent': 2,
                'include': [
                    'name',
                    'description',
                    'version',
                    'author as authors'
                ]
            },
            bower: {
                files: {
                    'bower.json': 'package.json'
                }
            }
        },

        /*
         * For some tasks, we want to clean up a little.
         */
        clean: {

            /*
             * In the case of dependencies, we have to remove all the dependencies.
             * In addition, the important files will be copied to target/dep. Thus,
             * we clean this as well.
             */
            dep: [
                'target/dep',
                'bower_components'
            ],
            combine: [
                'target/replaced',
                'target/combined'
            ],
            /*
             * In the case of distribution, we have to remove the distributed stuff.
             */
            dist: [
                'target/combined',
                'dist'
            ],
            setup: [
                'target/root'
            ]
        },

        /*
         * The watch tasks observes changes on the file-system, which
         * allow us to see changes directly in the browser.
         */
        watch: {
            server: {
                options: {
                    livereload: true,

                    /*
                     * See documentation: Setting this option to false speeds
                     * up the reaction time of the watch (usually 500ms faster
                     * for most)
                     */
                    spawn: false
                },

                // define the task to run when a change happens
                tasks: ['setup'],

                // files to observe, can be an array
                files: ['src/**/*', 'sample/**/*']
            }
        },

        /*
         * The connect task starts a web server for us to see our results and
         * do some testing.
         */
        connect: {
            server: {
                options: {
                    port: '<%= server.port %>',
                    base: 'target/root'
                    // we don't need any livereload because we have watch
                    // livereload: true
                }
            }
        },

        /*
         * Task used to install bower dependencies.
         */
        'bower-install-simple': {
            dep: {
                options: {
                    production: false
                }
            }
        },

        /*
         * Modify the bower dependencies and move the needed files to the
         * target location.
         */
        bower: {
            dep: {
                options: {
                    includeDev: true,
                    checkExistence: true,
                    paths: bowerPaths,
                    overrides: {
                        'cryptojslib': {
                            'main': [
                                'components/core.js',

                                // base64 encoding
                                'components/enc-base64.js',
{'fraction_non_alphanumeric': 0.11549827614513217, 'fraction_numerical': 0.010178952552946971, 'mean_word_length': 1.3442370598422166, 'pattern_counts': {'":': 22, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2519113', 'n_tokens_mistral': 3512, 'n_tokens_neox': 3295, 'n_words': 809}