<commit_before>'use strict';
const gulp = require('gulp');
const gulp_tslint = require('gulp-tslint');
const cp = require('child_process');
const decompress = require('gulp-decompress');
const download = require('gulp-download');

//...
gulp.task('tslint', () => {
    return gulp.src(['**/*.ts', '!**/*.d.ts', '!node_modules/**'])
      .pipe(gulp_tslint())
      .pipe(gulp_tslint.report());
});

gulp.task('download_server', ()=>
{
	download("http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz")
		.pipe(decompress())
		.pipe(gulp.dest('./server'))
});

gulp.task('build_server', ()=>
{
	cp.execSync('mvn -f ../eclipse.jdt.ls/pom.xml -Pserver-distro clean package', {stdio:[0,1,2]} );
	gulp.src('../eclipse.jdt.ls/org.eclipse.jdt.ls.product/distro/*.tar.gz')
		.pipe(decompress())
		.pipe(gulp.dest('./server'))
});

gulp.task('dev_server', ()=>
{
	let isWin = /^win/.test(process.platform);
	let isMac = /^darwin/.test(process.platform);
	let isLinux = /^linux/.test(process.platform);
	let command = 'mvn -f ../eclipse.jdt.ls/pom.xml -Pserver-distro,fast -o clean package ';
	if(isLinux){
		command +='-Denvironment.os=linux -Denvironment.ws=gtk -Denvironment.arch=x86_64';
	}
	if(isMac){
		command += '-Denvironment.os=macosx -Denvironment.ws=cocoa -Denvironment.arch=x86_64';
	}else
	if(isWin){
		command += '-Denvironment.os=win32 -Denvironment.ws=win32 -Denvironment.arch=x86_64';
	}
	console.log('executing '+command);
	cp.execSync(command, {stdio:[0,1,2]} );
	gulp.src('../eclipse.jdt.ls/org.eclipse.jdt.ls.product/distro/*.tar.gz')
		.pipe(decompress())
		.pipe(gulp.dest('./server'))
});

gulp.task('watch_server',()=>{
	gulp.watch('../eclipse.jdt.ls/org.eclipse.jdt.ls.core/**/*.java',['dev_server']);
})<commit_msg>Use Maven wrapper to build server<commit_after>'use strict';
const gulp = require('gulp');
const gulp_tslint = require('gulp-tslint');
const cp = require('child_process');
const decompress = require('gulp-decompress');
const download = require('gulp-download');
const server_dir = '../eclipse.jdt.ls';
//...
gulp.task('tslint', () => {
    return gulp.src(['**/*.ts', '!**/*.d.ts', '!node_modules/**'])
      .pipe(gulp_tslint())
      .pipe(gulp_tslint.report());
});

gulp.task('download_server', ()=>
{
	download("http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz")
		.pipe(decompress())
		.pipe(gulp.dest('./server'))
});

gulp.task('build_server', ()=>
{
	cp.execSync(mvnw()+ ' -Pserver-distro clean package', {cwd:server_dir, stdio:[0,1,2]} );
	gulp.src(server_dir + '/org.eclipse.jdt.ls.product/distro/*.tar.gz')
		.pipe(decompress())
		.pipe(gulp.dest('./server'))
});

gulp.task('dev_server', ()=>
{
	let command = mvnw() +' -Pserver-distro,fast -o clean package ';
	if(isLinux()){
		command +='-Denvironment.os=linux -Denvironment.ws=gtk -Denvironment.arch=x86_64';
	}
	else if(isMac()){
		command += '-Denvironment.os=macosx -Denvironment.ws=cocoa -Denvironment.arch=x86_64';
	} 
	else if(isWin()){
		command += '-Denvironment.os=win32 -Denvironment.ws=win32 -Denvironment.arch=x86_64';
	}
	console.log('executing '+command);
	cp.execSync(command, {cwd:server_dir, stdio:[0,1,2]} );
	gulp.src(server_dir +'/org.eclipse.jdt.ls.product/distro/*.tar.gz')
		.pipe(decompress())
		.pipe(gulp.dest('./server'))
});

gulp.task('watch_server',()=>{
	gulp.watch(server_dir+'/org.eclipse.jdt.ls.core/**/*.java',['dev_server']);
});

function isWin() {
	return /^win/.test(process.platform);
}

function isMac() {
	return /^darwin/.test(process.platform);
}

function isLinux() {
	return /^linux/.test(process.platform);
}

function mvnw() {
	return "./mvnw"+(isWin()?".cmd":"");
}
{'fraction_non_alphanumeric': 0.23567921440261866, 'fraction_numerical': 0.012002182214948172, 'mean_word_length': 4.702954898911353, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4761731', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1430, 'n_words': 182}