Skip to content

Commit 95a5ac7

Browse files
Add new option to allow full delegation of IntelliJ tests to Gradle (#126772) (#129620)
* Add new option to allow full delegation of tests to gradle in IntelliJ plus docs * Update CONTRIBUTING.md * Update CONTRIBUTING.md Fix typo in settings file name in docs --------- Co-authored-by: Rene Groeschke <[email protected]>
1 parent 9203140 commit 95a5ac7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@ Alternative manual steps for IntelliJ.
206206
3. Navigate to the file `build-conventions/formatterConfig.xml`
207207
4. Click "OK"
208208

209+
#### Options
210+
211+
When importing to IntelliJ, we offer a few options that can be used to
212+
configure the behaviour of the import:
213+
214+
| Property | Description | Values (* = default) |
215+
|--------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------|
216+
| `org.elasticsearch.idea-configuration-cache` | Should IntelliJ enable the Gradle Configuration cache to speed up builds when generating run configs | *`true`, `false` |
217+
| `org.elasticsearch.idea-delegate-to-gradle` | Should IntelliJ use Gradle for all generated run / test configs or prompt each time | `true`, *`false` |
218+
219+
These options can be set anywhere on the Gradle config path including in `~/.gradle/gradle.properties`
220+
209221
### REST endpoint conventions
210222

211223
Elasticsearch typically uses singular nouns rather than plurals in URLs.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
175175
// this path is produced by the extractLibs task above
176176
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
177177
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
178+
def delegateToGradle = providers.gradleProperty("org.elasticsearch.idea-delegate-to-gradle").getOrElse("false").toBoolean()
178179
idea {
179180
project {
180181
vcs = 'Git'
@@ -183,7 +184,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
183184
settings {
184185
delegateActions {
185186
delegateBuildRunToGradle = false
186-
testRunner = 'choose_per_test'
187+
testRunner = delegateToGradle ? 'gradle' : 'choose_per_test'
187188
}
188189
taskTriggers {
189190
afterSync tasks.named('configureIdeCheckstyle'),

0 commit comments

Comments
 (0)