Skip to content

Commit

Permalink
commented java versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrakal committed Mar 12, 2024
1 parent 758f7d7 commit d247c90
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,50 @@ plugins {
alias(libs.plugins.ktlint)
}

kotlin {
jvmToolchain(libs.versions.java.get().toInt())
}
//kotlin {
// jvmToolchain(libs.versions.java.get().toInt())
//}
//
//java {
// sourceCompatibility = JavaVersion.toVersion(libs.versions.java.get())
// targetCompatibility = JavaVersion.toVersion(libs.versions.java.get())
//
// toolchain.languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get().toInt()))
//}

java {
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.get())
targetCompatibility = JavaVersion.toVersion(libs.versions.java.get())
//tasks.withType<JavaCompile> {
// options.compilerArgs.addAll(
// listOf(
// "-source",
// libs.versions.java.get(),
// "-target",
// libs.versions.java.get(),
// ),
// )
//}

toolchain.languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get().toInt()))
}
//tasks.withType<KotlinCompile> {
// kotlinOptions.jvmTarget = libs.versions.java.get()
//}

subprojects {
apply(plugin = rootProject.libs.plugins.ktlint.get().pluginId)
apply(plugin = rootProject.libs.plugins.detekt.get().pluginId)

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = libs.versions.java.get()
}

tasks.withType<JavaCompile> {
options.compilerArgs.addAll(
listOf(
"-source",
libs.versions.java.get(),
"-target",
libs.versions.java.get(),
),
)
}
// tasks.withType<KotlinCompile> {
// kotlinOptions.jvmTarget = libs.versions.java.get()
// }
//
// tasks.withType<JavaCompile> {
// options.compilerArgs.addAll(
// listOf(
// "-source",
// libs.versions.java.get(),
// "-target",
// libs.versions.java.get(),
// ),
// )
// }

configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
version.set(rootProject.libs.versions.ktlint.get())
Expand All @@ -50,7 +65,3 @@ subprojects {
parallel = true
}
}

// tasks.register("clean", Delete::class) {
// delete(rootProject.layout.buildDirectory)
// }

0 comments on commit d247c90

Please sign in to comment.