diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2279737c40..10143e9508 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: - name: Setup Java JDK uses: actions/setup-java@v1.4.3 with: - java-version: 17 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/build.gradle.kts b/build.gradle.kts index 956441373b..66544fa414 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,14 +26,8 @@ allprojects { } } -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} - subprojects { tasks.withType { - kotlinOptions.jvmTarget = Versions.JVM_TARGET kotlinOptions.javaParameters = true } } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 5700c4c01d..77ba76e5a0 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -8,7 +8,7 @@ object Versions { const val KOTLIN_COROUTINES = "1.6.0" const val KOTLIN_LOGGING = "2.1.16" - const val JVM_TARGET = "17" + const val JVM_TARGET = "21" const val KOTLINX_DATE_TIME = "0.3.3" const val PROMETHEUS = "0.12.0" } \ No newline at end of file diff --git a/loritta-bot-discord/build.gradle.kts b/loritta-bot-discord/build.gradle.kts index bce768b690..149b148c9e 100644 --- a/loritta-bot-discord/build.gradle.kts +++ b/loritta-bot-discord/build.gradle.kts @@ -1,9 +1,3 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -tasks.withType { - kotlinOptions.jvmTarget = Versions.JVM_TARGET -} - plugins { java kotlin("jvm") @@ -211,7 +205,8 @@ jib { } } -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(Versions.JVM_TARGET)) + } } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 633cbd30c8..5b12a41588 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -50,6 +50,10 @@ dependencyResolutionManagement { } } +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" +} + rootProject.name = "loritta-parent" // ===[ PUDDING ]=== diff --git a/switch-twitch/build.gradle.kts b/switch-twitch/build.gradle.kts index 11a16f1e50..a67aa1a947 100644 --- a/switch-twitch/build.gradle.kts +++ b/switch-twitch/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { java kotlin("jvm") @@ -16,8 +14,10 @@ dependencies { implementation(libs.kotlinx.serialization.json) } -tasks.withType { - kotlinOptions.jvmTarget = Versions.JVM_TARGET +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(Versions.JVM_TARGET)) + } } tasks.test { diff --git a/temmie-discord-auth-loritta-commons/build.gradle.kts b/temmie-discord-auth-loritta-commons/build.gradle.kts index 5a93b7977e..be673f4fae 100644 --- a/temmie-discord-auth-loritta-commons/build.gradle.kts +++ b/temmie-discord-auth-loritta-commons/build.gradle.kts @@ -8,4 +8,10 @@ dependencies { implementation(libs.kotlinx.serialization.json) implementation(libs.ktor.server.core) implementation(libs.ktor.server.sessions) +} + +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(Versions.JVM_TARGET)) + } } \ No newline at end of file diff --git a/temmie-discord-auth/build.gradle.kts b/temmie-discord-auth/build.gradle.kts index 3f5fb35e2b..30d721f51f 100644 --- a/temmie-discord-auth/build.gradle.kts +++ b/temmie-discord-auth/build.gradle.kts @@ -27,6 +27,12 @@ dependencies { testImplementation("org.assertj:assertj-core:3.12.2") } +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(Versions.JVM_TARGET)) + } +} + tasks.test { useJUnitPlatform() }