From 85198970896c381bd90380bacc1aaf2ef707ce8f Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 25 Apr 2023 18:37:04 +0200 Subject: [PATCH] Fix ktlint formatter after upgrade to Java 17 See https://github.com/pinterest/ktlint/issues/1195 and https://github.com/ScoopInstaller/Extras/issues/10313. Note that although this should have been fixed in the latest version of ktlint (we are using an old one), the fix doesn't seems to have worked for me. --- app/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 4d350a006..8b9659c1f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -164,6 +164,7 @@ task runKtlint(type: JavaExec) { getMainClass().set("com.pinterest.ktlint.Main") classpath = configurations.ktlint args "src/**/*.kt" + jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED") } task formatKtlint(type: JavaExec) { @@ -172,6 +173,7 @@ task formatKtlint(type: JavaExec) { getMainClass().set("com.pinterest.ktlint.Main") classpath = configurations.ktlint args "-F", "src/**/*.kt" + jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED") } afterEvaluate {