Skip to content

Commit b3cb840

Browse files
fbriconrgrunber
authored andcommitted
Speedup local jdt.ls build
- deletes existing ./server folder - avoid downloading gradle checksums when not needed Signed-off-by: Fred Bricon <[email protected]>
1 parent 828bc44 commit b3cb840

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ This assumes that you are starting on the `vscode-java` directory
7979
```
8080

8181
**\*Optional:**
82-
You can run faster server builds during development by calling `./node_modules/.bin/gulp dev_server` script instead, this will build server binaries that are required by your host OS only. You can also use `npm run watch-server` which will build and place them on the extension for Java changes. These commands run Maven in offline mode, so you might need to run `build-server` at least once, to fetch all the dependencies.
82+
You can run faster server builds during development by calling `npm run fast-build-server` script instead, this will build server binaries that are required by your host OS only. You can also use `npm run watch-server` which will build and place them on the extension for Java changes. These commands run Maven in offline mode, so you might need to run `build-server` at least once, to fetch all the dependencies.
8383

8484
This will build and place the binaries under the `server` folder. Alternately you can download and use the latest snapshot build from [Eclipse &trade; JDT Language Server](https://github.com/eclipse/eclipse.jdt.ls) project with the following
8585

@@ -93,7 +93,7 @@ Below are the details about how to set up the JDT Language Server in different I
9393
### B-1) Setting up the JDT Language Server in VS Code
9494
1) Please install [Eclipse PDE support](https://marketplace.visualstudio.com/items?itemName=yaozheng.vscode-pde) extension in your VS Code first. The PDE extension's home page provides more usage details about _Reload Target Platform_, _Run JUnit Plug-in Test_, _Run Eclipse Application_.
9595

96-
2) Open VS Code on the `eclipse.jdt.ls` folder. The PDE extension will work with Java extension together to automatically load the eclipse.jdt.ls project. Check the status of the language tools on the lower right corner. It should show ready (thumbs up) as the image below.
96+
2) Open VS Code on the `eclipse.jdt.ls` folder. The PDE extension will work with Java extension together to automatically load the eclipse.jdt.ls project. Check the status of the language tools on the lower right corner. It should show ready (thumbs up) as the image below.
9797
![status indicator](images/statusMarker.png)
9898

9999
### B-2) Setting up the JDT Language Server in Eclipse
@@ -140,18 +140,18 @@ While developing the language server and the extension, you don't need to deploy
140140

141141
1. Open VSCode on the `vscode-java` folder
142142

143-
2. In the debug viewlet, run the launch _Launch Extension - Remote Server_
143+
2. In the debug viewlet, run the launch _Launch Extension - Remote Server_
144144
![Remote Server](images/changelog/RemoteServer.png)
145145

146146
3. The extension will open a socket on port 3333 and will wait for the JDT language server to connect
147147

148148
### b) _Launch Debug Server - Server Side_
149149

150150
- With the client side **(vscode-java) running**, you can start the remote server in your preferred IDE.
151-
- Start the remote server via VS Code.
151+
- Start the remote server via VS Code.
152152
![Remote Server In VS Code](images/changelog/RemoteServerInVSCode.png)
153153

154-
- Start the remote server via Eclipse.
154+
- Start the remote server via Eclipse.
155155
![Remote Server In Eclipse](images/changelog/DebugRemoteServer.png)
156156

157157
- In the debug console of VSCode you can see if the connection was successful.
@@ -160,7 +160,7 @@ While developing the language server and the extension, you don't need to deploy
160160
- Modify `SERVER_PORT` to specify the port the JDT LS server should connect to.
161161

162162
## C-2) The language server opens the connection first, and waits the extension to connect to it.
163-
- Start the language server via `jdt.ls.socket-stream` launch configuration in VS Code or Eclipse
163+
- Start the language server via `jdt.ls.socket-stream` launch configuration in VS Code or Eclipse
164164
![Socket Steam in VS Code](images/changelog/SocketSteamInVSCode.png)
165165

166166
- Start the extenion via _Launch Extension - JDTLS Client_ in VS Code

gulpfile.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,24 @@ const testSettings = path.join(tempTestFolder, '.vscode', 'settings.json');
1313
//...
1414

1515
gulp.task('download_server', function(done) {
16+
fse.removeSync('./server');
1617
download("http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz")
1718
.pipe(decompress())
1819
.pipe(gulp.dest('./server'));
1920
done();
2021
});
2122

2223
gulp.task('build_server', function(done) {
23-
cp.execSync(mvnw()+ ' -Pserver-distro clean package', {cwd:server_dir, stdio:[0,1,2]} );
24+
fse.removeSync('./server');
25+
cp.execSync(mvnw() + ' -Pserver-distro clean package -Declipse.jdt.ls.skipGradleChecksums', { cwd: server_dir, stdio: [0, 1, 2] });
2426
gulp.src(server_dir + '/org.eclipse.jdt.ls.product/distro/*.tar.gz')
2527
.pipe(decompress())
2628
.pipe(gulp.dest('./server'));
2729
done();
2830
});
2931

3032
gulp.task('dev_server', function(done) {
31-
let command = mvnw() +' -o -pl org.eclipse.jdt.ls.core,org.eclipse.jdt.ls.target clean package';
33+
let command = mvnw() + ' -o -pl org.eclipse.jdt.ls.core,org.eclipse.jdt.ls.target clean package -Declipse.jdt.ls.skipGradleChecksums';
3234
console.log('executing '+command);
3335
cp.execSync(command, {cwd:server_dir, stdio:[0,1,2]} );
3436
glob.Glob(server_dir +'/org.eclipse.jdt.ls.core/target/org.eclipse.jdt.ls.core-*-SNAPSHOT.jar',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,7 @@
10901090
"pretest": "npm run compile",
10911091
"test": "node ./out/test/runtest.js",
10921092
"build-server": "./node_modules/.bin/gulp build_server",
1093+
"fast-build-server": "./node_modules/.bin/gulp dev_server",
10931094
"watch-server": "./node_modules/.bin/gulp watch_server",
10941095
"tslint": "tslint -p ."
10951096
},

0 commit comments

Comments
 (0)