Skip to content

Commit

Permalink
Target Java 17 bytecode for app. Target Java 21 bytecode for build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Dec 15, 2023
1 parent 73f70f3 commit 72ee6c5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -24,13 +23,13 @@ kotlin {

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
jvmTarget.set(JvmTarget.JVM_21)
}
}

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

detekt {
Expand All @@ -42,7 +41,7 @@ detekt {
}

tasks.withType<Detekt>().configureEach {
jvmTarget = JvmTarget.JVM_17.target
jvmTarget = JvmTarget.JVM_21.target
reports {
xml.required.set(false)
txt.required.set(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal fun Project.configureDetekt() {
parallel = true
}
tasks.withType<Detekt>().configureEach {
jvmTarget = JvmTarget.JVM_11.target
jvmTarget = JvmTarget.JVM_21.target
reports {
xml.required.set(false)
txt.required.set(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ internal fun TestedExtension.configureCommonAndroidOptions(project: Project) {
testOptions.animationsDisabled = true

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}

Expand Down Expand Up @@ -76,8 +76,8 @@ internal fun TestExtension.configureAndroidTestOptions() {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal fun KotlinProjectExtension.configureKotlinJvm(target: Project) {
}
target.tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
jvmTarget.set(JvmTarget.JVM_17)
}
}
}

0 comments on commit 72ee6c5

Please sign in to comment.