Skip to content

Commit a92860b

Browse files
authored
[IDEA] Enable Gradle Configuration Cache for Gradle Test Runner (#123552) (#123622)
* [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
1 parent e33a8cd commit a92860b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ develocity {
133133
}
134134
} else {
135135
tag 'LOCAL'
136+
if (providers.systemProperty('idea.active').present) {
137+
tag 'IDEA'
138+
}
136139
}
137140
}
138141
}

build-tools-internal/src/main/groovy/elasticsearch.ide.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
174174

175175
// this path is produced by the extractLibs task above
176176
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
177-
177+
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
178178
idea {
179179
project {
180180
vcs = 'Git'
@@ -204,6 +204,11 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
204204
}
205205
}
206206
runConfigurations {
207+
defaults(org.jetbrains.gradle.ext.Gradle) {
208+
scriptParameters = enableIdeaCC ? [
209+
'--configuration-cache'
210+
].join(' ') : ''
211+
}
207212
defaults(JUnit) {
208213
vmParameters = [
209214
'-ea',

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ org.gradle.dependency.verification.console=verbose
1919

2020
# allow user to specify toolchain via the RUNTIME_JAVA_HOME environment variable
2121
org.gradle.java.installations.fromEnv=RUNTIME_JAVA_HOME
22+
23+
# if configuration cache enabled then enable parallel support too
24+
org.gradle.configuration-cache.parallel=true

0 commit comments

Comments
 (0)