Use composition instead of inheritance for extending Gradle plugins (#46888)

This commit is contained in:
Mark Vieira 2019-09-20 14:51:09 -07:00
parent a5661ac03a
commit f51b2592a4
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
1 changed files with 6 additions and 4 deletions

View File

@ -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<Project> {
@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()