Skip to content

Commit 0f17f95

Browse files
committed
Build with Java 18 (latest bazel is broken though)
1 parent 7fffb6c commit 0f17f95

13 files changed

Lines changed: 1602 additions & 421 deletions

File tree

‎TODOS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Docs are not getting resolved for field completions.
1919
- Create missing method always places the method in the current class, even if it belongs somewhere else.
2020
- Select entire name, find references => no results
21+
- Crashes if maven is not installed
22+
- Homebrew users don't have src.zip, detect java version and download the appropriate src.zip
2123

2224
## Optimizations
2325
- Compilation is very slow in the presence of lots of errors

‎package-lock.json‎

Lines changed: 1372 additions & 397 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@
175175
"vscode:prepublish": "npm run compile",
176176
"vscode:build": "vsce package -o build.vsix",
177177
"vscode:publish": "vsce publish patch",
178-
"compile": "tsc -p ./",
179-
"watch": "tsc -watch -p ./",
178+
"compile": "npx tsc -p ./",
179+
"watch": "npx tsc -watch -p ./",
180180
"test": "npm run compile && node ./node_modules/vscode/bin/test"
181181
},
182182
"dependencies": {
@@ -190,8 +190,8 @@
190190
"@types/mocha": "^2.2.42",
191191
"@types/node": "^10.14.6",
192192
"@types/vscode": "^1.37.0",
193-
"typescript": "^3.5.3",
194-
"vsce": "^1.66.0",
193+
"typescript": "^3.9.10",
194+
"vsce": "^2.9.2",
195195
"vscode-debugadapter-testsupport": "^1.35.0",
196196
"vscode-test": "^1.2.0"
197197
}

‎pom.xml‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
</dependencies>
5959
<build>
6060
<plugins>
61-
<!-- Set source 1.10 -->
61+
<!-- Compile-time configuration -->
6262
<plugin>
6363
<groupId>org.apache.maven.plugins</groupId>
6464
<artifactId>maven-compiler-plugin</artifactId>
6565
<version>3.8.0</version>
6666
<configuration>
67-
<source>13</source>
68-
<target>13</target>
67+
<source>18</source>
68+
<target>18</target>
6969
<compilerArgs>
7070
<arg>--add-exports</arg>
7171
<arg>jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
@@ -92,6 +92,24 @@
9292
</annotationProcessorPaths>
9393
</configuration>
9494
</plugin>
95+
<!-- Test runtime configuration -->
96+
<plugin>
97+
<groupId>org.apache.maven.plugins</groupId>
98+
<artifactId>maven-surefire-plugin</artifactId>
99+
<version>3.0.0-M7</version>
100+
<configuration>
101+
<argLine>
102+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
103+
--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
104+
--add-exports jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
105+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
106+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
107+
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
108+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
109+
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
110+
</argLine>
111+
</configuration>
112+
</plugin>
95113
<!-- Copy dependencies to dist -->
96114
<plugin>
97115
<groupId>org.apache.maven.plugins</groupId>

‎scripts/build.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ if [ ! -e node_modules ]; then
88
fi
99

1010
# Build standalone java
11-
if [ ! -e jdks/linux/jdk-13 ]; then
11+
if [ ! -e jdks/linux/jdk-18 ]; then
1212
./scripts/download_linux_jdk.sh
1313
fi
14-
if [ ! -e jdks/windows/jdk-13 ]; then
14+
if [ ! -e jdks/windows/jdk-18 ]; then
1515
./scripts/download_windows_jdk.sh
1616
fi
1717
if [ ! -e dist/linux/bin/java ]; then
@@ -28,8 +28,8 @@ fi
2828
if [ ! -e src/main/java/com/google/devtools/build/lib/analysis/AnalysisProtos.java ]; then
2929
./scripts/gen_proto.sh
3030
fi
31-
./scripts/format.sh
32-
JAVA_HOME=`/usr/libexec/java_home -v 13` mvn package -DskipTests
31+
32+
mvn package -DskipTests
3333

3434
# Build vsix
3535
npm run-script vscode:build

‎scripts/download_linux_jdk.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ set -e
66
# Download linux jdk
77
mkdir -p jdks/linux
88
cd jdks/linux
9-
curl https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_linux-x64_bin.tar.gz > linux.tar.gz
9+
curl https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_linux-x64_bin.tar.gz > linux.tar.gz
1010
gunzip -c linux.tar.gz | tar xopf -
1111
rm linux.tar.gz
12+
mv jdk-18.0.1.1 jdk-18
1213
cd ../..

‎scripts/download_windows_jdk.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ set -e
66
# Download windows jdk
77
mkdir -p jdks/windows
88
cd jdks/windows
9-
curl https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_windows-x64_bin.zip > windows.zip
9+
curl https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_windows-x64_bin.zip > windows.zip
1010
unzip windows.zip
1111
rm windows.zip
12+
mv jdk-18.0.1.1 jdk-18
1213
cd ../..

‎scripts/link_linux.sh‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
set -e
55

66
# Set env variables to build with mac toolchain but linux target
7-
REAL_JAVA_HOME=$JAVA_HOME
8-
JAVA_HOME="./jdks/linux/jdk-13"
7+
JAVA_HOME="./jdks/linux/jdk-18"
98

109
# Build in dist/linux
1110
rm -rf dist/linux
12-
$REAL_JAVA_HOME/bin/jlink \
11+
jlink \
1312
--module-path $JAVA_HOME/jmods \
1413
--add-modules java.base,java.compiler,java.logging,java.sql,java.xml,jdk.compiler,jdk.jdi,jdk.unsupported,jdk.zipfs \
1514
--output dist/linux \

‎scripts/link_mac.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55

66
# Build using jlink
77
rm -rf dist/mac
8-
$JAVA_HOME/bin/jlink \
8+
jlink \
99
--add-modules java.base,java.compiler,java.logging,java.sql,java.xml,jdk.compiler,jdk.jdi,jdk.unsupported,jdk.zipfs \
1010
--output dist/mac \
1111
--no-header-files \

‎scripts/link_windows.sh‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
set -e
55

66
# Set env variables to build with mac toolchain but windows target
7-
REAL_JAVA_HOME=$JAVA_HOME
8-
JAVA_HOME="./jdks/windows/jdk-13"
7+
JAVA_HOME="./jdks/windows/jdk-18"
98

109
# Build in dist/windows
1110
rm -rf dist/windows
12-
$REAL_JAVA_HOME/bin/jlink \
11+
jlink \
1312
--module-path $JAVA_HOME/jmods \
1413
--add-modules java.base,java.compiler,java.logging,java.sql,java.xml,jdk.compiler,jdk.jdi,jdk.unsupported,jdk.zipfs \
1514
--output dist/windows \

0 commit comments

Comments
 (0)