File tree Expand file tree Collapse file tree 6 files changed +40
-11
lines changed Expand file tree Collapse file tree 6 files changed +40
-11
lines changed Original file line number Diff line number Diff line change @@ -69,14 +69,22 @@ jobs:
6969 uses : actions/checkout@v5 # https://github.com/actions/checkout
7070
7171
72- - name : " Install: JDK 11 ☕"
72+ - name : " Install: JDK 11 ☕ for compilation/tests "
7373 uses : actions/setup-java@v5 # https://github.com/actions/setup-java
7474 with :
7575 distribution : temurin
7676 java-version : 11
7777 cache : gradle
7878
7979
80+ - name : " Install: JDK 17 ☕ for running gradle"
81+ uses : actions/setup-java@v5 # https://github.com/actions/setup-java
82+ with :
83+ distribution : temurin
84+ java-version : 17
85+ cache : gradle
86+
87+
8088 - name : Build with Gradle 🏗️
8189 run : ./gradlew build
8290
Original file line number Diff line number Diff line change 1+ org.gradle.daemon =false
2+ org.gradle.java.installations.auto-detect =true
3+ org.gradle.java.installations.auto-download =true
4+
5+ # Optionally, you can hint custom JDK locations (semicolon-separated on Windows):
6+ # org.gradle.java.installations.paths=C:\\jdks\\jdk-11;C:\\jdks\\jdk-21
7+
8+ # To run Gradle itself on a specific JDK (machine-specific), prefer setting JAVA_HOME
9+ # before invoking Gradle or use --java-home on the command line.
Original file line number Diff line number Diff line change 1010 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1111 ******************************************************************************/
1212
13+ // Use central version from gradle/versions.gradle
14+
1315java {
14- sourceCompatibility = JavaVersion . VERSION_11
16+ sourceCompatibility = JavaVersion . toVersion(versions. java)
17+ // Use same Java version for compilation and task launches
18+ toolchain {
19+ languageVersion = JavaLanguageVersion . of(versions. java as Integer )
20+ }
1521}
1622
1723tasks. withType(Javadoc ) {
@@ -21,6 +27,15 @@ tasks.withType(Javadoc) {
2127
2228tasks. withType(JavaCompile ) {
2329 options. encoding = ' UTF-8'
30+ // Ensure cross-compilation targets specified Java version
31+ options. release = versions. java as Integer
32+ }
33+
34+ // Ensure tests run on the targeted JDK (not the Gradle JVM)
35+ tasks. withType(Test ). configureEach {
36+ javaLauncher = javaToolchains. launcherFor {
37+ languageVersion = JavaLanguageVersion . of(versions. java as Integer )
38+ }
2439}
2540
2641task sourcesJar (type : Jar , dependsOn : classes) {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def qualifiedVersion = baseVersion + '.v' + buildTime
2121jar. bundle. bnd (
2222 ' Bundle-Version' : qualifiedVersion,
2323 ' Bundle-Vendor' : ' Eclipse LSP4J' ,
24- ' Bundle-RequiredExecutionEnvironment' : ' JavaSE-11 ' ,
24+ ' Bundle-RequiredExecutionEnvironment' : " JavaSE-${ versions.java } " ,
2525 " -exportcontents" : " org.eclipse.lsp4j.*" ,
2626 " -savemanifest" : " build/tmp/bnd/MANIFEST.MF" ,
2727)
Original file line number Diff line number Diff line change 1212
1313version = ' 1.0.0-SNAPSHOT'
1414
15- ext. versions = [
15+ ext. versions = [
16+ ' java' : 11 ,
17+
1618 ' xtend_lib' : ' 2.32.0' ,
1719 ' guava' : ' [32.1.2,34)' ,
1820 ' gson' : ' [2.9.1,3.0)' ,
Original file line number Diff line number Diff line change 11/* *****************************************************************************
22 * Copyright (c) 2016 TypeFox and others.
3- *
3+ *
44 * This program and the accompanying materials are made available under the
55 * terms of the Eclipse Public License v. 2.0 which is available at
66 * http://www.eclipse.org/legal/epl-2.0,
77 * or the Eclipse Distribution License v. 1.0 which is available at
88 * http://www.eclipse.org/org/documents/edl-v10.php.
9- *
9+ *
1010 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1111 ******************************************************************************/
1212
1313ext. title = ' LSP4J'
1414description = ' Java bindings for the Language Server Protocol'
1515
16- java {
17- sourceCompatibility = JavaVersion . VERSION_11
18- targetCompatibility = JavaVersion . VERSION_11
19- }
20-
2116dependencies {
2217 compileOnly project(" :org.eclipse.lsp4j.generator" )
2318 api project(" :org.eclipse.lsp4j.jsonrpc" )
You can’t perform that action at this time.
0 commit comments