From 1650bab05c0407ea61bb9abffc275231dacfa86f Mon Sep 17 00:00:00 2001 From: Nikita Fedkin Date: Tue, 4 Jun 2024 19:54:05 +0000 Subject: [PATCH 1/3] Update dependencies --- .devcontainer/devcontainer.json | 4 ++- build.gradle.kts | 29 +++++++++++-------- .../testrunner/TestRunnerAdapter.java | 5 ++-- .../diagnostics/TypoDiagnostic.java | 7 ++--- .../languageserver/BSLLanguageServerTest.java | 4 +-- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3e87a12aa22..1b6a3b2913c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,9 @@ "vscode": { "extensions": [ "vscjava.vscode-gradle", - "GitHub.vscode-github-actions" + "GitHub.vscode-github-actions", + "astrizhachuk.1c-extension-pack", + "zhuangtongfa.Material-theme" ] } } diff --git a/build.gradle.kts b/build.gradle.kts index 064bc21f346..37af904a504 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import gradlegitproperties.org.ajoberstar.grgit.Grgit import me.qoomon.gitversioning.commons.GitRefType import org.apache.tools.ant.filters.EscapeUnicode import java.util.* @@ -16,7 +17,7 @@ plugins { id("io.freefair.maven-central.validate-poms") version "8.6" id("me.qoomon.git-versioning") version "6.4.3" id("com.github.ben-manes.versions") version "0.51.0" - id("org.springframework.boot") version "3.2.5" + id("org.springframework.boot") version "3.3.0" id("io.spring.dependency-management") version "1.1.5" id("io.github.1c-syntax.bslls-dev-tools") version "0.8.0" id("ru.vyarus.pom") version "3.0.0" @@ -50,9 +51,13 @@ gitVersioning.apply { } } +gitProperties { + customProperty("git.build.time", "2018-03-28T05:13:53Z") +} + val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG -val languageToolVersion = "6.1" +val languageToolVersion = "6.4" dependencyManagement { imports { @@ -70,8 +75,8 @@ dependencies { api("info.picocli:picocli-spring-boot-starter:4.7.6") // lsp4j core - api("org.eclipse.lsp4j", "org.eclipse.lsp4j", "0.21.0") - api("org.eclipse.lsp4j", "org.eclipse.lsp4j.websocket.jakarta", "0.21.0") + api("org.eclipse.lsp4j", "org.eclipse.lsp4j", "0.23.1") + api("org.eclipse.lsp4j", "org.eclipse.lsp4j.websocket.jakarta", "0.23.1") // 1c-syntax api("io.github.1c-syntax", "bsl-parser", "0.24.0") { @@ -95,19 +100,19 @@ dependencies { implementation("org.languagetool", "language-ru", languageToolVersion) // AOP - implementation("org.aspectj", "aspectjrt", "1.9.19") + implementation("org.aspectj", "aspectjrt", "1.9.22.1") // commons utils - implementation("commons-io", "commons-io", "2.13.0") - implementation("org.apache.commons", "commons-lang3", "3.12.0") + implementation("commons-io", "commons-io", "2.16.1") + implementation("org.apache.commons", "commons-lang3", "3.14.0") implementation("commons-beanutils", "commons-beanutils", "1.9.4"){ exclude("commons-logging", "commons-logging") } implementation("org.apache.commons", "commons-collections4", "4.4") - implementation("org.apache.commons", "commons-exec", "1.3") + implementation("org.apache.commons", "commons-exec", "1.4.0") // progress bar - implementation("me.tongfei", "progressbar", "0.9.5") + implementation("me.tongfei", "progressbar", "0.10.1") // (de)serialization implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") @@ -126,7 +131,7 @@ dependencies { // CONSTRAINTS implementation("com.google.guava:guava") { version { - strictly("32.0.1-jre") + strictly("33.2.1-jre") } } @@ -142,11 +147,11 @@ dependencies { // test utils testImplementation("org.jmockit", "jmockit", "1.49") - testImplementation("org.awaitility", "awaitility", "4.2.0") + testImplementation("org.awaitility", "awaitility", "4.2.1") } lombok { - version.set("edge-SNAPSHOT") + version.set("1.18.32") } jacoco { diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java index c853bb4b290..badd8e71f7f 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java @@ -38,6 +38,7 @@ import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Paths; +import java.time.Duration; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -83,14 +84,14 @@ private List computeTestIds(DocumentContext documentContext) { var getTestsCommand = new CommandLine(executable).addArguments(arguments, false); var timeout = 10_000L; - var watchdog = new ExecuteWatchdog(timeout); + var watchdog = ExecuteWatchdog.builder().setTimeout(Duration.ofMillis(timeout)).get(); var outputStream = new ByteArrayOutputStream(); var streamHandler = new PumpStreamHandler(outputStream); var resultHandler = new DefaultExecuteResultHandler(); - var executor = new DefaultExecutor(); + var executor = DefaultExecutor.builder().get(); executor.setWatchdog(watchdog); executor.setStreamHandler(streamHandler); diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java index 5183d00a53c..32db59a0a11 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java @@ -38,8 +38,7 @@ import org.antlr.v4.runtime.Token; import org.apache.commons.lang3.StringUtils; import org.languagetool.JLanguageTool; -import org.languagetool.language.AmericanEnglish; -import org.languagetool.language.Russian; +import org.languagetool.Languages; import org.languagetool.rules.RuleMatch; import java.io.IOException; @@ -68,8 +67,8 @@ public class TypoDiagnostic extends AbstractDiagnostic { @Getter(lazy = true, value = AccessLevel.PRIVATE) private static final Map languageToolPoolMap = Map.of( - "en", new JLanguageToolPool(new AmericanEnglish()), - "ru", new JLanguageToolPool(new Russian()) + "en", new JLanguageToolPool(Languages.getLanguageForShortCode("en-US")), + "ru", new JLanguageToolPool(Languages.getLanguageForShortCode("ru")) ); /** diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/BSLLanguageServerTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/BSLLanguageServerTest.java index 479b4ddcebb..73db8cd1116 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/BSLLanguageServerTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/BSLLanguageServerTest.java @@ -66,7 +66,7 @@ void initialize() throws ExecutionException, InterruptedException { // given InitializeParams params = new InitializeParams(); - WorkspaceFolder workspaceFolder = new WorkspaceFolder(Absolute.path(PATH_TO_METADATA).toUri().toString()); + WorkspaceFolder workspaceFolder = new WorkspaceFolder(Absolute.path(PATH_TO_METADATA).toUri().toString(), "test"); List workspaceFolders = List.of(workspaceFolder); params.setWorkspaceFolders(workspaceFolders); @@ -82,7 +82,7 @@ void initializeRename() throws ExecutionException, InterruptedException { // given InitializeParams params = new InitializeParams(); - WorkspaceFolder workspaceFolder = new WorkspaceFolder(Absolute.path(PATH_TO_METADATA).toUri().toString()); + WorkspaceFolder workspaceFolder = new WorkspaceFolder(Absolute.path(PATH_TO_METADATA).toUri().toString(), "test"); List workspaceFolders = List.of(workspaceFolder); params.setWorkspaceFolders(workspaceFolders); From 824894f23c76c787d5eb8e7261a5458c6fb78601 Mon Sep 17 00:00:00 2001 From: Nikita Fedkin Date: Tue, 4 Jun 2024 22:35:22 +0200 Subject: [PATCH 2/3] Downgrade spring boot to 3.2.5 Until javadoc issue will be resolved --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 37af904a504..3f4c1d1de9d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ plugins { id("io.freefair.maven-central.validate-poms") version "8.6" id("me.qoomon.git-versioning") version "6.4.3" id("com.github.ben-manes.versions") version "0.51.0" - id("org.springframework.boot") version "3.3.0" + id("org.springframework.boot") version "3.2.5" id("io.spring.dependency-management") version "1.1.5" id("io.github.1c-syntax.bslls-dev-tools") version "0.8.0" id("ru.vyarus.pom") version "3.0.0" From 9524c1313cebe489a7ce5141f7b3734ca655cbb9 Mon Sep 17 00:00:00 2001 From: Maximov Valery Date: Wed, 5 Jun 2024 08:34:42 +0300 Subject: [PATCH 3/3] add buildtime --- build.gradle.kts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3f4c1d1de9d..5a70f42f60f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import gradlegitproperties.org.ajoberstar.grgit.Grgit import me.qoomon.gitversioning.commons.GitRefType import org.apache.tools.ant.filters.EscapeUnicode import java.util.* +import java.text.SimpleDateFormat plugins { `java-library` @@ -52,7 +53,7 @@ gitVersioning.apply { } gitProperties { - customProperty("git.build.time", "2018-03-28T05:13:53Z") + customProperty("git.build.time", buildTime()) } val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG @@ -390,3 +391,9 @@ nexusStaging { tasks.withType { enabled = false } + +fun buildTime(): String { + val formatter = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") + formatter.timeZone = TimeZone.getTimeZone("UTC") + return formatter.format(Date()) +}