Skip to content

Commit

Permalink
JDK22
Browse files Browse the repository at this point in the history
  • Loading branch information
WhosNickDoglio committed Sep 12, 2024
1 parent 08bd70e commit a4087de
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build-logic/gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=21
toolchainVersion=22
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
override fun apply(target: Project) {
Expand All @@ -32,6 +34,10 @@ class RulesPlugin : Plugin<Project> {
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)
Expand Down
2 changes: 1 addition & 1 deletion gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=21
toolchainVersion=22
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
40 changes: 24 additions & 16 deletions test-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -71,22 +72,6 @@ android {
}
}

tasks.withType<KaptGenerateStubsTask>().configureEach {
// TODO necessary until anvil supports something for K2 contribution merging
compilerOptions {
progressiveMode.set(false)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
}
}

tasks.withType<KotlinCompile>().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")
Expand All @@ -106,6 +91,29 @@ spotless {
}
}

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}

tasks.withType<KotlinCompile>().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<KaptGenerateStubsTask>().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)

Expand Down

0 comments on commit a4087de

Please sign in to comment.