Skip to content

Commit

Permalink
🔀 Merge pull request #35 from mrljdx/main
Browse files Browse the repository at this point in the history
✏️ Fix compile error by modifying compileOptions and setting JVM target to 17
  • Loading branch information
vinceglb authored May 31, 2024
2 parents e360428 + eab07cf commit d2d9979
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
29 changes: 29 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions

plugins {
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.androidApplication) apply false
Expand All @@ -6,3 +9,29 @@ plugins {
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.mavenPublishVanniktech) apply false
}

allprojects {

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
tasks.withType<JavaCompile> {
sourceCompatibility = "${JavaVersion.VERSION_17}"
targetCompatibility = "${JavaVersion.VERSION_17}"
}
}
subprojects {
afterEvaluate {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
tasks.withType<JavaCompile> {
sourceCompatibility = "${JavaVersion.VERSION_17}"
targetCompatibility = "${JavaVersion.VERSION_17}"
}
}
}
4 changes: 2 additions & 2 deletions samples/sample-compose/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

Expand Down

0 comments on commit d2d9979

Please sign in to comment.