Skip to content

Commit

Permalink
Merge pull request #126 from overpas/#125/jvm-version
Browse files Browse the repository at this point in the history
Handle jvm source and target compatibility in each module
  • Loading branch information
overpas authored Oct 27, 2024
2 parents 91fe8ac + 08bd81a commit 70b31ce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
9 changes: 9 additions & 0 deletions benchmark/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.tasks.KotlinCompile

plugins {
alias(libs.plugins.android.test)
alias(libs.plugins.kotlin.android)
Expand Down Expand Up @@ -51,4 +54,10 @@ androidComponents {
beforeVariants(selector().all()) {
it.enable = it.buildType == "benchmark"
}
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(properties["jvm.version"].toString())
}
}
15 changes: 9 additions & 6 deletions sample/android/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.tasks.KotlinCompile

plugins {
alias(libs.plugins.android.app)
alias(libs.plugins.kotlin.android)
Expand Down Expand Up @@ -37,12 +40,6 @@ android {
matchingFallbacks += listOf("release")
isDebuggable = false
}
// create("benchmark") {
// initWith(release)
// signingConfig = signingConfigs.getByName("debug")
// matchingFallbacks.add("release")
// proguardFiles("benchmark-rules.pro")
// }
}
compileOptions {
sourceCompatibility = JavaVersion.toVersion(properties["jvm.version"].toString())
Expand All @@ -61,4 +58,10 @@ dependencies {
implementation(libs.androidx.profile.installer)
debugImplementation(libs.compose.runtime.tracing)
detektPlugins(libs.compose.detekt.rules)
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(properties["jvm.version"].toString())
}
}
13 changes: 13 additions & 0 deletions sample/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.kotlin.multiplatform)
Expand Down Expand Up @@ -35,3 +37,14 @@ compose.desktop {
dependencies {
detektPlugins(libs.compose.detekt.rules)
}

java {
sourceCompatibility = JavaVersion.toVersion(properties["jvm.version"].toString())
targetCompatibility = JavaVersion.toVersion(properties["jvm.version"].toString())
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(properties["jvm.version"].toString())
}
}

0 comments on commit 70b31ce

Please sign in to comment.