From f51b2592a465f62750ca92c2f5b64cfa2d66ecdf Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Fri, 20 Sep 2019 14:51:09 -0700 Subject: [PATCH] Use composition instead of inheritance for extending Gradle plugins (#46888) --- .../org/elasticsearch/gradle/doc/DocsTestPlugin.groovy | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy index 53a022a5905..ef5392156f3 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy @@ -21,19 +21,21 @@ package org.elasticsearch.gradle.doc import org.elasticsearch.gradle.OS import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties -import org.elasticsearch.gradle.test.RestTestPlugin +import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task + /** * Sets up tests for documentation. */ -public class DocsTestPlugin extends RestTestPlugin { +class DocsTestPlugin implements Plugin { @Override - public void apply(Project project) { + void apply(Project project) { project.pluginManager.apply('elasticsearch.testclusters') project.pluginManager.apply('elasticsearch.standalone-rest-test') - super.apply(project) + project.pluginManager.apply('elasticsearch.rest-test') + String distribution = System.getProperty('tests.distribution', 'default') // The distribution can be configured with -Dtests.distribution on the command line project.testClusters.integTest.testDistribution = distribution.toUpperCase()