feat: Support java 19 (#1319)
This commit is contained in:
Родитель
1c15819a45
Коммит
e1f99608ca
|
@ -55,7 +55,7 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [16.14.2]
|
||||
java-version: ["8", "11", "17"]
|
||||
java-version: ["8", "11", "17", "19"]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
@ -9,7 +9,7 @@ This VS Code extension provides a visual interface for your Gradle build. You ca
|
|||
## Requirements
|
||||
|
||||
- [VS Code >= 1.66.0](https://code.visualstudio.com/download)
|
||||
- [Java from 8 to 17](https://adoptopenjdk.net/)
|
||||
- [Java from 8 to 19](https://adoptopenjdk.net/)
|
||||
|
||||
## Project Discovery
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ export async function getSupportedJavaHome(): Promise<string | undefined> {
|
|||
const runtime = await getRuntime(javaHome, { withVersion: true });
|
||||
if (runtime?.version) {
|
||||
// check the JDK version of given java home is supported, otherwise return undefined
|
||||
return runtime.version.major >= 8 && runtime.version.major <= 17 ? javaHome : undefined;
|
||||
return runtime.version.major >= 8 && runtime.version.major <= 19 ? javaHome : undefined;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
|
|
|
@ -10,6 +10,9 @@ java {
|
|||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url "https://groovy.jfrog.io/artifactory/plugins-release"
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
|
@ -20,7 +23,7 @@ application {
|
|||
dependencies {
|
||||
implementation "org.eclipse.lsp4j:org.eclipse.lsp4j:0.12.0"
|
||||
implementation "org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.12.0"
|
||||
implementation "org.codehaus.groovy:groovy-eclipse-batch:3.0.8-01"
|
||||
implementation "org.codehaus.groovy:groovy-eclipse-batch:4.0.9-02"
|
||||
implementation "com.google.code.gson:gson:2.8.9"
|
||||
implementation "org.apache.bcel:bcel:6.6.1"
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
|
||||
|
|
|
@ -18,8 +18,11 @@ public class Utils {
|
|||
|
||||
private static Version getLowestGradleVersion(Version javaVersion) {
|
||||
// Ref: https://docs.gradle.org/current/userguide/compatibility.html
|
||||
if (javaVersion.isAtLeast("17")) {
|
||||
// See: https://docs.gradle.org/7.3-rc-3/release-notes.html#java17
|
||||
if (javaVersion.isAtLeast("19")) {
|
||||
return new Version("7.6");
|
||||
} else if (javaVersion.isAtLeast("18")) {
|
||||
return new Version("7.5");
|
||||
} else if (javaVersion.isAtLeast("17")) {
|
||||
return new Version("7.3");
|
||||
} else if (javaVersion.isAtLeast("16")) {
|
||||
return new Version("7.0");
|
||||
|
|
|
@ -12,6 +12,15 @@ import org.junit.Test;
|
|||
|
||||
public class UtilsTest {
|
||||
|
||||
@Test
|
||||
public void testJava19Compatibility() {
|
||||
Version javaVersion = new Version("19.0.1");
|
||||
Version gradleVersion = new Version("7.6.0");
|
||||
assertFalse(Utils.hasCompatibilityError(gradleVersion, javaVersion));
|
||||
gradleVersion = new Version("7.5.0");
|
||||
assertTrue(Utils.hasCompatibilityError(gradleVersion, javaVersion));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJava17Compatibility() {
|
||||
Version javaVersion = new Version("17.0.1");
|
||||
|
|
Загрузка…
Ссылка в новой задаче