Skip to content

Commit

Permalink
Minor updates to the build files (#442)
Browse files Browse the repository at this point in the history
* Minor updates to the build files

* Remove javaToolchain, rely only on Kotlin's

* Remove one more javaToolchain
  • Loading branch information
rock3r committed Jul 15, 2024
1 parent 119c856 commit 26305b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
10 changes: 10 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import java.util.Properties

plugins {
`kotlin-dsl`
alias(libs.plugins.kotlinx.serialization)
}

val properties = Properties()
project.file("../gradle.properties").inputStream().use { properties.load(it) }

val jdkLevel = properties.getProperty("jdk.level") as String
kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(jdkLevel)
}

sourceSets {
all {
languageSettings {
Expand Down
18 changes: 0 additions & 18 deletions buildSrc/src/main/kotlin/jewel.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ version = when {
}

val jdkLevel = project.property("jdk.level") as String
java {
toolchain {
languageVersion = JavaLanguageVersion.of(jdkLevel)
}

}

kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(jdkLevel)
Expand Down Expand Up @@ -87,14 +80,3 @@ configurations.named("sarif") {
artifact(sarifReport) { builtBy(tasks.lintKotlinMain) }
}
}

fun Task.removeAssembleDependency() {
setDependsOn(
dependsOn.filter {
when {
it is Task && it.name == "assemble" -> false
else -> true
}
}
)
}
9 changes: 2 additions & 7 deletions samples/standalone/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ dependencies {
implementation(libs.intellijPlatform.icons)
}

java {
toolchain {
vendor = JvmVendorSpec.JETBRAINS
}
}

val jdkLevel = project.property("jdk.level") as String
kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(jdkLevel)
vendor = JvmVendorSpec.JETBRAINS
}
}
Expand Down Expand Up @@ -56,7 +52,6 @@ compose.desktop {
}
}

val jdkLevel = project.property("jdk.level") as String
tasks {
withType<JavaExec> {
// afterEvaluate is needed because the Compose Gradle Plugin
Expand Down

0 comments on commit 26305b8

Please sign in to comment.