diff --git a/CHANGELOG.md b/CHANGELOG.md index 2615842345..28ed5e383b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -132,6 +132,9 @@ The callback function provided as parameter to the format function is now called * Print an error message and return with non-zero exit code when no files are found that match with the globs ([#629](https://github.com/pinterest/ktlint/issue/629)). * Invoke callback on `format` function for all errors including errors that are autocorrected ([#1491](https://github.com/pinterest/ktlint/issues/1491)) +* Update Gradle to `7.5` version +* Update Kotlin development version to `1.7.10` and Kotlin version to `1.7.10`. +* Update Dokka to `1.7.10` version ### Removed diff --git a/build.gradle b/build.gradle index c5b5a0eb33..af124673d1 100644 --- a/build.gradle +++ b/build.gradle @@ -111,7 +111,6 @@ tasks.register("publishNewRelease", DefaultTask.class) { } tasks.withType(Wrapper).configureEach { - gradleVersion = libs.versions.gradle - distributionSha256Sum = libs.versions.gradleSha256 - distributionType = Wrapper.DistributionType.BIN + gradleVersion = libs.versions.gradle.get() + distributionSha256Sum = libs.versions.gradleSha256.get() } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 9ad2ea4cc1..2908b08b08 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -9,12 +9,12 @@ repositories { // Pass '-PkotlinDev' to command line to enable kotlin-in-development version val kotlinVersion = if (project.hasProperty("kotlinDev")) { logger.warn("Enabling kotlin dev version!") - "1.7.0" + "1.7.10" } else { - "1.7.0" + "1.7.10" } dependencies { implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") - implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.6.21") + implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.7.10") } diff --git a/buildSrc/src/main/kotlin/ktlint-kotlin-common.gradle.kts b/buildSrc/src/main/kotlin/ktlint-kotlin-common.gradle.kts index f5e1c29b6b..c2dc9be365 100644 --- a/buildSrc/src/main/kotlin/ktlint-kotlin-common.gradle.kts +++ b/buildSrc/src/main/kotlin/ktlint-kotlin-common.gradle.kts @@ -9,10 +9,6 @@ repositories { } kotlin { - jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(8)) - } - // Do not enable explicit api for cli project if (project.name != "ktlint") { explicitApiWarning() diff --git a/gradle.properties b/gradle.properties index cff3dd8d3d..e5df9f7558 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,3 +22,6 @@ org.gradle.vfs.watch=true # Uncomment following line to temporary bypass dependencies verification #org.gradle.dependency.verification=lenient + +# https://blog.jetbrains.com/kotlin/2022/07/a-new-approach-to-incremental-compilation-in-kotlin/ +kotlin.incremental.useClasspathSnapshot=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3bcab30b2f..b39146df66 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,11 +1,11 @@ [versions] -gradle = "7.4" -gradleSha256 = "8cc27038d5dbd815759851ba53e70cf62e481b87494cc97cfd97982ada5ba634" -kotlin = "1.7.0" +gradle = "7.5" +gradleSha256 = "cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2" +kotlin = "1.7.10" [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -githubRelease = "com.github.breadmoirai.github-release:2.2.12" +githubRelease = "com.github.breadmoirai.github-release:2.4.1" checksum = "org.gradle.crypto.checksum:1.4.0" shadow = "com.github.johnrengelman.shadow:7.1.2" @@ -14,13 +14,13 @@ kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", klob = "com.github.shyiko.klob:klob:0.2.1" ec4j = "org.ec4j.core:ec4j-core:0.3.0" picocli = "info.picocli:picocli:4.6.3" -logging = "io.github.microutils:kotlin-logging-jvm:2.1.21" +logging = "io.github.microutils:kotlin-logging-jvm:2.1.23" # Use logback-classic as the logger for kotlin-logging / slf4j as it allow changing the log level at runtime. logback = "ch.qos.logback:logback-classic:1.2.11" # Required for logback.xml conditional configuration janino = "org.codehaus.janino:janino:3.1.7" # Testing libraries -junit5 = "org.junit.jupiter:junit-jupiter:5.8.2" -assertj = "org.assertj:assertj-core:3.22.0" +junit5 = "org.junit.jupiter:junit-jupiter:5.9.0" +assertj = "org.assertj:assertj-core:3.23.1" sarif4k = "io.github.detekt.sarif4k:sarif4k:0.0.1" jimfs = "com.google.jimfs:jimfs:1.2" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 3285e6ec4d..428cbfb492 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -44,7 +44,10 @@ - + + + + @@ -98,6 +101,7 @@ + @@ -179,11 +183,24 @@ + + + + + + + + + + + + + @@ -194,6 +211,14 @@ + + + + + + + + @@ -202,6 +227,11 @@ + + + + + @@ -239,6 +269,11 @@ + + + + + @@ -281,6 +316,14 @@ + + + + + + + + @@ -291,6 +334,11 @@ + + + + + @@ -311,6 +359,11 @@ + + + + + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2a..249e5832f0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1debed0d8f..012d6d9044 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=8cc27038d5dbd815759851ba53e70cf62e481b87494cc97cfd97982ada5ba634 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787337..a69d9cb6c2 100755 --- a/gradlew +++ b/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd32c4..f127cfd49d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal