Skip to content

Commit cbce7e1

Browse files
Add new option to allow full delegation of IntelliJ tests to Gradle (#126772) (#129619)
* 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 58b243c commit cbce7e1

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
@@ -144,6 +144,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
144144
// this path is produced by the extractLibs task above
145145
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
146146
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
147+
def delegateToGradle = providers.gradleProperty("org.elasticsearch.idea-delegate-to-gradle").getOrElse("false").toBoolean()
147148
idea {
148149
project {
149150
vcs = 'Git'
@@ -152,7 +153,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
152153
settings {
153154
delegateActions {
154155
delegateBuildRunToGradle = false
155-
testRunner = 'choose_per_test'
156+
testRunner = delegateToGradle ? 'gradle' : 'choose_per_test'
156157
}
157158
taskTriggers {
158159
afterSync tasks.named('configureIdeCheckstyle'), tasks.named('configureIdeaGradleJvm'), tasks.named('buildDependencyArtifacts')

0 commit comments

Comments
 (0)