diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index bd47a5c4..98998b1b 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -18,10 +18,10 @@ jobs: - uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' - java-version: 17 + java-version: 21 - name: Gradle wrapper validation uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1 # https://github.com/gradle/wrapper-validation-action/issues/66 @@ -38,7 +38,7 @@ jobs: - name: Upload test results if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results-${{ matrix.os }} path: "${{ github.workspace }}/**/build/reports/tests" @@ -50,7 +50,7 @@ jobs: matrix: os: [ ubuntu-latest, windows-latest ] gradle: [ 8.4, current, release-candidate ] - java: [ 11, 17, 19 ] + java: [ 11, 17, 21 ] name: '[${{ matrix.os }}] Gradle: ${{ matrix.gradle }}, Java: ${{ matrix.java }}' steps: @@ -59,7 +59,7 @@ jobs: fetch-depth: 0 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: ${{ matrix.java }} @@ -78,7 +78,7 @@ jobs: - name: Upload reports if: ${{ failure() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "test-project-reports-${{ matrix.os }}-${{ matrix.gradle }}-${{ matrix.java }}" path: "${{ github.workspace }}/**/build/reports/ktlint" @@ -107,7 +107,7 @@ jobs: fail-fast: false matrix: gradle: [ current ] - java: [ 17 ] + java: [ 21 ] agp: ${{ fromJSON(needs.provide-agp-version-matrix.outputs.agp-versions) }} name: '[android] Gradle: ${{ matrix.gradle }}, Java: ${{ matrix.java }}, AGP: ${{ matrix.agp }}' @@ -117,7 +117,7 @@ jobs: fetch-depth: 0 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: ${{ matrix.java }} @@ -137,7 +137,7 @@ jobs: - name: Upload reports if: ${{ failure() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "test-project-android-reports-${{ matrix.gradle }}-${{ matrix.java }}-${{ matrix.agp }}" path: "${{ github.workspace }}/**/build/reports/ktlint" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ad981a6..bcb57fa5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,10 @@ jobs: - uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' - java-version: 17 + java-version: 21 - name: Gradle wrapper validation uses: gradle/wrapper-validation-action@v1 diff --git a/README.md b/README.md index 7ffb4c3e..13e55e79 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Available on the Gradle Plugins Portal: https://plugins.gradle.org/plugin/org.jm ```kotlin plugins { - id("org.jmailen.kotlinter") version "4.1.1" + id("org.jmailen.kotlinter") version "4.2.0" } ``` @@ -31,7 +31,7 @@ plugins { ```groovy plugins { - id "org.jmailen.kotlinter" version "4.1.1" + id "org.jmailen.kotlinter" version "4.2.0" } ``` @@ -45,7 +45,7 @@ Root `build.gradle.kts` ```kotlin plugins { - id("org.jmailen.kotlinter") version "4.1.1" apply false + id("org.jmailen.kotlinter") version "4.2.0" apply false } ``` @@ -65,7 +65,7 @@ Root `build.gradle` ```groovy plugins { - id 'org.jmailen.kotlinter' version "4.1.1" apply false + id 'org.jmailen.kotlinter' version "4.2.0" apply false } ``` @@ -83,6 +83,7 @@ plugins { | kotlinter version | min kotlin version | max kotlin version | min gradle version | |-------------------|--------------------|--------------------|--------------------| +| 4.2.0+ | 1.9.20 | - | 8.4 | | 4.0.0+ | 1.9.0 | - | 7.6 | | 3.14.0+ | 1.8.0 | 1.8.22 | 7.6 | | 3.11.0+ | 1.7.0 | 1.7.22 | 7.0 | diff --git a/build.gradle.kts b/build.gradle.kts index 57ca9eea..0359889c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,11 +2,11 @@ import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "1.9.20" + kotlin("jvm") version "1.9.22" id("com.gradle.plugin-publish") version "1.1.0" `java-gradle-plugin` `maven-publish` - id("org.jmailen.kotlinter") version "4.1.0" + id("org.jmailen.kotlinter") version "4.1.1" idea } @@ -20,15 +20,15 @@ val githubUrl = "https://github.com/jeremymailen/kotlinter-gradle" val webUrl = "https://github.com/jeremymailen/kotlinter-gradle" val projectDescription = "Lint and formatting for Kotlin using ktlint with configuration-free setup on JVM and Android projects" -version = "4.1.1" +version = "4.2.0" group = "org.jmailen.gradle" description = projectDescription object Versions { - const val androidTools = "7.3.1" - const val junit = "5.9.3" - const val ktlint = "1.0.1" - const val mockitoKotlin = "4.1.0" + const val ANDROID_TOOLS = "7.3.1" + const val JUNIT = "5.10.1" + const val KTLINT = "1.1.1" + const val MOCKITO_KOTLIN = "4.1.0" } configurations { @@ -51,7 +51,7 @@ configurations { dependencies { compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin") - compileOnly("com.android.tools.build:gradle:${Versions.androidTools}") + compileOnly("com.android.tools.build:gradle:${Versions.ANDROID_TOOLS}") listOf( "ktlint-rule-engine", @@ -62,20 +62,20 @@ dependencies { "ktlint-cli-reporter-html", "ktlint-cli-reporter-plain", "ktlint-cli-reporter-sarif", - "ktlint-ruleset-standard" + "ktlint-ruleset-standard", ).forEach { module -> - implementation("com.pinterest.ktlint:$module:${Versions.ktlint}") + implementation("com.pinterest.ktlint:$module:${Versions.KTLINT}") } - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}") - testImplementation("org.junit.jupiter:junit-jupiter-params:${Versions.junit}") - testImplementation("commons-io:commons-io:2.12.0") - testImplementation("org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.JUNIT}") + testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.JUNIT}") + testImplementation("org.junit.jupiter:junit-jupiter-params:${Versions.JUNIT}") + testImplementation("commons-io:commons-io:2.15.1") + testImplementation("org.mockito.kotlin:mockito-kotlin:${Versions.MOCKITO_KOTLIN}") } kotlin { - jvmToolchain(17) + jvmToolchain(21) } tasks { @@ -115,7 +115,7 @@ tasks { } wrapper { - gradleVersion = "8.4" + gradleVersion = "8.5" } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c4..d64cd491 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 3fa8f862..1af9e093 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca1..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/test-project-android/build.gradle.kts b/test-project-android/build.gradle.kts index 8888c969..64ca208e 100644 --- a/test-project-android/build.gradle.kts +++ b/test-project-android/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("android") version "1.9.10" + kotlin("android") version "1.9.20" id("com.android.library") id("org.jmailen.kotlinter") } diff --git a/test-project/build.gradle.kts b/test-project/build.gradle.kts index 81370ba7..58e5b503 100644 --- a/test-project/build.gradle.kts +++ b/test-project/build.gradle.kts @@ -1,4 +1,4 @@ plugins { - kotlin("jvm") version "1.9.10" + kotlin("jvm") version "1.9.20" id("org.jmailen.kotlinter") }