<commit_before>var gulp = require('gulp');
var usemin = require('gulp-usemin');
var uglify = require('gulp-uglify');
var minifyHtml = require('gulp-minify-html');
var minifyCss = require('gulp-minify-css');
var rev = require('gulp-rev');
var replace = require('gulp-replace');

gulp.task('min', function() {
    return gulp.src([
        'src/main/webapp/WEB-INF/views/**/*.jsp'
    ])
    .pipe(usemin({
        css: [rev],
        htmlmin: [ function () {return minifyHtml({ empty: true });} ],
        js: [uglify, rev],
        inlinejs: [ uglify ],
        inlinecss: [ minifyCss, 'concat' ],
        outputRelativePath: '../../'
    }))
    .pipe(replace('var _LOGGING_NOTIFY_DESKTOP = true;', 'var _LOGGING_NOTIFY_DESKTOP = false;'))
    .pipe(gulp.dest('target/knowledge/WEB-INF/views/'));
});

gulp.task('copy', ['copy:bootswatch', 'copy:bootswatch2', 'copy:highlightjs', 'copy:font-awesome', 'copy:flag-icon-css', 
    'copy:html5shiv', 'copy:respond', 'copy:MathJax', 'copy:emoji-parser', 'copy:free-file-icons',
    'copy:diff2html', 'copy:jsdiff']);

gulp.task('copy:bootswatch', function() {
    return gulp.src([
        'src/main/webapp/bower/bootswatch/**/*'
    ])
    .pipe(gulp.dest('target/knowledge/bower/bootswatch'));
});<commit_msg>#732 Add replace path process to minify jsp on gulp<commit_after>var gulp = require('gulp');
var usemin = require('gulp-usemin');
var uglify = require('gulp-uglify');
var minifyHtml = require('gulp-minify-html');
var minifyCss = require('gulp-minify-css');
var rev = require('gulp-rev');
var replace = require('gulp-replace');

gulp.task('min', function() {
    return gulp.src([
        'src/main/webapp/WEB-INF/views/**/*.jsp'
    ])
    .pipe(replace('href="<%= request.getContextPath() %>/bower', 'href="/bower'))
    .pipe(replace('href="<%= request.getContextPath() %>/css', 'href="/css'))
    .pipe(replace('src="<%= request.getContextPath() %>/bower', 'src="/bower'))
    .pipe(replace('src="<%= request.getContextPath() %>/js', 'src="/js'))
    .pipe(usemin({
        css: [rev],
        htmlmin: [ function () {return minifyHtml({ empty: true });} ],
        js: [uglify, rev],
        inlinejs: [ uglify ],
        inlinecss: [ minifyCss, 'concat' ],
        outputRelativePath: '../../'
    }))
    .pipe(replace('var _LOGGING_NOTIFY_DESKTOP = true;', 'var _LOGGING_NOTIFY_DESKTOP = false;'))
    .pipe(replace('href="/bower', 'href="<%= request.getContextPath() %>/bower'))
    .pipe(replace('href="/css', 'href="<%= request.getContextPath() %>/css'))
    .pipe(replace('src="/bower', 'src="<%= request.getContextPath() %>/bower'))
    .pipe(replace('src="/js', 'src="<%= request.getContextPath() %>/js'))
    .pipe(replace('href="bower', 'href="<%= request.getContextPath() %>/bower'))
    .pipe(replace('href="css', 'href="<%= request.getContextPath() %>/css'))
    .pipe(replace('src="bower', 'src="<%= request.getContextPath() %>/bower'))
    .pipe(replace('src="js', 'src="<%= request.getContextPath() %>/js'))
    .pipe(gulp.dest('target/knowledge/WEB-INF/views/'));
});

gulp.task('copy', ['copy:bootswatch', 'copy:bootswatch2', 'copy:highlightjs', 'copy:font-awesome', 'copy:flag-icon-css', 
    'copy:html5shiv', 'copy:respond', 'copy:MathJax', 'copy:emoji-parser', 'copy:free-file-icons',
    'copy:diff2html', 'copy:jsdiff']);

gulp.task('copy:bootswatch', function() {
    return gulp.src([
        'src/main/webapp/bower/bootswatch/**/*'
    ])
    .pipe(gulp.dest('target/knowledge/bower/bootswatch'));
});
{'fraction_non_alphanumeric': 0.2318051575931232, 'fraction_numerical': 0.0025787965616045844, 'mean_word_length': 4.226047904191617, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '5845965', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1259, 'n_words': 197}