Skip to content

Commit b79a152

Browse files
JDK22 (#246)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> ## Related Issue <!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: --> ## Checklist <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the style guidelines of this project (`./gradlew lint spotlessCheck`) - [ ] I have performed a self-review of my own code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] I have checked my code and corrected any misspellings - [ ] I have mentioned changes in [CHANGELOG.md](../CHANGELOG.md). - [ ] I have read the [**CONTRIBUTING**](CONTRIBUTING.md) document. <!-- branch-stack --> - `main` - \#246 :point\_left:
1 parent ac91a13 commit b79a152

File tree

6 files changed

+35
-21
lines changed

6 files changed

+35
-21
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ inputs:
77
runs:
88
using: "composite"
99
steps:
10-
- name: set up JDK 21
10+
- name: set up JDK 22
1111
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
1212
with:
1313
distribution: 'zulu'
14-
java-version: '21'
14+
java-version: '22'
1515
- name: Setup Gradle
1616
uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4
1717
with:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#This file is generated by updateDaemonJvm
2-
toolchainVersion=21
2+
toolchainVersion=22

build-logic/src/main/kotlin/dev/whosnickdoglio/buildlogic/RulesPlugin.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import dev.whosnickdoglio.buildlogic.configuration.configureSpotless
1111
import dev.whosnickdoglio.buildlogic.configuration.configureTests
1212
import dev.whosnickdoglio.buildlogic.configuration.dependOnBuildLogicTask
1313
import dev.whosnickdoglio.buildlogic.configuration.getVersionCatalog
14+
import io.gitlab.arturbosch.detekt.Detekt
1415
import org.gradle.api.Plugin
1516
import org.gradle.api.Project
17+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
1618

1719
class RulesPlugin : Plugin<Project> {
1820
override fun apply(target: Project) {
@@ -32,6 +34,10 @@ class RulesPlugin : Plugin<Project> {
3234
dependOnBuildLogicTask("sortDependencies")
3335
dependOnBuildLogicTask("checkSortDependencies")
3436

37+
tasks.withType(Detekt::class.java).configureEach {
38+
it.jvmTarget = JvmTarget.JVM_17.target
39+
}
40+
3541
configureJvm(libs.findVersion("jdk").get().requiredVersion.toInt())
3642
configureLint()
3743
configureSpotless(libs.findVersion("ktlint").get().requiredVersion)

gradle/gradle-daemon-jvm.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#This file is generated by updateDaemonJvm
2-
toolchainVersion=21
2+
toolchainVersion=22

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ lint = "31.6.0"
88
detekt = "1.23.7"
99
kover = "0.8.3"
1010
spotless = "7.0.0.BETA2"
11-
jdk = "21"
11+
jdk = "22"
1212
sort = "0.8"
1313
dagger = "2.52"
1414

test-app/build.gradle.kts

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
23
import org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask
34
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@@ -71,22 +72,6 @@ android {
7172
}
7273
}
7374

74-
tasks.withType<KaptGenerateStubsTask>().configureEach {
75-
// TODO necessary until anvil supports something for K2 contribution merging
76-
compilerOptions {
77-
progressiveMode.set(false)
78-
languageVersion.set(KotlinVersion.KOTLIN_1_9)
79-
}
80-
}
81-
82-
tasks.withType<KotlinCompile>().configureEach {
83-
// TODO necessary until anvil supports something for K2 contribution merging
84-
compilerOptions {
85-
progressiveMode.set(false)
86-
languageVersion.set(KotlinVersion.KOTLIN_1_9)
87-
}
88-
}
89-
9075
spotless {
9176
format("misc") {
9277
target("*.md", ".gitignore")
@@ -106,6 +91,29 @@ spotless {
10691
}
10792
}
10893

94+
tasks.withType<JavaCompile>().configureEach {
95+
sourceCompatibility = JavaVersion.VERSION_17.toString()
96+
targetCompatibility = JavaVersion.VERSION_17.toString()
97+
}
98+
99+
tasks.withType<KotlinCompile>().configureEach {
100+
compilerOptions {
101+
allWarningsAsErrors = true
102+
jvmTarget = JvmTarget.JVM_17
103+
// TODO necessary until anvil supports something for K2 contribution merging
104+
progressiveMode.set(false)
105+
languageVersion.set(KotlinVersion.KOTLIN_1_9)
106+
}
107+
}
108+
109+
tasks.withType<KaptGenerateStubsTask>().configureEach {
110+
// TODO necessary until anvil supports something for K2 contribution merging
111+
compilerOptions {
112+
progressiveMode.set(false)
113+
languageVersion.set(KotlinVersion.KOTLIN_1_9)
114+
}
115+
}
116+
109117
dependencies {
110118
coreLibraryDesugaring(libs.desugar)
111119

0 commit comments

Comments
 (0)