Skip to content

Commit 17e35d4

Browse files
authored
[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
1 parent 84552f8 commit 17e35d4

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

+3
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
179179

180180
// this path is produced by the extractLibs task above
181181
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
182-
182+
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
183183
idea {
184184
project {
185185
vcs = 'Git'
@@ -209,6 +209,11 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
209209
}
210210
}
211211
runConfigurations {
212+
defaults(org.jetbrains.gradle.ext.Gradle) {
213+
scriptParameters = enableIdeaCC ? [
214+
'--configuration-cache'
215+
].join(' ') : ''
216+
}
212217
defaults(JUnit) {
213218
vmParameters = [
214219
'-ea',

gradle.properties

+3
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)