Skip to content

Commit

Permalink
config all KotlinCompile by jvmTarget = "1.8"
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Dec 12, 2023
1 parent 7e5f702 commit e4a959d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions main/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
groovy
Expand Down Expand Up @@ -88,6 +90,7 @@ tasks.named<Jar>("jar") {
}
)
}

// NOTE: All artifacts must have the same name.
// If you are using multi-project for plugin publishing, please ensure all `Jar` tasks have the same name.
tasks.withType<Jar> {
Expand All @@ -101,11 +104,13 @@ java {
}

// JDK 8+ supports
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}

tasks.compileKotlin {
kotlinOptions.jvmTarget = "1.8"
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}

0 comments on commit e4a959d

Please sign in to comment.