Skip to content

Commit 996c99b

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

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
@@ -203,6 +203,18 @@ Alternative manual steps for IntelliJ.
203203
3. Navigate to the file `build-conventions/formatterConfig.xml`
204204
4. Click "OK"
205205

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

208220
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
@@ -180,6 +180,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
180180
// this path is produced by the extractLibs task above
181181
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
182182
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
183+
def delegateToGradle = providers.gradleProperty("org.elasticsearch.idea-delegate-to-gradle").getOrElse("false").toBoolean()
183184
idea {
184185
project {
185186
vcs = 'Git'
@@ -188,7 +189,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
188189
settings {
189190
delegateActions {
190191
delegateBuildRunToGradle = false
191-
testRunner = 'choose_per_test'
192+
testRunner = delegateToGradle ? 'gradle' : 'choose_per_test'
192193
}
193194
taskTriggers {
194195
afterSync tasks.named('configureIdeCheckstyle'),

0 commit comments

Comments
 (0)