Skip to content

Commit c78e5a1

Browse files
committed
Add new option to allow full delegation of tests to gradle in IntelliJ plus docs
1 parent 55453ae commit c78e5a1

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 | *`ture`, `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.settings`
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
@@ -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)