Skip to content

Commit

Permalink
Update Gradle version and Java toolchain
Browse files Browse the repository at this point in the history
Updated Gradle version in gradle-wrapper.properties from 8.3 to 8.4. Also, reconfigured the Java and Kotlin JVM toolchains to use JetBrains JDK 17. In addition, added a new plugin "foojay-resolver-convention" in settings.gradle.kts.
  • Loading branch information
lamba92 committed Oct 31, 2023
1 parent 120bca5 commit 7da656a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/IdeaConfiguration.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import java.util.concurrent.atomic.AtomicBoolean
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.jvm.toolchain.JavaLanguageVersion

enum class SupportedIJVersion {
IJ_232,
Expand Down Expand Up @@ -35,3 +37,6 @@ fun Project.supportedIJVersion(): SupportedIJVersion {
)
}
}

fun Property<JavaLanguageVersion>.assign(version: Int) =
set(JavaLanguageVersion.of(version))
12 changes: 11 additions & 1 deletion buildSrc/src/main/kotlin/jewel.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ version = when {
else -> "1.0.0-SNAPSHOT"
}

java {
toolchain {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = 17
}
}

kotlin {
jvmToolchain(17)
jvmToolchain {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = 17
}
target {
compilations.all {
kotlinOptions {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 14 additions & 0 deletions samples/standalone/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,17 @@ compose.desktop {
}
}
}

tasks {
withType<JavaExec> {
// afterEvaluate is needed because the Compose Gradle Plugin
// register the task in the afterEvaluate block
afterEvaluate {
javaLauncher = project.javaToolchains.launcherFor {
languageVersion = 17
vendor = JvmVendorSpec.JETBRAINS
}
setExecutable(javaLauncher.map { it.executablePath.asFile.absolutePath }.get())
}
}
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencyResolutionManagement {

plugins {
id("com.gradle.enterprise") version "3.15.1"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

include(
Expand Down

0 comments on commit 7da656a

Please sign in to comment.