Skip to content

Commit 9d7682a

Browse files
authored
Merge pull request #3560 from 1c-syntax/copilot/support-jdk25
Add JDK 25 support with Gradle 9.1.0 and migrate release workflows to JDK 25
2 parents 4848d79 + ad40649 commit 9d7682a

File tree

11 files changed

+25
-21
lines changed

11 files changed

+25
-21
lines changed

.github/workflows/check-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Set up JDK
3838
uses: actions/setup-java@v5
3939
with:
40-
java-version: 23
40+
java-version: 25
4141
distribution: 'temurin'
4242
cache: gradle
4343

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
java_version: ['17', '21', '23']
36+
java_version: ['17', '21', '25']
3737
os: [ubuntu-latest, windows-latest, macOS-latest]
3838
steps:
3939
- uses: actions/checkout@v5

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up JDK
3535
uses: actions/setup-java@v5
3636
with:
37-
java-version: 23
37+
java-version: 25
3838
distribution: 'temurin'
3939
cache: gradle
4040

build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ plugins {
77
`java-library`
88
`maven-publish`
99
jacoco
10-
id("org.cadixdev.licenser") version "0.6.1"
10+
id("cloud.rio.license") version "0.18.0"
1111
id("me.qoomon.git-versioning") version "6.4.4"
1212
id("io.freefair.lombok") version "9.0.0"
1313
id("io.freefair.javadoc-links") version "9.0.0"
1414
id("io.freefair.javadoc-utf-8") version "9.0.0"
1515
id("io.freefair.aspectj.post-compile-weaving") version "9.0.0"
16-
id("io.freefair.maven-central.validate-poms") version "9.0.0"
16+
// id("io.freefair.maven-central.validate-poms") version "9.0.0" // TODO: Re-enable when compatible with Gradle 9
1717
id("com.github.ben-manes.versions") version "0.53.0"
1818
id("org.springframework.boot") version "3.5.7"
1919
id("io.spring.dependency-management") version "1.1.7"
@@ -207,12 +207,12 @@ tasks.check {
207207
mustRunAfter(tasks.generateDiagnosticDocs)
208208
}
209209

210-
tasks.checkLicenseMain {
210+
tasks.named("licenseMain") {
211211
dependsOn(tasks.generateSentryDebugMetaPropertiesjava)
212212
dependsOn(tasks.collectExternalDependenciesForSentry)
213213
}
214214

215-
tasks.updateLicenseMain {
215+
tasks.named("licenseFormatMain") {
216216
dependsOn(tasks.generateSentryDebugMetaPropertiesjava)
217217
dependsOn(tasks.collectExternalDependenciesForSentry)
218218
}
@@ -267,11 +267,13 @@ tasks.javadoc {
267267
}
268268

269269
license {
270-
header(rootProject.file("license/HEADER.txt"))
271-
newLine(false)
270+
header = rootProject.file("license/HEADER.txt")
271+
skipExistingHeaders = false
272+
strictCheck = true
272273
ext["year"] = "2018-" + Calendar.getInstance().get(Calendar.YEAR)
273274
ext["name"] = "Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]>"
274275
ext["project"] = "BSL Language Server"
276+
mapping("java", "SLASHSTAR_STYLE")
275277
exclude("**/*.properties")
276278
exclude("**/*.xml")
277279
exclude("**/*.json")

docs/contributing/EnvironmentSetting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Необходимое ПО
66

7-
* Java Development Kit 17
7+
* Java Development Kit 17 или новее (до JDK 25)
88
* [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/)
99
* Плагины IntelliJ IDEA
1010
* Lombok Plugin
@@ -14,7 +14,7 @@
1414

1515
### Настройки IntelliJ IDEA
1616

17-
* Настроить [Java SDK на JDK17](https://www.jetbrains.com/help/idea/sdk.html#manage_sdks)
17+
* Настроить [Java SDK на JDK17 или новее](https://www.jetbrains.com/help/idea/sdk.html#manage_sdks)
1818
* Включить обработку аннотаций: `File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors -> Enable annotation processing`
1919
* Выполнить настройки автоимпорта, подробно описано в [статье](https://www.jetbrains.com/help/idea/creating-and-optimizing-imports.html). Отдельно стоит обратить внимание на оптимизацию импорта.
2020
* Не надо запускать оптимизацию импортов всего проекта, за этим следят мейнтейнеры. Если после оптимизации импортов появились измененные файлы, которые не менялись в процессе разработки, стоит уведомить мейнтейнеров и откатить эти изменения.

docs/en/contributing/EnvironmentSetting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Development is underway using [IntelliJ IDEA Community Edition](https://www.jetb
44

55
## Required Software
66

7-
* Java Development Kit 17
7+
* Java Development Kit 17 or newer (up to JDK 25)
88
* [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/)
99
* Plugins IntelliJ IDEA
1010
* Lombok Plugin
@@ -14,7 +14,7 @@ Please note that plugins do not have to be installed - if you have Internet acce
1414

1515
### IntelliJ IDEA Settings
1616

17-
* Set [Java SDK to JDK17](https://www.jetbrains.com/help/idea/sdk.html#manage_sdks)
17+
* Set [Java SDK to JDK17 or newer](https://www.jetbrains.com/help/idea/sdk.html#manage_sdks)
1818
* Enable annotation processing: `File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors -> Enable annotation processing`
1919
* Configure auto import settings, details in the [article](https://www.jetbrains.com/help/idea/creating-and-optimizing-imports.html). Pay special attention to import optimization.
2020
* There is no need to start optimization of imports of the entire project, this is followed by maintainers. If, after optimizing imports, changed files appeared that did not change during the development process, you should notify the maintainers and roll back these changes.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/com/github/_1c_syntax/bsl/languageserver/cli/LanguageServerStartCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class LanguageServerStartCommand implements Callable<Integer> {
7575
public Integer call() {
7676

7777
var configurationFile = new File(configurationOption);
78-
if (configurationFile.exists()) {
78+
if (configurationFile.exists() && !configurationFile.isDirectory()) {
7979
configuration.update(configurationFile);
8080
}
8181

src/main/java/com/github/_1c_syntax/bsl/languageserver/cli/WebsocketCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public class WebsocketCommand implements Callable<Integer> {
8787

8888
public Integer call() {
8989
var configurationFile = new File(configurationOption);
90-
if (configurationFile.exists()) {
90+
if (configurationFile.exists() && !configurationFile.isDirectory()) {
9191
configuration.update(configurationFile);
9292
}
9393

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
import java.io.File;
5252
import java.io.IOException;
53+
import java.nio.file.Files;
5354
import java.nio.file.Path;
5455

5556
import static com.fasterxml.jackson.databind.MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS;
@@ -174,7 +175,7 @@ public static Path getCustomConfigurationRoot(LanguageServerConfiguration config
174175
}
175176

176177
private void loadConfigurationFile(File configurationFile) {
177-
if (!configurationFile.exists()) {
178+
if (!configurationFile.exists() || configurationFile.isDirectory()) {
178179
return;
179180
}
180181

@@ -184,8 +185,8 @@ private void loadConfigurationFile(File configurationFile) {
184185
.enable(ACCEPT_CASE_INSENSITIVE_ENUMS)
185186
.build();
186187

187-
try {
188-
configuration = mapper.readValue(configurationFile, LanguageServerConfiguration.class);
188+
try (var inputStream = Files.newInputStream(configurationFile.toPath())) {
189+
configuration = mapper.readValue(inputStream, LanguageServerConfiguration.class);
189190
} catch (IOException e) {
190191
LOGGER.error("Can't deserialize configuration file", e);
191192
return;

0 commit comments

Comments
 (0)