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

    var shell = require('shelljs');

    // Project configuration.
    grunt.initConfig({
        pkg: '<json:package.json>',
        meta: {
            banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
            '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
            '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
            '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
            ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
        },
        qunit: {
            index: ['tests/qunit/tests/unit/*.html']
        },
        lint: {
            files: [
                'grunt.js',
                'admin/**/*.js',
                'shared/**/*.js',
                'ui/**/*.js',
                'widgets/**/*.js'
            ]
        },
        watch: {
            files: '<config:lint.files>',
            tasks: 'lint test'
        },
        jshint: {
            options: {
                sub: true
            },
            globals: {
                exports: true,
                module: false
            }
        },
        clean: {
            folder: 'target/'
        },
        requirejs: {
            appDir: './',
            baseUrl: './shared',
            paths: {
                'jquery-plugins': 'js/jquery-plugins',
                'jquery': 'js/jquery',
                'jquery-ui': 'js/jquery-ui.custom',
                'jquery-cookie': 'js/jquery-plugins/jquery.cookie',
                'jquery-jstree': 'js/jquery-plugins/jsTree/jquery.jstree.sakai-edit',
                'jquery-fileupload': 'js/jquery-plugins/jquery.fileupload',
                'jquery-iframe-transport': 'js/jquery-plugins/jquery.iframe-transport',
                'jquery-pager': 'js/jquery-plugins/jquery.pager.sakai-edited',
                'jquery-tagcloud': 'js/jquery-plugins/jquery.tagcloud',
                'underscore': 'js/underscore',
                'config': '../ui/configuration'
            },
            dir: 'target/optimized',
            optimize: 'uglify',
            optimizeCss: 'standard',
            cssImportIgnore: null,
            inlineText: true,
            useStrict: false,
            pragmas: {},
            skipPragmas: false,
            skipModuleInsertion: false,
            modules: [{
                name: 'sakai/sakai.dependencies'
            }],
            dirExclusionRegExp: /^(\.|tools|target|tests|node_modules)/
        },
        hashres: {
            oae: {
                // Hash these files
                files: [
                    // Warning these files will be renamed
                    'target/optimized/shared/**/*.js',
                    'target/optimized/shared/**/*.css',
                    'target/optimized/ui/**/*.js',
                    'target/optimized/ui/**/*.css',
                    'target/optimized/ui/**/*.properties',
                    'target/optimized/widgets/**/*.js',
                    'target/optimized/widgets/**/*.html',
                    'target/optimized/widgets/**/*.css',
                    'target/optimized/widgets/**/*.properties'
                ],
                // Update the paths to hashed files
                out: shell.find('target/optimized/').filter(function(file) {
                    return file.match(/^\(shared\/sakai|ui|widgets\)\/.*\.\(html|js|css|json\)$/) && shell.test('-f', file);
                })
            }
        },
        inlineImg: {
            src: [
                'target/optimized/admin/**/*.css',
                'target/optimized/api/**/*.css',
                'target/optimized/shared/**/*.css',
                'target/optimized/widgets/**/*.css'
                 ],
            ie8: true,
            base: __dirname
        }
    });

    // Load tasks from npm modules
    grunt.loadNpmTasks('grunt-clean');
    grunt.loadNpmTasks('grunt-git-describe');
    grunt.loadNpmTasks('grunt-hashres');
    grunt.loadNpmTasks('grunt-imagine');
    grunt.loadNpmTasks('grunt-requirejs');

    // Task to write the version to a file
    grunt.registerTask('writeVersion', function() {
        this.requires('describe');
        var json = grunt.template.process('{"sakai:ux-version":"<%= meta.version %>"}');
        grunt.file.write('target/optimized/ui/version.json', json);
    });

    // Override the test task with the qunit task
    grunt.registerTask('test', 'qunit');
    // Default task.
    grunt.registerTask('default', 'clean describe requirejs inlineImg hashres writeVersion');
};<commit_msg>fix paths<commit_after>module.exports = function(grunt) {

    var shell = require('shelljs');

    // Project configuration.
    grunt.initConfig({
        pkg: '<json:package.json>',
        meta: {
            banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
            '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
            '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
            '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
            ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
        },
        qunit: {
            index: ['tests/qunit/tests/unit/*.html']
        },
        lint: {
            files: [
                'grunt.js',
                'admin/**/*.js',
                'shared/**/*.js',
                'ui/**/*.js',
                'node_modules/oae-core/**/*.js'
            ]
        },
        watch: {
            files: '<config:lint.files>',
            tasks: 'lint test'
        },
        jshint: {
            options: {
                sub: true
            },
            globals: {
                exports: true,
                module: false
            }
        },
        clean: {
            folder: 'target/'
        },
        requirejs: {
            optimize: {
                options: {
                    appDir: './',
                    baseUrl: './shared',
                    paths: {
                        'jquery': 'vendor/js/jquery',
                        'jquery-plugins': 'vendor/js/jquery-plugins',
                        'jquery-ui': 'vendor/js/jquery-ui.custom',
                        'underscore': 'vendor/js/underscore'
                    },
                    dir: 'target/optimized',
                    optimize: 'uglify',
                    optimizeCss: 'standard',
                    cssImportIgnore: null,
                    inlineText: true,
                    useStrict: false,
                    pragmas: {},
                    skipPragmas: false,
                    skipModuleInsertion: false,
                    modules: [{
                        name: 'oae/api/oae.api'
                    }],
                    fileExclusionRegExp: /^(\.|tools|target|tests|node_modules(?!\/oae-core))/,
                    logLevel: 2
                }
            }
        },
        hashres: {
            oae: {
                // Hash these files
                files: [
                    // Warning these files will be renamed
                    'target/optimized/shared/**/*.js',
                    'target/optimized/shared/**/*.css',
                    'target/optimized/ui/**/*.js',
                    'target/optimized/ui/**/*.css',
                    'target/optimized/ui/**/*.properties',
                    'target/optimized/node_modules/oae-core/**/*.js',
                    'target/optimized/node_modules/oae-core/**/*.html',
                    'target/optimized/node_modules/oae-core/**/*.css',
                    'target/optimized/node_modules/oae-core/**/*.properties'
                ]
            }
        },
        inlineImg: {
            src: [
                'target/optimized/admin/**/*.css',
                'target/optimized/ui/**/*.css',
                'target/optimized/shared/**/*.css',
                'target/optimized/node_modules/oae-core/**/*.css'
                 ],
            ie8: true,
            base: __dirname
        }
    });

    // Load tasks from npm modules
    grunt.loadNpmTasks('grunt-clean');
    grunt.loadNpmTasks('grunt-git-describe');
    grunt.loadNpmTasks('grunt-hashres');
    grunt.loadNpmTasks('grunt-imagine');
    grunt.loadNpmTasks('grunt-requirejs');

    // Task to write the version to a file
    grunt.registerTask('writeVersion', function() {
        this.requires('describe');
        var json = grunt.template.process('{"sakai:ux-version":"<%= meta.version %>"}');
        grunt.file.write('target/optimized/ui/version.json', json);
    });

    // Task to hash files
    grunt.registerTask('hashFiles', function() {
        this.requires('requirejs');
        this.requires('inlineImg');
        var outFiles = shell.find('target/optimized/').filter(function(file) {
            return file.match(/^\(shared\/oae|ui|node_modules\/oae-core\)\/.*\.\(html|js|css|json\)$/) && shell.test('-f', file);
        });
        grunt.config.set('hashres.oae.out', outFiles);
        grunt.task.run('hashres');
    });

    // Override the test task with the qunit task
    grunt.registerTask('test', 'qunit');
    // Default task.
    grunt.registerTask('default', 'clean describe requirejs inlineImg hashFiles writeVersion');
};
{'fraction_non_alphanumeric': 0.16404057845888192, 'fraction_numerical': 0.00032376429958989856, 'mean_word_length': 1.3442954717935744, 'pattern_counts': {'":': 2, '<': 23, '<?xml version=': 0, '>': 23, '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': '3411648', 'n_tokens_mistral': 2746, 'n_tokens_neox': 2569, 'n_words': 383}