Skip to content

Commit 644c07f

Browse files
committed
Read actual classpath from bazel; simplify link strategy
1 parent 902118e commit 644c07f

26 files changed

Lines changed: 62294 additions & 204 deletions

‎.gitignore‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/out
22
/node_modules
33
/target
4-
/dist
5-
/modules/gson.jar
4+
/dist/classpath
5+
/dist/mac
6+
/dist/windows
67
/jdks
78

89
/dependency-reduced-pom.xml

‎.vscodeignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ lib/**
88
!lib/java.tmLanguage.json
99
!lib/java.hover.tmLanguage.json
1010
!lib/tree-sitter-java.wasm
11-
modules/**
1211
scripts/**
1312
src/**
1413
out/test/**

‎dist/debug_adapter_mac.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
DIR=`dirname $0`
3+
$DIR/launch_mac.sh org.javacs.debug.JavaDebugServer $@

‎dist/debug_adapter_windows.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
DIR=`dirname $0`
3+
$DIR/launch_windows.sh org.javacs.debug.JavaDebugServer $@

‎dist/lang_server_mac.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
DIR=`dirname $0`
3+
$DIR/launch_mac.sh org.javacs.Main $@

‎dist/lang_server_windows.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
DIR=`dirname $0`
3+
$DIR/launch_windows.sh org.javacs.Main $@

‎dist/launch_mac.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
JLINK_VM_OPTIONS="\
3+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
4+
--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
5+
--add-exports jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
6+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
7+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
8+
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
9+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
10+
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
11+
DIR=`dirname $0`
12+
CLASSPATH_OPTIONS="-classpath $DIR/classpath/gson-2.8.5.jar:$DIR/classpath/protobuf-java-3.9.1.jar:$DIR/classpath/java-language-server.jar"
13+
$DIR/mac/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@

‎dist/launch_windows.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
JLINK_VM_OPTIONS="\
3+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
4+
--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
5+
--add-exports jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
6+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
7+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
8+
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
9+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
10+
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
11+
DIR=`dirname $0`
12+
CLASSPATH_OPTIONS="-classpath $DIR/classpath/gson-2.8.5.jar;$DIR/classpath/protobuf-java-3.9.1.jar;$DIR/classpath/java-language-server.jar"
13+
$DIR/windows/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@

‎lib/extension.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ function createProgressListeners(client: LanguageClient) {
277277
function platformSpecificLangServer(): string[] {
278278
switch (process.platform) {
279279
case 'win32':
280-
return ['dist', 'windows', 'bin', 'launcher'];
280+
return ['dist', 'lang_server_windows.sh'];
281281

282282
case 'darwin':
283-
return ['dist', 'mac', 'bin', 'launcher'];
283+
return ['dist', 'lang_server_mac.sh'];
284284
}
285285

286286
throw `unsupported platform: ${process.platform}`;

‎modules/module-info.java‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)