Skip to content

Commit 0b2cde3

Browse files
authored
[IDEA] Enable Gradle Configuration Cache for Gradle Test Runner (#123552) (#123624)
* [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 250b431 commit 0b2cde3

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
@@ -144,7 +144,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
144144

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