OpenSearch/distribution
Jake Landis 8d311297ca
[7.x] Smarter copying of the rest specs and tests (#52114) (#52798)
* Smarter copying of the rest specs and tests (#52114)

This PR addresses the unnecessary copying of the rest specs and allows
for better semantics for which specs and tests are copied. By default
the rest specs will get copied if the project applies
`elasticsearch.standalone-rest-test` or `esplugin` and the project
has rest tests or you configure the custom extension `restResources`.

This PR also removes the need for dozens of places where the x-pack
specs were copied by supporting copying of the x-pack rest specs too.

The plugin/task introduced here can also copy the rest tests to the
local project through a similar configuration.

The new plugin/task allows a user to minimize the surface area of
which rest specs are copied. Per project can be configured to include
only a subset of the specs (or tests). Configuring a project to only
copy the specs when actually needed should help with build cache hit
rates since we can better define what is actually in use.
However, project level optimizations for build cache hit rates are
not included with this PR.

Also, with this PR you can no longer use the includePackaged flag on
integTest task.

The following items are included in this PR:
* new plugin: `elasticsearch.rest-resources`
* new tasks: CopyRestApiTask and CopyRestTestsTask - performs the copy
* new extension 'restResources'
```
restResources {
  restApi {
    includeCore 'foo' , 'bar' //will include the core specs that start with foo and bar
    includeXpack 'baz' //will include x-pack specs that start with baz
  }
  restTests {
    includeCore 'foo', 'bar' //will include the core tests that start with foo and bar
    includeXpack 'baz' //will include the x-pack tests that start with baz
  }
}

```
2020-02-26 08:13:41 -06:00
..
archives [7.x] Smarter copying of the rest specs and tests (#52114) (#52798) 2020-02-26 08:13:41 -06:00
bwc Tag "nested" Gradle build scans (#51440) 2020-01-24 11:23:23 -08:00
docker [7.x] Smarter copying of the rest specs and tests (#52114) (#52798) 2020-02-26 08:13:41 -06:00
licenses Add notice for bundled jdk (#40576) 2019-03-29 17:21:21 -04:00
packages Upgrade to Gradle 6.2 (#51824) 2020-02-18 15:35:23 -08:00
src Limit _FILE env var support to specific vars (#52645) 2020-02-21 19:36:15 +00:00
tools Allow sha512 checksum without filename for maven plugins (#52668) 2020-02-24 13:38:20 -08:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00