Skip to content

Commit 3807fa4

Browse files
authored
[IDEA] Enable Gradle Configuration Cache for Gradle Test Runner (#123552) (#123620)
* [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 dce4881 commit 3807fa4

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
@@ -129,6 +129,9 @@ develocity {
129129
}
130130
} else {
131131
tag 'LOCAL'
132+
if (providers.systemProperty('idea.active').present) {
133+
tag 'IDEA'
134+
}
132135
}
133136
}
134137
}

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

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

144144
// this path is produced by the extractLibs task above
145145
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
146-
146+
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
147147
idea {
148148
project {
149149
vcs = 'Git'
@@ -170,6 +170,11 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
170170
}
171171
}
172172
runConfigurations {
173+
defaults(org.jetbrains.gradle.ext.Gradle) {
174+
scriptParameters = enableIdeaCC ? [
175+
'--configuration-cache'
176+
].join(' ') : ''
177+
}
173178
defaults(JUnit) {
174179
vmParameters = [
175180
'-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)