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

    var sourceFiles = grunt.file.readJSON("sourceFiles.json");
    var testSpecs = grunt.file.readJSON("testSpecs.json");

    // Project configuration.
    grunt.initConfig({
        pkg : grunt.file.readJSON("package.json"),
        path : {
            main : "build/<%= pkg.name %>-<%= pkg.version %>.js",
            min : "build/<%= pkg.name %>-<%= pkg.version %>-min.js"
        },

        concat : {
            dist : {
                src : sourceFiles,
                dest : "<%= path.main %>"
            }
        },

        replace : {
            dist : {
                options : {
                    variables : {
                        "__FRAGMENT__" : "<%= grunt.file.read('build/quad-fragment.glsl') %>",
                        "__VERTEX__" : "<%= grunt.file.read('build/quad-vertex.glsl') %>",
                        "__VERSION__" : "<%= pkg.version %>"
                    },
                    usePrefix : false,
                    force : true,
                    patterns : [
                        {
                            match : /this\._super\(\s*([\w\.]+)\s*,\s*"(\w+)"\s*(,\s*)?/g,
                            replacement : "$1.prototype.$2.apply(this$3"
                        },
                    ],
                },
                files : [
                    {
                        expand : true,
                        flatten : true,
                        src : [ "<%= path.main %>" ],
                        dest : "build/"
                    }
                ]
            },

            docs : {
                options : {
                    variables : {
                        "VERSION" : "<%= pkg.version %>"
                    },
                    prefix : "@",
                    force : true
                },
                files : [
                    {
                        expand : true,
                        src : sourceFiles.concat([ "README.md" ]),
                        dest : "build/docs/"
                    }
                ]
            },

            glsl : {
                options : {
                    preserveOrder : true,
                    patterns : [
                        {
                            // Remove comments
                            match : /(\/\/.*?\\n)|(\/\*(.|\\n)*?\*\/)/g,
                            replacement : ""
                        },
                        {
                            // Remove leading and trailing whitespace from lines
                            match : /(\\n\s+)|(\s+\\n)/g,
                            replacement : ""
                        },
                        {
                            // Remove line breaks
                            match : /(\\r|\\n)+/g,
                            replacement : ""
                        },
                        {
                            // Remove unnecessary whitespace
                            match : /\s*([;,[\](){}\\\/\-+*|^&!=<>?~%])\s*/g,
                            replacement : "$1"
                        },
                    ],
                },
                files : [
                    {
                        expand : true,
                        flatten : true,
                        src : [ "build/*.glsl" ],
                        dest : "build/"
                    }
                ]
            }
        },

        dot : {
            glsl : {
                options : {
                    strip : false,
                },
                files : [
                    {
                        src : "src/video/webgl/glsl/",
                        dest : "build/"
                    }
                ]
            }
        },

        uglify : {
            options : {
                report : "min",
                preserveComments : "some"
            },
            dist : {
                files : {<commit_msg>[#591] Move GLSL build directory to build/glsl/<commit_after>module.exports = function (grunt) {
    "use strict";

    var sourceFiles = grunt.file.readJSON("sourceFiles.json");
    var testSpecs = grunt.file.readJSON("testSpecs.json");

    var fragmentBuild = "<%= grunt.file.read('build/glsl/quad-fragment.glsl') %>";
    var vertexBuild = "<%= grunt.file.read('build/glsl/quad-vertex.glsl') %>";

    // Project configuration.
    grunt.initConfig({
        pkg : grunt.file.readJSON("package.json"),
        path : {
            main : "build/<%= pkg.name %>-<%= pkg.version %>.js",
            min : "build/<%= pkg.name %>-<%= pkg.version %>-min.js"
        },

        concat : {
            dist : {
                src : sourceFiles,
                dest : "<%= path.main %>"
            }
        },

        replace : {
            dist : {
                options : {
                    variables : {
                        "__FRAGMENT__" : fragmentBuild,
                        "__VERTEX__" : vertexBuild,
                        "__VERSION__" : "<%= pkg.version %>"
                    },
                    usePrefix : false,
                    force : true,
                    patterns : [
                        {
                            match : /this\._super\(\s*([\w\.]+)\s*,\s*"(\w+)"\s*(,\s*)?/g,
                            replacement : "$1.prototype.$2.apply(this$3"
                        },
                    ],
                },
                files : [
                    {
                        expand : true,
                        flatten : true,
                        src : [ "<%= path.main %>" ],
                        dest : "build/"
                    }
                ]
            },

            docs : {
                options : {
                    variables : {
                        "VERSION" : "<%= pkg.version %>"
                    },
                    prefix : "@",
                    force : true
                },
                files : [
                    {
                        expand : true,
                        src : sourceFiles.concat([ "README.md" ]),
                        dest : "build/docs/"
                    }
                ]
            },

            glsl : {
                options : {
                    preserveOrder : true,
                    patterns : [
                        {
                            // Remove comments
                            match : /(\/\/.*?\\n)|(\/\*(.|\\n)*?\*\/)/g,
                            replacement : ""
                        },
                        {
                            // Remove leading and trailing whitespace from lines
                            match : /(\\n\s+)|(\s+\\n)/g,
                            replacement : ""
                        },
                        {
                            // Remove line breaks
                            match : /(\\r|\\n)+/g,
                            replacement : ""
                        },
                        {
                            // Remove unnecessary whitespace
                            match : /\s*([;,[\](){}\\\/\-+*|^&!=<>?~%])\s*/g,
                            replacement : "$1"
                        },
                    ],
                },
                files : [
                    {
                        expand : true,
                        flatten : true,
                        src : [ "build/glsl/*.glsl" ],
                        dest : "build/glsl/"
                    }
                ]
            }
        },

        dot : {
            glsl : {
                options : {
                    strip : false,
                },
                files : [
                    {
                        src : "src/video/webgl/glsl/",
                        dest : "build/glsl/"
                    }
                ]
            }
        },

        uglify : {
            options : {
                report : "min",
                preserveComments : "some"
            },
            dist : {
                files : {
{'fraction_non_alphanumeric': 0.130649543097061, 'fraction_numerical': 0.001358360088910842, 'mean_word_length': 0.5958620689655172, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '5468845', 'n_tokens_mistral': 2019, 'n_tokens_neox': 1824, 'n_words': 286}