Skip to content

Commit 53664df

Browse files
committed
Fix watch_server & dev_server tasks
- Fixes #230 - Update watch_server task to comply with Gulp v4 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
1 parent 0c0272c commit 53664df

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

gulpfile.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const gulp = require('gulp');
33
const cp = require('child_process');
44
const decompress = require('gulp-decompress');
55
const download = require('gulp-download');
6+
const glob = require('glob');
67
const fse = require('fs-extra');
78
const path = require('path');
89
const server_dir = '../eclipse.jdt.ls';
@@ -27,26 +28,22 @@ gulp.task('build_server', function(done) {
2728
});
2829

2930
gulp.task('dev_server', function(done) {
30-
let command = mvnw() +' -Pserver-distro,fast -o clean package ';
31-
if(isLinux()){
32-
command +='-Denvironment.os=linux -Denvironment.ws=gtk -Denvironment.arch=x86_64';
33-
}
34-
else if(isMac()){
35-
command += '-Denvironment.os=macosx -Denvironment.ws=cocoa -Denvironment.arch=x86_64';
36-
}
37-
else if(isWin()){
38-
command += '-Denvironment.os=win32 -Denvironment.ws=win32 -Denvironment.arch=x86_64';
39-
}
31+
let command = mvnw() +' -o -pl org.eclipse.jdt.ls.core,org.eclipse.jdt.ls.target clean package';
4032
console.log('executing '+command);
4133
cp.execSync(command, {cwd:server_dir, stdio:[0,1,2]} );
42-
gulp.src(server_dir +'/org.eclipse.jdt.ls.product/distro/*.tar.gz')
43-
.pipe(decompress())
44-
.pipe(gulp.dest('./server'))
34+
glob.Glob(server_dir +'/org.eclipse.jdt.ls.core/target/org.eclipse.jdt.ls.core-*-SNAPSHOT.jar',
35+
(_error, sources) => {
36+
glob.Glob('./server/plugins/org.eclipse.jdt.ls.core_*.jar',
37+
(_error, targets) => {
38+
console.log('Copying '+sources[0]+ ' to '+targets[0]);
39+
fse.copy(sources[0], targets[0]);
40+
});
41+
});
4542
done();
4643
});
4744

4845
gulp.task('watch_server',function(done) {
49-
gulp.watch(server_dir+'/org.eclipse.jdt.ls.core/**/*.java',['dev_server']);
46+
gulp.watch(server_dir+'/org.eclipse.jdt.ls.core/**/*.java', gulp.series('dev_server'));
5047
done();
5148
});
5249

0 commit comments

Comments
 (0)