diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 456c54c8..b86dd62c 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -7,11 +7,11 @@ inputs: runs: using: "composite" steps: - - name: set up JDK 21 + - name: set up JDK 22 uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0 with: distribution: 'zulu' - java-version: '21' + java-version: '22' - name: Setup Gradle uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4 with: diff --git a/build-logic/gradle/gradle-daemon-jvm.properties b/build-logic/gradle/gradle-daemon-jvm.properties index 63e5bbdf..ef4314f5 100644 --- a/build-logic/gradle/gradle-daemon-jvm.properties +++ b/build-logic/gradle/gradle-daemon-jvm.properties @@ -1,2 +1,2 @@ #This file is generated by updateDaemonJvm -toolchainVersion=21 +toolchainVersion=22 diff --git a/build-logic/src/main/kotlin/dev/whosnickdoglio/buildlogic/RulesPlugin.kt b/build-logic/src/main/kotlin/dev/whosnickdoglio/buildlogic/RulesPlugin.kt index 21610edd..f54bcf89 100644 --- a/build-logic/src/main/kotlin/dev/whosnickdoglio/buildlogic/RulesPlugin.kt +++ b/build-logic/src/main/kotlin/dev/whosnickdoglio/buildlogic/RulesPlugin.kt @@ -11,8 +11,10 @@ import dev.whosnickdoglio.buildlogic.configuration.configureSpotless import dev.whosnickdoglio.buildlogic.configuration.configureTests import dev.whosnickdoglio.buildlogic.configuration.dependOnBuildLogicTask import dev.whosnickdoglio.buildlogic.configuration.getVersionCatalog +import io.gitlab.arturbosch.detekt.Detekt import org.gradle.api.Plugin import org.gradle.api.Project +import org.jetbrains.kotlin.gradle.dsl.JvmTarget class RulesPlugin : Plugin { override fun apply(target: Project) { @@ -32,6 +34,10 @@ class RulesPlugin : Plugin { dependOnBuildLogicTask("sortDependencies") dependOnBuildLogicTask("checkSortDependencies") + tasks.withType(Detekt::class.java).configureEach { + it.jvmTarget = JvmTarget.JVM_17.target + } + configureJvm(libs.findVersion("jdk").get().requiredVersion.toInt()) configureLint() configureSpotless(libs.findVersion("ktlint").get().requiredVersion) diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties index 63e5bbdf..ef4314f5 100644 --- a/gradle/gradle-daemon-jvm.properties +++ b/gradle/gradle-daemon-jvm.properties @@ -1,2 +1,2 @@ #This file is generated by updateDaemonJvm -toolchainVersion=21 +toolchainVersion=22 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 11ec81c7..aaf70e85 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ lint = "31.6.0" detekt = "1.23.7" kover = "0.8.3" spotless = "7.0.0.BETA2" -jdk = "21" +jdk = "22" sort = "0.8" dagger = "2.52" diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts index d89928ab..8694bd2a 100644 --- a/test-app/build.gradle.kts +++ b/test-app/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -71,22 +72,6 @@ android { } } -tasks.withType().configureEach { - // TODO necessary until anvil supports something for K2 contribution merging - compilerOptions { - progressiveMode.set(false) - languageVersion.set(KotlinVersion.KOTLIN_1_9) - } -} - -tasks.withType().configureEach { - // TODO necessary until anvil supports something for K2 contribution merging - compilerOptions { - progressiveMode.set(false) - languageVersion.set(KotlinVersion.KOTLIN_1_9) - } -} - spotless { format("misc") { target("*.md", ".gitignore") @@ -106,6 +91,29 @@ spotless { } } +tasks.withType().configureEach { + sourceCompatibility = JavaVersion.VERSION_17.toString() + targetCompatibility = JavaVersion.VERSION_17.toString() +} + +tasks.withType().configureEach { + compilerOptions { + allWarningsAsErrors = true + jvmTarget = JvmTarget.JVM_17 + // TODO necessary until anvil supports something for K2 contribution merging + progressiveMode.set(false) + languageVersion.set(KotlinVersion.KOTLIN_1_9) + } +} + +tasks.withType().configureEach { + // TODO necessary until anvil supports something for K2 contribution merging + compilerOptions { + progressiveMode.set(false) + languageVersion.set(KotlinVersion.KOTLIN_1_9) + } +} + dependencies { coreLibraryDesugaring(libs.desugar)