From 9bdc82c5c4e198b1164a14cd6c705b1b38de8936 Mon Sep 17 00:00:00 2001 From: Jonathan Gafner Date: Sat, 16 Aug 2025 13:42:29 +0300 Subject: [PATCH] Refactor `build.gradle.kts`: remove redundant configurations, streamline `uiTest` setup, and clean up comments. --- build.gradle.kts | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1d7df5d..d214490 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,9 +31,7 @@ repositories { } } - - - +// Configure the uiTest SourceSet sourceSets { create("uiTest", Action { compileClasspath += sourceSets["main"].output + sourceSets["test"].output @@ -49,7 +47,6 @@ idea { } } - val uiTestImplementation: Configuration by configurations.getting { extendsFrom(configurations.testImplementation.get()) } @@ -77,7 +74,6 @@ dependencies { // Test framework dependencies testFramework(TestFrameworkType.Platform) - testFramework(TestFrameworkType.JUnit5) // UI Test framework dependencies testFramework(TestFrameworkType.Starter, configurationName = "uiTestImplementation") @@ -104,15 +100,6 @@ kotlin { vendor = JvmVendorSpec.JETBRAINS } - compilerOptions { - apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_2) - jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) - languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_2) - freeCompilerArgs.addAll( - "-Xjvm-default=all", - "-opt-in=kotlinx.serialization.ExperimentalSerializationApi" - ) - } } intellijPlatform { @@ -207,31 +194,7 @@ tasks { publishPlugin { dependsOn(patchChangelog) } - - test { - useJUnitPlatform { - excludeTags("ui") - } - - // Enable process-level parallelism (safer than method-level parallelism) - maxParallelForks = minOf(Runtime.getRuntime().availableProcessors() / 2, 3) - - // Keep JUnit execution sequential within each process for stability - systemProperty("junit.jupiter.execution.parallel.enabled", "false") - - - systemProperty("idea.home.path", prepareTestSandbox.get().getDestinationDir().parentFile.absolutePath) - systemProperty("idea.force.use.core.classloader", "true") - - jvmArgs = listOf( - "-Didea.trust.all.projects=true", - "--add-opens=java.base/java.lang=ALL-UNNAMED", - "--add-opens=java.desktop/javax.swing=ALL-UNNAMED" - ) - - dependsOn("buildPlugin") - } - + register("uiTest") { description = "Runs only the UI tests that start the IDE" group = "verification"