diff --git a/.editorconfig b/.editorconfig index 2acae04..db02a8e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,4 +8,5 @@ max_line_length = 140 indent_size = 4 ij_kotlin_allow_trailing_comma = true ij_kotlin_allow_trailing_comma_on_call_site = true -ktlint_standard_property-naming = disabled \ No newline at end of file +ktlint_standard_property-naming = disabled +ktlint_code_style = intellij_idea \ No newline at end of file diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index a503add..cfe4c25 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 20 + java-version: 21 - uses: gradle/wrapper-validation-action@v1 @@ -62,7 +62,7 @@ jobs: matrix: os: [ ubuntu-latest, windows-latest ] gradle: [ current, release-candidate ] - java: [ 17, 20 ] + java: [ 17, 21 ] include: - os: ubuntu-latest gradle: 7.6 @@ -146,7 +146,7 @@ jobs: fail-fast: false matrix: gradle: [ current, release-candidate ] - java: [ 20 ] + java: [ 21 ] agp: ${{ fromJSON(needs.provide-agp-version-matrix.outputs.agp-versions) }} name: '[android] Gradle: ${{ matrix.gradle }}, Java: ${{ matrix.java }}, AGP: ${{ matrix.agp }}' diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index fa0b7c8..61f6122 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 20 + java-version: 21 - name: Assemble uses: gradle/gradle-build-action@v2 diff --git a/.github/workflows/diffuse.yml b/.github/workflows/diffuse.yml index df8bb2c..8d0e7e0 100644 --- a/.github/workflows/diffuse.yml +++ b/.github/workflows/diffuse.yml @@ -39,7 +39,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 20 + java-version: 21 - uses: actions/cache@v3 name: Download base diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 19d1930..d7866d3 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 diff --git a/.github/workflows/publish_snapshot.yml b/.github/workflows/publish_snapshot.yml index 4c017d3..2839163 100644 --- a/.github/workflows/publish_snapshot.yml +++ b/.github/workflows/publish_snapshot.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 20 + java-version: 21 - name: Build app with Gradle uses: gradle/gradle-build-action@v2 @@ -68,7 +68,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 diff --git a/build.gradle b/build.gradle index 511c0b1..2586e3c 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ allprojects { } } kotlin { - jvmToolchain(20) + jvmToolchain(21) } } pluginManager.withPlugin("java") { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 283bff8..e81761f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ google-agp = "8.1.2" google-ksp = "1.9.10-1.0.13" maven-junit = "5.10.0" maven-assertj = "3.24.2" -maven-ktlint = "1.0.0" +maven-ktlint = "1.0.1" maven-commons = "2.14.0" [libraries] diff --git a/gradle/plugins/build.gradle b/gradle/plugins/build.gradle index 1e40aed..d4dc667 100644 --- a/gradle/plugins/build.gradle +++ b/gradle/plugins/build.gradle @@ -8,7 +8,7 @@ plugins { kotlin { - jvmToolchain(20) + jvmToolchain(21) } def targetJavaVersion = JavaVersion.VERSION_11 diff --git a/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/EditorConfigTest.kt b/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/EditorConfigTest.kt index 50493ad..18bb005 100644 --- a/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/EditorConfigTest.kt +++ b/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/EditorConfigTest.kt @@ -42,8 +42,7 @@ internal class EditorConfigTest : WithGradleTest.Kotlin() { fun `lintTask uses default indentation if editorconfig absent`() { projectRoot.resolve("src/main/kotlin/FourSpacesByDefault.kt") { writeText( - """ | - |object FourSpacesByDefault { + """ |object FourSpacesByDefault { | val text: String |} | diff --git a/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/ThirdPartyPlugins.kt b/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/ThirdPartyPlugins.kt index d5cba5b..216a671 100644 --- a/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/ThirdPartyPlugins.kt +++ b/ktlint-gradle-plugin/src/test/kotlin/io/github/usefulness/functional/ThirdPartyPlugins.kt @@ -18,6 +18,9 @@ class ThirdPartyPlugins : WithGradleTest.Android() { // language=groovy writeText( """ + import org.gradle.api.JavaVersion + import org.jetbrains.kotlin.gradle.dsl.KotlinCompile + plugins { id 'org.jetbrains.kotlin.jvm' id 'com.google.devtools.ksp' @@ -27,7 +30,19 @@ class ThirdPartyPlugins : WithGradleTest.Android() { repositories.mavenCentral() dependencies { - ksp "com.google.dagger:dagger-compiler:2.48" + ksp "com.google.dagger:dagger-compiler:2.48.1" + } + + kotlin { + jvmToolchain(21) + } + + def targetJavaVersion = JavaVersion.VERSION_17 + tasks.withType(JavaCompile).configureEach { + options.release.set(targetJavaVersion.majorVersion.toInteger()) + } + tasks.withType(KotlinCompile).configureEach { + kotlinOptions.jvmTarget = targetJavaVersion } """.trimIndent(), @@ -96,7 +111,6 @@ class ThirdPartyPlugins : WithGradleTest.Android() { } } - repositories.mavenCentral() dependencies {