From 9a80a2d9efc05e96d382c50310aadb7567eb907e Mon Sep 17 00:00:00 2001 From: Pavel Karateev Date: Wed, 16 Jul 2025 17:05:08 +0200 Subject: [PATCH] PCQA-1107 explicitly declare JVM version otherwise the system version will be used, e.g., Java 8 on CI, and it will fail as `com.jetbrains.python.envs` is compiled with Java 17 (cherry picked from commit cc38a0bf6f3376d7c614a68646ccdab7088e2f8d) IJ-MR-169407 GitOrigin-RevId: 0594621cdf3bb406423b9f7183d3b6e1daa4336d --- python/setup-test-environment/build.gradle.kts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/setup-test-environment/build.gradle.kts b/python/setup-test-environment/build.gradle.kts index ff01c7ade484..c7cf38334e0d 100644 --- a/python/setup-test-environment/build.gradle.kts +++ b/python/setup-test-environment/build.gradle.kts @@ -6,9 +6,16 @@ import kotlin.io.path.createLinkPointingTo import kotlin.io.path.exists plugins { + id("java") id("com.jetbrains.python.envs") version "0.0.33" } +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} + enum class PythonType { PYTHON, CONDA } // If you decided to change a default path, make sure to update in `community/python/testSrc/com/jetbrains/env/PyEnvTestSettings.kt` val pythonsDirectory = File(System.getenv().getOrDefault("PYCHARM_PYTHONS", File(buildDir, "pythons").path)) @@ -75,7 +82,7 @@ tasks.register("kill_python_processes") { commandLine("powershell", """"Get-Process | where {${'$'}_.Name -ieq \"python\"} | Stop-Process"""") } -tasks.register("clean") { +tasks.named("clean") { dependsOn("kill_python_processes") delete(project.layout.buildDirectory) @@ -83,7 +90,7 @@ tasks.register("clean") { delete(venvsDirectory) } -tasks.register("build") { +tasks.named("build") { dependsOn(tasks.matching { it.name.startsWith("setup_") || it.name == "updateConda" }, "clean", "copy_buildserver_win_fix") }