Make AntFixture handling task provider api compliant (#65832)

This tweaks the AntFixture handling to make it compliant with the task avoidance api.
Tasks of type StandaloneRestTestTask are now generally finalised by using the typed ant stop task
which allows us to remove of errorprone dependsOn overrides in StandaloneRestTestTask. As a result
we also ported more task definitions in the build to task avoidance api.

Next work item regarding AntFixture handling is porting AntFixture to a plain Gradle task and remove
Groovy AntBuilder will allow us to port more build logic from Groovy to Java but is out of the scope of
This PR.
This commit is contained in:
Rene Groeschke 2020-12-08 13:07:36 +01:00 committed by GitHub
parent c52f7f30fb
commit 0911d04467
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 182 additions and 123 deletions

View file

@ -33,15 +33,14 @@ esplugin {
// No unit tests in this example
tasks.named("test").configure { enabled = false }
tasks.register("exampleFixture", org.elasticsearch.gradle.test.AntFixture) {
def fixture = tasks.register("exampleFixture", org.elasticsearch.gradle.test.AntFixture) {
dependsOn sourceSets.javaRestTest.runtimeClasspath
env 'CLASSPATH', "${-> project.sourceSets.javaRestTest.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.elasticsearch.example.resthandler.ExampleFixture', baseDir, 'TEST'
}
javaRestTest {
dependsOn exampleFixture
nonInputProperties.systemProperty 'external.address', "${-> exampleFixture.addressAndPort}"
tasks.named("javaRestTest").configure {
dependsOn fixture
nonInputProperties.systemProperty 'external.address', "${-> fixture.get().addressAndPort}"
}