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.
This commit is contained in:
Stypox 2023-04-25 18:37:04 +02:00
parent da30e539df
commit 8519897089
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 2 additions and 0 deletions

View File

@ -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 {