[IDEA] Enable Gradle Configuration Cache for Gradle Test Runner (#123552)

* [IDEA] Enable Gradle Configuration Cache for Gradle Runner

This should speedup repetitives usages of the Gradle Runner for the majority of test executions
We added a flag to disable it explicitly if it does not work for certain scenarios
This commit is contained in:
Rene Groeschke 2025-02-27 17:34:02 +01:00 committed by GitHub
parent 84552f8d83
commit 17e35d431b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View file

@ -133,6 +133,9 @@ develocity {
}
} else {
tag 'LOCAL'
if (providers.systemProperty('idea.active').present) {
tag 'IDEA'
}
}
}
}

View file

@ -179,7 +179,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
// this path is produced by the extractLibs task above
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
idea {
project {
vcs = 'Git'
@ -209,6 +209,11 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
}
}
runConfigurations {
defaults(org.jetbrains.gradle.ext.Gradle) {
scriptParameters = enableIdeaCC ? [
'--configuration-cache'
].join(' ') : ''
}
defaults(JUnit) {
vmParameters = [
'-ea',

View file

@ -19,3 +19,6 @@ org.gradle.dependency.verification.console=verbose
# allow user to specify toolchain via the RUNTIME_JAVA_HOME environment variable
org.gradle.java.installations.fromEnv=RUNTIME_JAVA_HOME
# if configuration cache enabled then enable parallel support too
org.gradle.configuration-cache.parallel=true